Añadido enter_id.cpp

Cambiados los defines de nombre de secciones y subsecciones
This commit is contained in:
2023-09-22 23:23:48 +02:00
parent 2e5f52d836
commit 337e6ed6cc
11 changed files with 490 additions and 108 deletions

View File

@@ -246,8 +246,8 @@ void Game::init()
gameCompleted = false;
gameCompletedCounter = 0;
section.name = PROG_SECTION_GAME;
section.subsection = GAME_SECTION_PLAY_1P;
section.name = SECTION_PROG_GAME;
section.subsection = SUBSECTION_GAME_PLAY_1P;
menaceCurrent = 0;
menaceThreshold = 0;
hiScoreAchieved = false;
@@ -1767,7 +1767,7 @@ void Game::updatePlayers()
{
if (demo.enabled)
{
section = {PROG_SECTION_TITLE, TITLE_SECTION_INSTRUCTIONS};
section = {SECTION_PROG_TITLE, SUBSECTION_TITLE_INSTRUCTIONS};
}
else
{
@@ -1866,7 +1866,7 @@ void Game::updateDeath()
}
else
{
section.subsection = GAME_SECTION_GAMEOVER;
section.subsection = SUBSECTION_GAME_GAMEOVER;
}
}
}
@@ -3089,7 +3089,7 @@ void Game::checkGameInput()
// Comprueba el input de pausa
if (input->checkInput(input_pause, REPEAT_FALSE))
{
section.name = PROG_SECTION_TITLE;
section.name = SECTION_PROG_TITLE;
}
// Incrementa el contador de la demo
@@ -3099,7 +3099,7 @@ void Game::checkGameInput()
}
else
{
section = {PROG_SECTION_TITLE, TITLE_SECTION_INSTRUCTIONS};
section = {SECTION_PROG_TITLE, SUBSECTION_TITLE_INSTRUCTIONS};
}
}
// Modo Demo no activo
@@ -3182,7 +3182,7 @@ void Game::checkGameInput()
// Comprueba el input de pausa
if (input->checkInput(input_cancel, REPEAT_FALSE, options->input[i].deviceType, options->input[i].id))
{
section.subsection = GAME_SECTION_PAUSE;
section.subsection = SUBSECTION_GAME_PAUSE;
}
if (demo.counter < TOTAL_DEMO_DATA)
@@ -3195,7 +3195,7 @@ void Game::checkGameInput()
}
else if (demo.recording)
{
section.name = PROG_SECTION_QUIT;
section.name = SECTION_PROG_QUIT;
}
i++;
@@ -3341,22 +3341,22 @@ void Game::shakeScreen()
// Bucle para el juego
section_t Game::run()
{
while (section.name == PROG_SECTION_GAME)
while (section.name == SECTION_PROG_GAME)
{
// Sección juego en pausa
if (section.subsection == GAME_SECTION_PAUSE)
if (section.subsection == SUBSECTION_GAME_PAUSE)
{
runPausedGame();
}
// Sección Game Over
if (section.subsection == GAME_SECTION_GAMEOVER)
if (section.subsection == SUBSECTION_GAME_GAMEOVER)
{
runGameOverScreen();
}
// Sección juego jugando
if ((section.subsection == GAME_SECTION_PLAY_1P) || (section.subsection == GAME_SECTION_PLAY_2P))
if ((section.subsection == SUBSECTION_GAME_PLAY_1P) || (section.subsection == SUBSECTION_GAME_PLAY_2P))
{
// Si la música no está sonando
if ((JA_GetMusicState() == JA_MUSIC_INVALID) || (JA_GetMusicState() == JA_MUSIC_STOPPED))
@@ -3412,8 +3412,8 @@ void Game::updatePausedGame()
}
else
{ // Ha finalizado el contador
section.name = PROG_SECTION_GAME;
section.subsection = numPlayers == 1 ? GAME_SECTION_PLAY_1P : GAME_SECTION_PLAY_2P;
section.name = SECTION_PROG_GAME;
section.subsection = numPlayers == 1 ? SUBSECTION_GAME_PLAY_1P : SUBSECTION_GAME_PLAY_2P;
if (JA_GetMusicState() == JA_MUSIC_PAUSED)
{
@@ -3448,8 +3448,8 @@ void Game::updatePausedGame()
fade->update();
if (fade->hasEnded())
{
section.name = PROG_SECTION_TITLE;
section.subsection = TITLE_SECTION_1;
section.name = SECTION_PROG_TITLE;
section.subsection = SUBSECTION_TITLE_1;
JA_StopMusic();
}
}
@@ -3519,7 +3519,7 @@ void Game::runPausedGame()
// Inicializa variables
pauseCounter = 90;
while ((section.subsection == GAME_SECTION_PAUSE) && (section.name == PROG_SECTION_GAME))
while ((section.subsection == SUBSECTION_GAME_PAUSE) && (section.name == SECTION_PROG_GAME))
{
updatePausedGame();
checkEvents();
@@ -3554,15 +3554,15 @@ void Game::updateGameOverScreen()
switch (postFade)
{
case 0: // YES
section.name = PROG_SECTION_GAME;
section.name = SECTION_PROG_GAME;
deleteAllVectorObjects();
init();
section.subsection = numPlayers == 1 ? GAME_SECTION_PLAY_1P : GAME_SECTION_PLAY_2P;
section.subsection = numPlayers == 1 ? SUBSECTION_GAME_PLAY_1P : SUBSECTION_GAME_PLAY_2P;
break;
case 1: // NO
section.name = PROG_SECTION_TITLE;
section.subsection = TITLE_SECTION_1;
section.name = SECTION_PROG_TITLE;
section.subsection = SUBSECTION_TITLE_1;
break;
default:
@@ -3600,7 +3600,7 @@ void Game::updateGameOverScreen()
// Evento de salida de la aplicación
if (eventHandler->type == SDL_QUIT)
{
section.name = PROG_SECTION_QUIT;
section.name = SECTION_PROG_QUIT;
break;
}
else if (eventHandler->type == SDL_KEYDOWN && eventHandler->key.repeat == 0)
@@ -3693,7 +3693,7 @@ void Game::runGameOverScreen()
// Reinicia el menu
gameOverMenu->reset();
while ((section.subsection == GAME_SECTION_GAMEOVER) && (section.name == PROG_SECTION_GAME))
while ((section.subsection == SUBSECTION_GAME_GAMEOVER) && (section.name == SECTION_PROG_GAME))
{
updateGameOverScreen();
renderGameOverScreen();
@@ -3806,7 +3806,7 @@ void Game::updateGameCompleted()
if (gameCompletedCounter == GAME_COMPLETED_END)
{
section.subsection = GAME_SECTION_GAMEOVER;
section.subsection = SUBSECTION_GAME_GAMEOVER;
}
}
@@ -3864,7 +3864,7 @@ void Game::checkEvents()
// Evento de salida de la aplicación
if (eventHandler->type == SDL_QUIT)
{
section.name = PROG_SECTION_QUIT;
section.name = SECTION_PROG_QUIT;
break;
}
@@ -3872,7 +3872,7 @@ void Game::checkEvents()
{
if (eventHandler->window.event == SDL_WINDOWEVENT_FOCUS_LOST)
{
section.subsection = GAME_SECTION_PAUSE;
section.subsection = SUBSECTION_GAME_PAUSE;
}
}
}