From 07caf71ce38a0307a7c0d70b693952c2db46b441 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sat, 16 Sep 2023 12:50:51 +0200 Subject: [PATCH] =?UTF-8?q?demo:=20El=20teclado=20se=20crea=20y=20se=20des?= =?UTF-8?q?truye=20seg=C3=BAn=20se=20use=20o=20no?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 8 +++++--- units/on_screen_keyboard.cpp | 2 -- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index dca44b9..d166288 100644 --- a/main.cpp +++ b/main.cpp @@ -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: diff --git a/units/on_screen_keyboard.cpp b/units/on_screen_keyboard.cpp index c96bfdc..29a6cfb 100644 --- a/units/on_screen_keyboard.cpp +++ b/units/on_screen_keyboard.cpp @@ -172,8 +172,6 @@ void OnScreenKeyboard::setLayout() key.caption = allChars.substr(i, 1); layout.push_back(key); - // std::cout << key.caption << " " << key.col << " " << key.row << " " << std::endl; - ++index_col; if (index_col == columns) {