Afegit global_events.cpp

This commit is contained in:
2025-03-10 23:24:00 +01:00
parent 9d98d3ea6a
commit 482dc3de54
26 changed files with 197 additions and 530 deletions

View File

@@ -15,7 +15,7 @@
#include "jail_audio.h" // Para JA_GetMusicState, JA_Music_state
#include "lang.h" // Para getText
#include "manage_hiscore_table.h" // Para HiScoreEntry
#include "mouse.h" // Para handleEvent
#include "global_events.h" // Para handleEvent
#include "options.h" // Para Options, OptionsGame, options
#include "param.h" // Para Param, param, ParamGame, ParamFade
#include "path_sprite.h" // Para PathSprite, Path, PathType
@@ -152,37 +152,13 @@ void HiScoreTable::render()
Screen::get()->render();
}
// Recarga todas las texturas
void HiScoreTable::reloadTextures()
{
}
// Comprueba los eventos
void HiScoreTable::checkEvents()
{
// Comprueba los eventos que hay en la cola
SDL_Event event;
while (SDL_PollEvent(&event))
{
// Evento de salida de la aplicación
if (event.type == SDL_QUIT)
{
section::name = section::Name::QUIT;
section::options = section::Options::QUIT_FROM_EVENT;
break;
}
// Comprueba si se ha cambiado el tamaño de la ventana
else if (event.type == SDL_WINDOWEVENT)
{
if (event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED)
{
reloadTextures();
}
}
// Comprueba el cursor
Mouse::handleEvent(event);
globalEvents::check(event);
}
}