canvi de pc (toquejant Options)

This commit is contained in:
2025-06-14 16:28:36 +02:00
parent 4b8cc67b5c
commit 23e8f90274
27 changed files with 505 additions and 454 deletions

View File

@@ -49,13 +49,13 @@ Director::Director(int argc, const char *argv[])
section::name = section::Name::GAME;
section::options = section::Options::GAME_PLAY_1P;
#elif DEBUG
section::name = section::Name::LOGO;
section::options = section::Options::GAME_PLAY_1P;
Section::name = Section::Name::LOGO;
Section::options = Section::Options::GAME_PLAY_1P;
#else // NORMAL GAME
section::name = section::Name::LOGO;
section::options = section::Options::NONE;
#endif
section::attract_mode = section::AttractMode::TITLE_TO_DEMO;
Section::attract_mode = Section::AttractMode::TITLE_TO_DEMO;
// Establece el nivel de prioridad de la categoría de registro
SDL_SetLogPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
@@ -93,7 +93,7 @@ void Director::init()
loadScoreFile(); // Carga el archivo de puntuaciones
// Inicialización de subsistemas principales
lang::setLanguage(options.game.language); // Carga el archivo de idioma
Lang::setLanguage(options.game.language); // Carga el archivo de idioma
Screen::init(); // Inicializa la pantalla y el sistema de renderizado
Audio::init(); // Activa el sistema de audio
Resource::init(); // Inicializa el sistema de gestión de recursos
@@ -123,7 +123,7 @@ void Director::close()
SDL_Quit();
// Apaga el sistema
shutdownSystem(section::options == section::Options::SHUTDOWN);
shutdownSystem(Section::options == Section::Options::SHUTDOWN);
}
// Carga los parametros
@@ -574,7 +574,7 @@ void Director::runTitle()
// Ejecuta la sección donde se juega al juego
void Director::runGame()
{
const auto player_id = section::options == section::Options::GAME_PLAY_1P ? 1 : 2;
const auto player_id = Section::options == Section::Options::GAME_PLAY_1P ? 1 : 2;
#ifdef DEBUG
constexpr auto current_stage = 0;
#else
@@ -619,49 +619,49 @@ void Director::reset()
{
saveOptionsFile(Asset::get()->get("config.txt"));
loadOptionsFile(Asset::get()->get("config.txt"));
lang::setLanguage(options.game.language);
Lang::setLanguage(options.game.language);
Audio::get()->stopMusic();
Audio::get()->stopAllSounds();
if (section::options == section::Options::RELOAD || true)
if (Section::options == Section::Options::RELOAD || true)
{
Resource::get()->reload();
}
ServiceMenu::get()->reset();
section::name = section::Name::LOGO;
Section::name = Section::Name::LOGO;
}
int Director::run()
{
// Bucle principal
while (section::name != section::Name::QUIT)
while (Section::name != Section::Name::QUIT)
{
switch (section::name)
switch (Section::name)
{
case section::Name::RESET:
case Section::Name::RESET:
reset();
break;
case section::Name::LOGO:
case Section::Name::LOGO:
runLogo();
break;
case section::Name::INTRO:
case Section::Name::INTRO:
runIntro();
break;
case section::Name::TITLE:
case Section::Name::TITLE:
runTitle();
break;
case section::Name::GAME:
case Section::Name::GAME:
runGame();
break;
case section::Name::HI_SCORE_TABLE:
case Section::Name::HI_SCORE_TABLE:
runHiScoreTable();
break;
case section::Name::GAME_DEMO:
case Section::Name::GAME_DEMO:
runDemoGame();
break;
case section::Name::INSTRUCTIONS:
case Section::Name::INSTRUCTIONS:
runInstructions();
break;
case section::Name::CREDITS:
case Section::Name::CREDITS:
runCredits();
break;
default: