From 856415c8c493f3a10348a3b57053adea00b40a5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Valor=20Mart=C3=ADnez?= Date: Sun, 12 Feb 2023 19:12:31 +0100 Subject: [PATCH] Ya funcionan los nuevos inputs de teclado y mando durante el juego --- source/game.cpp | 50 ++++++++++++++++-------------------------------- source/game.h | 3 --- source/title.cpp | 6 ------ 3 files changed, 16 insertions(+), 43 deletions(-) diff --git a/source/game.cpp b/source/game.cpp index 9cc9c5f..975e91e 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -3012,6 +3012,22 @@ void Game::checkGameInput() demo.keys.fireLeft = 0; demo.keys.fireRight = 0; + // Comprueba las teclas de cambiar el tamaƱo de la centana y el modo de video + if (input->checkInput(input_window_fullscreen, REPEAT_FALSE)) + { + screen->switchVideoMode(); + } + + else if (input->checkInput(input_window_dec_size, REPEAT_FALSE)) + { + screen->decWindowSize(); + } + + else if (input->checkInput(input_window_inc_size, REPEAT_FALSE)) + { + screen->incWindowSize(); + } + // Modo Demo activo if (demo.enabled) { @@ -3849,40 +3865,6 @@ void Game::checkEventHandler() section.subsection = GAME_SECTION_PAUSE; } } - - else if (eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0) - { - switch (eventHandler->key.keysym.scancode) - { - case SDL_SCANCODE_F: - screen->switchVideoMode(); - reloadTextures(); - break; - - case SDL_SCANCODE_F1: - screen->setWindowSize(1); - reloadTextures(); - break; - - case SDL_SCANCODE_F2: - screen->setWindowSize(2); - reloadTextures(); - break; - - case SDL_SCANCODE_F3: - screen->setWindowSize(3); - reloadTextures(); - break; - - case SDL_SCANCODE_F4: - screen->setWindowSize(4); - reloadTextures(); - break; - - default: - break; - } - } } } diff --git a/source/game.h b/source/game.h index 897be19..d0c30bd 100644 --- a/source/game.h +++ b/source/game.h @@ -418,9 +418,6 @@ private: // Acciones a realizar cuando el jugador muere void killPlayer(Player *player); - // Obtiene el valor de la variable - Uint8 getSubsection(); - // Calcula y establece el valor de amenaza en funcion de los globos activos void evaluateAndSetMenace(); diff --git a/source/title.cpp b/source/title.cpp index 464ef78..0051d81 100644 --- a/source/title.cpp +++ b/source/title.cpp @@ -710,12 +710,6 @@ void Title::checkInput() { screen->incWindowSize(); } - - else if (input->checkInput(input_pause, REPEAT_FALSE) || input->checkInput(input_accept, REPEAT_FALSE) || input->checkInput(input_fire_left, REPEAT_FALSE) || input->checkInput(input_fire_center, REPEAT_FALSE) || input->checkInput(input_fire_right, REPEAT_FALSE)) - { - section.name = PROG_SECTION_TITLE; - section.subsection = TITLE_SECTION_1; - } } // Actualiza el tileado de fondo