From 922d1467814511e155fed5a1f6d901ed13ad9d0c Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Mon, 9 Sep 2024 13:38:56 +0200 Subject: [PATCH] Renombrado "section->subsection" por el mas apropiado "section->options" --- source/common/utils.h | 2 +- source/const.h | 10 ++++++---- source/director.cpp | 4 ++-- source/game.cpp | 6 +++--- source/hiscore_table.cpp | 2 +- source/instructions.cpp | 4 ++-- source/intro.cpp | 6 +++--- source/logo.cpp | 2 +- source/title.cpp | 16 ++++++++-------- 9 files changed, 27 insertions(+), 25 deletions(-) diff --git a/source/common/utils.h b/source/common/utils.h index 385bc17..e32a829 100644 --- a/source/common/utils.h +++ b/source/common/utils.h @@ -66,7 +66,7 @@ enum not_pos_e struct section_t { Uint8 name; - Uint8 subsection; + Uint8 options; }; // Estructura para las entradas de la tabla de recirds diff --git a/source/const.h b/source/const.h index bd5895d..1d3731b 100644 --- a/source/const.h +++ b/source/const.h @@ -21,10 +21,12 @@ #define SECTION_PROG_QUIT 7 // Subsecciones -#define SUBSECTION_GAME_PLAY_1P 0 -#define SUBSECTION_GAME_PLAY_2P 1 -#define SUBSECTION_TITLE_1 3 -#define SUBSECTION_TITLE_2 4 +#define SECTION_OPTIONS_GAME_PLAY_1P 0 +#define SECTION_OPTIONS_GAME_PLAY_2P 1 +#define SECTION_OPTIONS_TITLE_1 3 +#define SECTION_OPTIONS_TITLE_2 4 +#define SECTION_OPTIONS_QUIT_NORMAL 5 +#define SECTION_OPTIONS_QUIT_SHUTDOWN 6 // Ningun tipo #define NO_KIND 0 diff --git a/source/director.cpp b/source/director.cpp index ce04da2..5b1ba53 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -19,7 +19,7 @@ Director::Director(int argc, char *argv[]) section = new section_t(); #ifdef RECORDING section->name = SECTION_PROG_GAME; - section->subsection = SUBSECTION_GAME_PLAY_1P; + section->options = SECTION_OPTIONS_GAME_PLAY_1P; #elif DEBUG section->name = SECTION_PROG_LOGO; #else @@ -849,7 +849,7 @@ void Director::runTitle() // Ejecuta la sección donde se juega al juego void Director::runGame() { - const int playerID = section->subsection == SUBSECTION_GAME_PLAY_1P ? 0 : 1; + const int playerID = section->options == SECTION_OPTIONS_GAME_PLAY_1P ? 0 : 1; game = new Game(playerID, 0, screen, asset, lang, input, false, param, options, section, getMusic(musics, "playing.ogg")); game->run(); delete game; diff --git a/source/game.cpp b/source/game.cpp index 718e7b5..58d7b34 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -171,7 +171,7 @@ void Game::init(int playerID) gameCompleted = false; gameCompletedCounter = 0; section->name = SECTION_PROG_GAME; - section->subsection = SUBSECTION_GAME_PLAY_1P; + section->options = SECTION_OPTIONS_GAME_PLAY_1P; currentPower = 0; menaceCurrent = 0; menaceThreshold = 0; @@ -2484,9 +2484,9 @@ void Game::updateGameCompleted() if (gameCompletedCounter == GAME_COMPLETED_END) { - // section->subsection = SUBSECTION_GAME_GAMEOVER; + // section->options = SUBSECTION_GAME_GAMEOVER; section->name = SECTION_PROG_TITLE; - section->subsection = SUBSECTION_TITLE_1; + section->options = SECTION_OPTIONS_TITLE_1; } } diff --git a/source/hiscore_table.cpp b/source/hiscore_table.cpp index cf34937..a74873d 100644 --- a/source/hiscore_table.cpp +++ b/source/hiscore_table.cpp @@ -203,7 +203,7 @@ void HiScoreTable::checkInput() { JA_StopMusic(); section->name = SECTION_PROG_TITLE; - section->subsection = SUBSECTION_TITLE_1; + section->options = SECTION_OPTIONS_TITLE_1; } // Comprueba el input para el resto de objetos diff --git a/source/instructions.cpp b/source/instructions.cpp index 4b9742f..6e01dcd 100644 --- a/source/instructions.cpp +++ b/source/instructions.cpp @@ -253,7 +253,7 @@ void Instructions::update() if (counter == counterEnd) { section->name = SECTION_PROG_TITLE; - section->subsection = SUBSECTION_TITLE_1; + section->options = SECTION_OPTIONS_TITLE_1; } } } @@ -332,7 +332,7 @@ void Instructions::checkInput() { JA_StopMusic(); section->name = SECTION_PROG_TITLE; - section->subsection = SUBSECTION_TITLE_1; + section->options = SECTION_OPTIONS_TITLE_1; } // Comprueba el input para el resto de objetos diff --git a/source/intro.cpp b/source/intro.cpp index e8c3d4d..be5a3c0 100644 --- a/source/intro.cpp +++ b/source/intro.cpp @@ -20,7 +20,7 @@ Intro::Intro(Screen *screen, Asset *asset, Input *input, Lang *lang, param_t *pa // Inicializa variables section->name = SECTION_PROG_INTRO; - section->subsection = 0; + section->options = 0; ticks = 0; ticksSpeed = 15; scene = 1; @@ -202,7 +202,7 @@ void Intro::checkInput() { JA_StopMusic(); section->name = SECTION_PROG_TITLE; - section->subsection = SUBSECTION_TITLE_1; + section->options = SECTION_OPTIONS_TITLE_1; } // Comprueba el input para el resto de objetos @@ -355,7 +355,7 @@ void Intro::updateScenes() texts[8]->setEnabled(false); JA_StopMusic(); section->name = SECTION_PROG_TITLE; - section->subsection = SUBSECTION_TITLE_1; + section->options = SECTION_OPTIONS_TITLE_1; } break; diff --git a/source/logo.cpp b/source/logo.cpp index c50bce7..02b6f31 100644 --- a/source/logo.cpp +++ b/source/logo.cpp @@ -111,7 +111,7 @@ void Logo::checkInput() else if (input->checkAnyButtonPressed()) { section->name = SECTION_PROG_TITLE; - section->subsection = SUBSECTION_TITLE_1; + section->options = SECTION_OPTIONS_TITLE_1; } // Comprueba el input para el resto de objetos diff --git a/source/title.cpp b/source/title.cpp index eefdd2b..1007444 100644 --- a/source/title.cpp +++ b/source/title.cpp @@ -59,7 +59,7 @@ Title::~Title() void Title::init() { // Inicializa variables - section->subsection = SUBSECTION_TITLE_1; + section->options = SECTION_OPTIONS_TITLE_1; counter = 0; nextSection.name = SECTION_PROG_GAME; postFade = 0; @@ -95,13 +95,13 @@ void Title::update() { case 1: // 1 PLAYER section->name = SECTION_PROG_GAME; - section->subsection = SUBSECTION_GAME_PLAY_1P; + section->options = SECTION_OPTIONS_GAME_PLAY_1P; JA_StopMusic(); break; case 2: // 2 PLAYER section->name = SECTION_PROG_GAME; - section->subsection = SUBSECTION_GAME_PLAY_2P; + section->options = SECTION_OPTIONS_GAME_PLAY_2P; JA_StopMusic(); break; @@ -115,17 +115,17 @@ void Title::update() } // Sección 1 - Titulo animandose - if (section->subsection == SUBSECTION_TITLE_1) + if (section->options == SECTION_OPTIONS_TITLE_1) { gameLogo->update(); if (gameLogo->hasFinished()) { - section->subsection = SUBSECTION_TITLE_2; + section->options = SECTION_OPTIONS_TITLE_2; } } // Sección 2 - La pantalla con el titulo, el fondo animado y la música - else if (section->subsection == SUBSECTION_TITLE_2) + else if (section->options == SECTION_OPTIONS_TITLE_2) { // El contador solo sube si no estamos definiendo botones if (!defineButtons->isEnabled()) @@ -169,7 +169,7 @@ void Title::render() // Dibuja el logo con el título del juego gameLogo->render(); - if (section->subsection == SUBSECTION_TITLE_2) + if (section->options == SECTION_OPTIONS_TITLE_2) { const color_t shadow = {0x14, 0x87, 0xc4}; // 'PULSA 1P o 2P PARA JUGAR' @@ -291,7 +291,7 @@ void Title::checkInput() { if (input->checkInput(input_start, false, INPUT_USE_GAMECONTROLLER, i)) { - if (section->subsection == SUBSECTION_TITLE_2 || ALLOW_TITLE_ANIMATION_SKIP) + if (section->options == SECTION_OPTIONS_TITLE_2 || ALLOW_TITLE_ANIMATION_SKIP) { fade->activate(); postFade = i + 1;