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

@@ -46,7 +46,7 @@ void Logo::checkLogoEnd()
}
// Comprueba los eventos
void Logo::checkEventHandler()
void Logo::checkEvents()
{
// Comprueba los eventos que hay en la cola
while (SDL_PollEvent(eventHandler) != 0)
@@ -106,7 +106,6 @@ void Logo::renderFade()
// Actualiza las variables del objeto
void Logo::update()
{
checkEventHandler();
checkInput();
if (SDL_GetTicks() - ticks > ticksSpeed)
@@ -152,6 +151,7 @@ section_t Logo::run()
while (section.name == PROG_SECTION_LOGO)
{
update();
checkEvents();
render();
}