globalInputs implementat en totes les seccions excepte Title i Game

This commit is contained in:
2025-02-23 08:57:01 +01:00
parent 2ac425483b
commit 8ae686a70b
14 changed files with 121 additions and 305 deletions

View File

@@ -13,6 +13,7 @@
#include "utils.h" // Para color_t, stringToColor, options_t, secti...
#include "options.h"
#include "debug.h"
#include "global_inputs.h"
// Constructor
Demo::Demo()
@@ -87,45 +88,7 @@ void Demo::checkEvents()
// Comprueba las entradas
void Demo::checkInput()
{
if (input->checkInput(input_exit, REPEAT_FALSE))
{
options.section.name = SECTION_QUIT;
}
else if (input->checkInput(input_toggle_border, REPEAT_FALSE))
{
screen->toggleBorder();
reLoadTextures();
}
else if (input->checkInput(input_toggle_videomode, REPEAT_FALSE))
{
screen->toggleVideoMode();
reLoadTextures();
}
else if (input->checkInput(input_window_dec_size, REPEAT_FALSE))
{
screen->decWindowSize();
reLoadTextures();
}
else if (input->checkInput(input_window_inc_size, REPEAT_FALSE))
{
screen->incWindowSize();
reLoadTextures();
}
else if (input->checkInput(input_toggle_palette, REPEAT_FALSE))
{
switchPalette();
}
else if (input->checkInput(input_pause, REPEAT_FALSE) || input->checkInput(input_accept, REPEAT_FALSE) || input->checkInput(input_jump, REPEAT_FALSE))
{
options.section.name = SECTION_TITLE;
options.section.subsection = 0;
}
globalInputs::check();
}
// Bucle para el juego