Ya funcionan los nuevos inputs de teclado y mando durante el juego

This commit is contained in:
2023-02-12 19:12:31 +01:00
parent 64138c1017
commit 856415c8c4
3 changed files with 16 additions and 43 deletions

View File

@@ -3012,6 +3012,22 @@ void Game::checkGameInput()
demo.keys.fireLeft = 0; demo.keys.fireLeft = 0;
demo.keys.fireRight = 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 // Modo Demo activo
if (demo.enabled) if (demo.enabled)
{ {
@@ -3849,40 +3865,6 @@ void Game::checkEventHandler()
section.subsection = GAME_SECTION_PAUSE; 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;
}
}
} }
} }

View File

@@ -418,9 +418,6 @@ private:
// Acciones a realizar cuando el jugador muere // Acciones a realizar cuando el jugador muere
void killPlayer(Player *player); 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 // Calcula y establece el valor de amenaza en funcion de los globos activos
void evaluateAndSetMenace(); void evaluateAndSetMenace();

View File

@@ -710,12 +710,6 @@ void Title::checkInput()
{ {
screen->incWindowSize(); 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 // Actualiza el tileado de fondo