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:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user