Corregido el orden de ejecución update-checkEvents-render en todas las secciones del juego para evitar que el juego tarde en actualizarse cuando hay muchos eventos

This commit is contained in:
2023-09-19 22:18:24 +02:00
parent 9bb4696eb9
commit 3ece7f9ec5
13 changed files with 49 additions and 54 deletions

View File

@@ -73,9 +73,6 @@ Instructions::~Instructions()
// Actualiza las variables
void Instructions::update()
{
// Comprueba los eventos
checkEventHandler();
// Comprueba las entradas
checkInput();
@@ -209,7 +206,7 @@ void Instructions::render()
}
// Comprueba los eventos
void Instructions::checkEventHandler()
void Instructions::checkEvents()
{
// Comprueba los eventos que hay en la cola
while (SDL_PollEvent(eventHandler) != 0)
@@ -272,6 +269,7 @@ section_t Instructions::run(mode_e mode)
while (section.name == SELF)
{
update();
checkEvents();
render();
}