Renombrado "section->subsection" por el mas apropiado "section->options"

This commit is contained in:
2024-09-09 13:38:56 +02:00
parent 1b2d1c5786
commit 922d146781
9 changed files with 27 additions and 25 deletions

View File

@@ -66,7 +66,7 @@ enum not_pos_e
struct section_t struct section_t
{ {
Uint8 name; Uint8 name;
Uint8 subsection; Uint8 options;
}; };
// Estructura para las entradas de la tabla de recirds // Estructura para las entradas de la tabla de recirds

View File

@@ -21,10 +21,12 @@
#define SECTION_PROG_QUIT 7 #define SECTION_PROG_QUIT 7
// Subsecciones // Subsecciones
#define SUBSECTION_GAME_PLAY_1P 0 #define SECTION_OPTIONS_GAME_PLAY_1P 0
#define SUBSECTION_GAME_PLAY_2P 1 #define SECTION_OPTIONS_GAME_PLAY_2P 1
#define SUBSECTION_TITLE_1 3 #define SECTION_OPTIONS_TITLE_1 3
#define SUBSECTION_TITLE_2 4 #define SECTION_OPTIONS_TITLE_2 4
#define SECTION_OPTIONS_QUIT_NORMAL 5
#define SECTION_OPTIONS_QUIT_SHUTDOWN 6
// Ningun tipo // Ningun tipo
#define NO_KIND 0 #define NO_KIND 0

View File

@@ -19,7 +19,7 @@ Director::Director(int argc, char *argv[])
section = new section_t(); section = new section_t();
#ifdef RECORDING #ifdef RECORDING
section->name = SECTION_PROG_GAME; section->name = SECTION_PROG_GAME;
section->subsection = SUBSECTION_GAME_PLAY_1P; section->options = SECTION_OPTIONS_GAME_PLAY_1P;
#elif DEBUG #elif DEBUG
section->name = SECTION_PROG_LOGO; section->name = SECTION_PROG_LOGO;
#else #else
@@ -849,7 +849,7 @@ void Director::runTitle()
// Ejecuta la sección donde se juega al juego // Ejecuta la sección donde se juega al juego
void Director::runGame() 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 = new Game(playerID, 0, screen, asset, lang, input, false, param, options, section, getMusic(musics, "playing.ogg"));
game->run(); game->run();
delete game; delete game;

View File

@@ -171,7 +171,7 @@ void Game::init(int playerID)
gameCompleted = false; gameCompleted = false;
gameCompletedCounter = 0; gameCompletedCounter = 0;
section->name = SECTION_PROG_GAME; section->name = SECTION_PROG_GAME;
section->subsection = SUBSECTION_GAME_PLAY_1P; section->options = SECTION_OPTIONS_GAME_PLAY_1P;
currentPower = 0; currentPower = 0;
menaceCurrent = 0; menaceCurrent = 0;
menaceThreshold = 0; menaceThreshold = 0;
@@ -2484,9 +2484,9 @@ void Game::updateGameCompleted()
if (gameCompletedCounter == GAME_COMPLETED_END) if (gameCompletedCounter == GAME_COMPLETED_END)
{ {
// section->subsection = SUBSECTION_GAME_GAMEOVER; // section->options = SUBSECTION_GAME_GAMEOVER;
section->name = SECTION_PROG_TITLE; section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_1; section->options = SECTION_OPTIONS_TITLE_1;
} }
} }

View File

@@ -203,7 +203,7 @@ void HiScoreTable::checkInput()
{ {
JA_StopMusic(); JA_StopMusic();
section->name = SECTION_PROG_TITLE; section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_1; section->options = SECTION_OPTIONS_TITLE_1;
} }
// Comprueba el input para el resto de objetos // Comprueba el input para el resto de objetos

View File

@@ -253,7 +253,7 @@ void Instructions::update()
if (counter == counterEnd) if (counter == counterEnd)
{ {
section->name = SECTION_PROG_TITLE; 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(); JA_StopMusic();
section->name = SECTION_PROG_TITLE; section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_1; section->options = SECTION_OPTIONS_TITLE_1;
} }
// Comprueba el input para el resto de objetos // Comprueba el input para el resto de objetos

View File

@@ -20,7 +20,7 @@ Intro::Intro(Screen *screen, Asset *asset, Input *input, Lang *lang, param_t *pa
// Inicializa variables // Inicializa variables
section->name = SECTION_PROG_INTRO; section->name = SECTION_PROG_INTRO;
section->subsection = 0; section->options = 0;
ticks = 0; ticks = 0;
ticksSpeed = 15; ticksSpeed = 15;
scene = 1; scene = 1;
@@ -202,7 +202,7 @@ void Intro::checkInput()
{ {
JA_StopMusic(); JA_StopMusic();
section->name = SECTION_PROG_TITLE; section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_1; section->options = SECTION_OPTIONS_TITLE_1;
} }
// Comprueba el input para el resto de objetos // Comprueba el input para el resto de objetos
@@ -355,7 +355,7 @@ void Intro::updateScenes()
texts[8]->setEnabled(false); texts[8]->setEnabled(false);
JA_StopMusic(); JA_StopMusic();
section->name = SECTION_PROG_TITLE; section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_1; section->options = SECTION_OPTIONS_TITLE_1;
} }
break; break;

View File

@@ -111,7 +111,7 @@ void Logo::checkInput()
else if (input->checkAnyButtonPressed()) else if (input->checkAnyButtonPressed())
{ {
section->name = SECTION_PROG_TITLE; section->name = SECTION_PROG_TITLE;
section->subsection = SUBSECTION_TITLE_1; section->options = SECTION_OPTIONS_TITLE_1;
} }
// Comprueba el input para el resto de objetos // Comprueba el input para el resto de objetos

View File

@@ -59,7 +59,7 @@ Title::~Title()
void Title::init() void Title::init()
{ {
// Inicializa variables // Inicializa variables
section->subsection = SUBSECTION_TITLE_1; section->options = SECTION_OPTIONS_TITLE_1;
counter = 0; counter = 0;
nextSection.name = SECTION_PROG_GAME; nextSection.name = SECTION_PROG_GAME;
postFade = 0; postFade = 0;
@@ -95,13 +95,13 @@ void Title::update()
{ {
case 1: // 1 PLAYER case 1: // 1 PLAYER
section->name = SECTION_PROG_GAME; section->name = SECTION_PROG_GAME;
section->subsection = SUBSECTION_GAME_PLAY_1P; section->options = SECTION_OPTIONS_GAME_PLAY_1P;
JA_StopMusic(); JA_StopMusic();
break; break;
case 2: // 2 PLAYER case 2: // 2 PLAYER
section->name = SECTION_PROG_GAME; section->name = SECTION_PROG_GAME;
section->subsection = SUBSECTION_GAME_PLAY_2P; section->options = SECTION_OPTIONS_GAME_PLAY_2P;
JA_StopMusic(); JA_StopMusic();
break; break;
@@ -115,17 +115,17 @@ void Title::update()
} }
// Sección 1 - Titulo animandose // Sección 1 - Titulo animandose
if (section->subsection == SUBSECTION_TITLE_1) if (section->options == SECTION_OPTIONS_TITLE_1)
{ {
gameLogo->update(); gameLogo->update();
if (gameLogo->hasFinished()) 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 // 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 // El contador solo sube si no estamos definiendo botones
if (!defineButtons->isEnabled()) if (!defineButtons->isEnabled())
@@ -169,7 +169,7 @@ void Title::render()
// Dibuja el logo con el título del juego // Dibuja el logo con el título del juego
gameLogo->render(); gameLogo->render();
if (section->subsection == SUBSECTION_TITLE_2) if (section->options == SECTION_OPTIONS_TITLE_2)
{ {
const color_t shadow = {0x14, 0x87, 0xc4}; const color_t shadow = {0x14, 0x87, 0xc4};
// 'PULSA 1P o 2P PARA JUGAR' // 'PULSA 1P o 2P PARA JUGAR'
@@ -291,7 +291,7 @@ void Title::checkInput()
{ {
if (input->checkInput(input_start, false, INPUT_USE_GAMECONTROLLER, i)) 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(); fade->activate();
postFade = i + 1; postFade = i + 1;