diff --git a/source/credits.cpp b/source/credits.cpp index 478fa2d..6da6f87 100644 --- a/source/credits.cpp +++ b/source/credits.cpp @@ -68,7 +68,7 @@ Credits::~Credits() } // Comprueba el manejador de eventos -void Credits::checkEventHandler() +void Credits::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -290,9 +290,6 @@ void Credits::updateCounter() // Actualiza las variables void Credits::update() { - // Comprueba el manejador de eventos - checkEventHandler(); - // Comprueba que la diferencia de ticks sea mayor a la velocidad del juego if (SDL_GetTicks() - ticks > ticksSpeed) { @@ -350,6 +347,7 @@ void Credits::run() while (section->name == SECTION_PROG_CREDITS) { update(); + checkEvents(); render(); } } diff --git a/source/credits.h b/source/credits.h index 7e8e4c9..3acee3e 100644 --- a/source/credits.h +++ b/source/credits.h @@ -55,7 +55,7 @@ private: void render(); // Comprueba el manejador de eventos - void checkEventHandler(); + void checkEvents(); // Comprueba las entradas void checkInput(); diff --git a/source/demo.cpp b/source/demo.cpp index 6986d4c..e610e10 100644 --- a/source/demo.cpp +++ b/source/demo.cpp @@ -61,7 +61,7 @@ Demo::~Demo() } // Comprueba los eventos de la cola -void Demo::checkEventHandler() +void Demo::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -127,6 +127,7 @@ void Demo::run() while (section->name == SECTION_PROG_DEMO) { update(); + checkEvents(); render(); } } @@ -134,9 +135,6 @@ void Demo::run() // Actualiza el juego, las variables, comprueba la entrada, etc. void Demo::update() { - // Comprueba los eventos de la cola - checkEventHandler(); - // Comprueba que la diferencia de ticks sea mayor a la velocidad del juego if (SDL_GetTicks() - ticks > ticksSpeed) { diff --git a/source/demo.h b/source/demo.h index f9d9b21..b373b17 100644 --- a/source/demo.h +++ b/source/demo.h @@ -55,7 +55,7 @@ private: void render(); // Comprueba los eventos de la cola - void checkEventHandler(); + void checkEvents(); // Comprueba las entradas void checkInput(); diff --git a/source/ending.cpp b/source/ending.cpp index 5ee50ed..2146282 100644 --- a/source/ending.cpp +++ b/source/ending.cpp @@ -85,9 +85,6 @@ Ending::~Ending() // Actualiza el objeto void Ending::update() { - // Comprueba el manejador de eventos - checkEventHandler(); - // Comprueba que la diferencia de ticks sea mayor a la velocidad del juego if (SDL_GetTicks() - ticks > ticksSpeed) { @@ -147,7 +144,7 @@ void Ending::render() } // Comprueba el manejador de eventos -void Ending::checkEventHandler() +void Ending::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -482,6 +479,7 @@ void Ending::run() while (section->name == SECTION_PROG_ENDING) { update(); + checkEvents(); render(); } diff --git a/source/ending.h b/source/ending.h index 8f95383..c514992 100644 --- a/source/ending.h +++ b/source/ending.h @@ -81,7 +81,7 @@ private: void render(); // Comprueba el manejador de eventos - void checkEventHandler(); + void checkEvents(); // Comprueba las entradas void checkInput(); diff --git a/source/ending2.cpp b/source/ending2.cpp index 95cdb85..ed62cb2 100644 --- a/source/ending2.cpp +++ b/source/ending2.cpp @@ -75,9 +75,6 @@ Ending2::~Ending2() // Actualiza el objeto void Ending2::update() { - // Comprueba el manejador de eventos - checkEventHandler(); - // Comprueba que la diferencia de ticks sea mayor a la velocidad del juego if (SDL_GetTicks() - ticks > ticksSpeed) { @@ -181,7 +178,7 @@ void Ending2::render() } // Comprueba el manejador de eventos -void Ending2::checkEventHandler() +void Ending2::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -239,6 +236,7 @@ void Ending2::run() while (section->name == SECTION_PROG_ENDING2) { update(); + checkEvents(); render(); } diff --git a/source/ending2.h b/source/ending2.h index 21e5262..bfee7d2 100644 --- a/source/ending2.h +++ b/source/ending2.h @@ -59,7 +59,7 @@ private: void render(); // Comprueba el manejador de eventos - void checkEventHandler(); + void checkEvents(); // Comprueba las entradas void checkInput(); diff --git a/source/enter_id.cpp b/source/enter_id.cpp index 87f97fc..4689013 100644 --- a/source/enter_id.cpp +++ b/source/enter_id.cpp @@ -68,12 +68,13 @@ void EnterID::run() while (section->name == SECTION_PROG_ENTER_ID) { update(); + checkEvents(); render(); } } // Comprueba el manejador de eventos -void EnterID::checkEventHandler() +void EnterID::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -182,9 +183,6 @@ void EnterID::update() // Actualiza el contador de ticks ticks = SDL_GetTicks(); - // Comprueba el manejador de eventos - checkEventHandler(); - // Actualiza el contador counter++; diff --git a/source/enter_id.h b/source/enter_id.h index c60dca9..1d7ca90 100644 --- a/source/enter_id.h +++ b/source/enter_id.h @@ -49,7 +49,7 @@ private: void render(); // Comprueba el manejador de eventos - void checkEventHandler(); + void checkEvents(); // Inicializa los textos void iniTexts(); diff --git a/source/game.cpp b/source/game.cpp index 517ec77..3f04586 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -110,7 +110,7 @@ Game::~Game() } // Comprueba los eventos de la cola -void Game::checkEventHandler() +void Game::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -244,6 +244,7 @@ void Game::run() while (section->name == SECTION_PROG_GAME) { update(); + checkEvents(); render(); } @@ -253,9 +254,6 @@ void Game::run() // Actualiza el juego, las variables, comprueba la entrada, etc. void Game::update() { - // Comprueba los eventos de la cola - checkEventHandler(); - // Comprueba que la diferencia de ticks sea mayor a la velocidad del juego if (SDL_GetTicks() - ticks > ticksSpeed) { diff --git a/source/game.h b/source/game.h index 5420f81..30c7be0 100644 --- a/source/game.h +++ b/source/game.h @@ -67,7 +67,7 @@ private: void render(); // Comprueba los eventos de la cola - void checkEventHandler(); + void checkEvents(); #ifdef DEBUG // Pone la información de debug en pantalla diff --git a/source/game_over.cpp b/source/game_over.cpp index 952e5cc..f88e108 100644 --- a/source/game_over.cpp +++ b/source/game_over.cpp @@ -57,9 +57,6 @@ GameOver::~GameOver() // Actualiza el objeto void GameOver::update() { - // Comprueba el manejador de eventos - checkEventHandler(); - // Comprueba que la diferencia de ticks sea mayor a la velocidad del juego if (SDL_GetTicks() - ticks > ticksSpeed) { @@ -118,7 +115,7 @@ void GameOver::render() } // Comprueba el manejador de eventos -void GameOver::checkEventHandler() +void GameOver::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -174,6 +171,7 @@ void GameOver::run() while (section->name == SECTION_PROG_GAME_OVER) { update(); + checkEvents(); render(); } } diff --git a/source/game_over.h b/source/game_over.h index 5a86491..a34bc8e 100644 --- a/source/game_over.h +++ b/source/game_over.h @@ -51,7 +51,7 @@ private: void render(); // Comprueba el manejador de eventos - void checkEventHandler(); + void checkEvents(); // Comprueba las entradas void checkInput(); diff --git a/source/intro.cpp b/source/intro.cpp index 4ce3ff1..9fb2f66 100644 --- a/source/intro.cpp +++ b/source/intro.cpp @@ -76,7 +76,7 @@ Intro::~Intro() } // Comprueba el manejador de eventos -void Intro::checkEventHandler() +void Intro::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -199,9 +199,6 @@ void Intro::renderLoad() // Actualiza las variables void Intro::update() { - // Comprueba el manejador de eventos - checkEventHandler(); - // Comprueba que la diferencia de ticks sea mayor a la velocidad del juego if (SDL_GetTicks() - ticks > ticksSpeed) { @@ -250,6 +247,7 @@ void Intro::run() while (section->name == SECTION_PROG_INTRO) { update(); + checkEvents(); render(); } diff --git a/source/intro.h b/source/intro.h index 6ffc86c..51bf5be 100644 --- a/source/intro.h +++ b/source/intro.h @@ -54,7 +54,7 @@ private: void render(); // Comprueba el manejador de eventos - void checkEventHandler(); + void checkEvents(); // Comprueba las entradas void checkInput(); diff --git a/source/logo.cpp b/source/logo.cpp index e9ed850..dd7eb32 100644 --- a/source/logo.cpp +++ b/source/logo.cpp @@ -70,7 +70,7 @@ Logo::~Logo() } // Comprueba el manejador de eventos -void Logo::checkEventHandler() +void Logo::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -254,9 +254,6 @@ void Logo::update() // Actualiza el contador de ticks ticks = SDL_GetTicks(); - // Comprueba el manejador de eventos - checkEventHandler(); - // Comprueba las entradas checkInput(); @@ -309,6 +306,7 @@ void Logo::run() while (section->name == SECTION_PROG_LOGO) { update(); + checkEvents(); render(); } } diff --git a/source/logo.h b/source/logo.h index 1c28d17..7b66903 100644 --- a/source/logo.h +++ b/source/logo.h @@ -47,7 +47,7 @@ private: void render(); // Comprueba el manejador de eventos - void checkEventHandler(); + void checkEvents(); // Comprueba las entradas void checkInput(); diff --git a/source/title.cpp b/source/title.cpp index 683eb2b..7a1b5e2 100644 --- a/source/title.cpp +++ b/source/title.cpp @@ -134,7 +134,7 @@ void Title::initMarquee() } // Comprueba el manejador de eventos -void Title::checkEventHandler() +void Title::checkEvents() { // Comprueba los eventos que hay en la cola while (SDL_PollEvent(eventHandler) != 0) @@ -268,9 +268,6 @@ void Title::renderInfo() // Actualiza las variables void Title::update() { - // Comprueba el manejador de eventos - checkEventHandler(); - // Comprueba que la diferencia de ticks sea mayor a la velocidad del juego if (SDL_GetTicks() - ticks > ticksSpeed) { @@ -343,6 +340,7 @@ void Title::run() while (section->name == SECTION_PROG_TITLE) { update(); + checkEvents(); render(); } } diff --git a/source/title.h b/source/title.h index 8167762..f6712e7 100644 --- a/source/title.h +++ b/source/title.h @@ -62,7 +62,7 @@ private: void render(); // Comprueba el manejador de eventos - void checkEventHandler(); + void checkEvents(); // Comprueba las entradas void checkInput();