Afegit globalEvents

This commit is contained in:
2025-02-23 09:53:06 +01:00
parent 8ae686a70b
commit 3ba4293e8a
16 changed files with 111 additions and 110 deletions

View File

@@ -23,6 +23,7 @@
#include "options.h"
#include "notifier.h"
#include "global_inputs.h"
#include "global_events.h"
// Constructor
Game::Game()
@@ -131,24 +132,13 @@ void Game::checkEvents()
SDL_Event event;
while (SDL_PollEvent(&event))
{
// Evento de salida de la aplicación
if (event.type == SDL_QUIT)
{
options.section.name = SECTION_QUIT;
screen_->setBorderColor(stringToColor(options.palette, "black"));
break;
}
if (event.type == SDL_RENDER_DEVICE_RESET || event.type == SDL_RENDER_TARGETS_RESET)
{
reLoadTextures();
}
globalEvents::check(event);
#ifdef DEBUG
if (event.type == SDL_KEYDOWN && event.key.repeat == 0)
{
switch (event.key.keysym.scancode)
{
#ifdef DEBUG
case SDL_SCANCODE_G:
debug_->switchEnabled();
options.cheat.invincible = debug_->getEnabled();
@@ -191,11 +181,11 @@ void Game::checkEvents()
case SDL_SCANCODE_F9:
Notifier::get()->show("JAILDESIGNER IS LOGGED IN", "", 5);
break;
#endif
default:
break;
}
}
#endif
}
}