demo: El teclado se crea y se destruye según se use o no

This commit is contained in:
2023-09-16 12:50:51 +02:00
parent c656d48b72
commit 07caf71ce3
2 changed files with 5 additions and 5 deletions

View File

@@ -17,7 +17,9 @@ Código fuente creado por JailDesigner
#include "units/input.h"
#include "units/on_screen_keyboard.h"
#include "quickcg.h"
using namespace QuickCG;
using namespace std;
// Punteros
SDL_Event *event;
@@ -311,7 +313,7 @@ void initFire()
// Hue goes from 0 to 85: red to yellow
// Saturation is always the maximum: 255
// Lightness is 0..255 for x=0..128, and 255 for x=128..255
ColorRGB color = HSLtoRGB(ColorHSL(x / 3, 255, std::min(255, x * 2)));
ColorRGB color = HSLtoRGB(ColorHSL(x / 3, 255, min(255, x * 2)));
// Pon en la paleta el color calculado
palette[x] = (Uint32)16777216 * 255 + 65536 * color.r + 256 * color.g + color.b;
@@ -390,12 +392,12 @@ void checkEvents()
case SDL_SCANCODE_F3:
--fireModifier;
fireModifier = std::max(0, fireModifier);
fireModifier = max(0, fireModifier);
break;
case SDL_SCANCODE_F4:
++fireModifier;
fireModifier = std::min(30, fireModifier);
fireModifier = min(30, fireModifier);
break;
case SDL_SCANCODE_SPACE: