Añadidos mas ifdef DEBUG para quitar código sobrante de la versión final

This commit is contained in:
2022-11-16 20:24:49 +01:00
parent eed3f9d7d1
commit c6a1f4aab0
6 changed files with 91 additions and 79 deletions

View File

@@ -21,8 +21,8 @@ Game::Game(SDL_Renderer *renderer, Screen *screen, Resource *resource, Asset *as
this->options = options;
#ifdef DEBUG
currentRoom = "14.room";
const int x1 = 1;
currentRoom = "48.room";
const int x1 = 18;
const int y1 = 13;
spawnPoint = {x1 * 8, y1 * 8, 0, 0, 0, s_standing, SDL_FLIP_HORIZONTAL};
#endif
@@ -207,8 +207,11 @@ void Game::update()
// Comprueba los eventos de la cola
checkEventHandler();
// Actualiza los objetos
#ifdef DEBUG
debug->clear();
#endif
// Actualiza los objetos
room->update();
player->update();
checkPlayerOnBorder();
@@ -220,9 +223,11 @@ void Game::update()
scoreboard->update();
input->update();
updateDebugInfo();
updateBlackScreen();
screen->updateFX();
#ifdef DEBUG
updateDebugInfo();
#endif
}
}
@@ -241,14 +246,16 @@ void Game::render()
scoreboard->render();
renderBlackScreen();
#ifdef DEBUG
// Debug info
renderDebugInfo();
// screen->renderFX();
#endif
// Actualiza la pantalla
screen->blit();
}
#ifdef DEBUG
// Pasa la información de debug
void Game::updateDebugInfo()
{
@@ -285,6 +292,7 @@ void Game::renderDebugInfo()
debug->setPos({1, 18 * 8});
debug->render();
}
#endif
// Escribe el nombre de la pantalla
void Game::renderRoomName()