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

@@ -215,9 +215,6 @@ void Title::init()
// Actualiza las variables del objeto
void Title::update()
{
// Comprueba los eventos
checkEventHandler();
// Comprueba las entradas
checkInput();
@@ -670,7 +667,7 @@ void Title::render()
}
// Comprueba los eventos
void Title::checkEventHandler()
void Title::checkEvents()
{
// Comprueba los eventos que hay en la cola
while (SDL_PollEvent(eventHandler) != 0)
@@ -976,6 +973,7 @@ section_t Title::run()
while (section.name == PROG_SECTION_TITLE)
{
update();
checkEvents();
render();
}