diff --git a/source/common/screen.cpp b/source/common/screen.cpp index 42dc4a9..5631b31 100644 --- a/source/common/screen.cpp +++ b/source/common/screen.cpp @@ -353,9 +353,14 @@ void Screen::checkInput() } // Comprueba el botón de SERVICE - if (checkServiceButton(input) == SERVICE_SHADERS) + switch (checkServiceButton(input)) { + case SERVICE_SHADERS: switchShaders(); + break; + + default: + break; } } diff --git a/source/game.cpp b/source/game.cpp index 7b502ea..1ee9fa2 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -2050,35 +2050,24 @@ void Game::checkInput() switch (checkServiceButton(input)) { case SERVICE_RESET: - { section->name = SECTION_PROG_LOGO; screen->showNotification("Reset"); break; - } case SERVICE_MUTE: - { - const bool value = !options->audio.music.enabled; - options->audio.music.enabled = value; - options->audio.sound.enabled = value; - JA_EnableMusic(value); - JA_EnableSound(value); - const std::string text = value ? "on" : "off"; - screen->showNotification("Audio " + text); + options->audio.sound.enabled = options->audio.music.enabled = !options->audio.music.enabled; + JA_EnableMusic(options->audio.music.enabled); + JA_EnableSound(options->audio.sound.enabled); + screen->showNotification("Audio " + boolToOnOff(options->audio.music.enabled)); break; - } case SERVICE_PAUSE: - { pause(!paused); break; - } default: - { break; } - } // Modo Demo activo if (demo.enabled) diff --git a/source/hiscore_table.cpp b/source/hiscore_table.cpp index 91cf49f..302343f 100644 --- a/source/hiscore_table.cpp +++ b/source/hiscore_table.cpp @@ -212,29 +212,20 @@ void HiScoreTable::checkInput() switch (checkServiceButton(input)) { case SERVICE_RESET: - { section->name = SECTION_PROG_LOGO; screen->showNotification("Reset"); break; - } case SERVICE_MUTE: - { - const bool value = !options->audio.music.enabled; - options->audio.music.enabled = value; - options->audio.sound.enabled = value; - JA_EnableMusic(value); - JA_EnableSound(value); - const std::string text = value ? "on" : "off"; - screen->showNotification("Audio " + text); + options->audio.sound.enabled = options->audio.music.enabled = !options->audio.music.enabled; + JA_EnableMusic(options->audio.music.enabled); + JA_EnableSound(options->audio.sound.enabled); + screen->showNotification("Audio " + boolToOnOff(options->audio.music.enabled)); break; - } default: - { break; } - } // Comprueba el input para el resto de objetos screen->checkInput(); diff --git a/source/instructions.cpp b/source/instructions.cpp index 09fc5b3..ec98ebf 100644 --- a/source/instructions.cpp +++ b/source/instructions.cpp @@ -342,29 +342,20 @@ void Instructions::checkInput() switch (checkServiceButton(input)) { case SERVICE_RESET: - { section->name = SECTION_PROG_LOGO; screen->showNotification("Reset"); break; - } case SERVICE_MUTE: - { - const bool value = !options->audio.music.enabled; - options->audio.music.enabled = value; - options->audio.sound.enabled = value; - JA_EnableMusic(value); - JA_EnableSound(value); - const std::string text = value ? "on" : "off"; - screen->showNotification("Audio " + text); + options->audio.sound.enabled = options->audio.music.enabled = !options->audio.music.enabled; + JA_EnableMusic(options->audio.music.enabled); + JA_EnableSound(options->audio.sound.enabled); + screen->showNotification("Audio " + boolToOnOff(options->audio.music.enabled)); break; - } default: - { break; } - } // Comprueba el input para el resto de objetos screen->checkInput(); diff --git a/source/intro.cpp b/source/intro.cpp index dcc1eb5..8e316fd 100644 --- a/source/intro.cpp +++ b/source/intro.cpp @@ -211,29 +211,20 @@ void Intro::checkInput() switch (checkServiceButton(input)) { case SERVICE_RESET: - { section->name = SECTION_PROG_LOGO; screen->showNotification("Reset"); break; - } case SERVICE_MUTE: - { - const bool value = !options->audio.music.enabled; - options->audio.music.enabled = value; - options->audio.sound.enabled = value; - JA_EnableMusic(value); - JA_EnableSound(value); - const std::string text = value ? "on" : "off"; - screen->showNotification("Audio " + text); + options->audio.sound.enabled = options->audio.music.enabled = !options->audio.music.enabled; + JA_EnableMusic(options->audio.music.enabled); + JA_EnableSound(options->audio.sound.enabled); + screen->showNotification("Audio " + boolToOnOff(options->audio.music.enabled)); break; - } default: - { break; } - } // Comprueba el input para el resto de objetos screen->checkInput(); diff --git a/source/logo.cpp b/source/logo.cpp index 4659b0a..047041a 100644 --- a/source/logo.cpp +++ b/source/logo.cpp @@ -122,37 +122,21 @@ void Logo::checkInput() switch (checkServiceButton(input)) { case SERVICE_EXIT: - { section->name = SECTION_PROG_QUIT; section->options = SECTION_OPTIONS_QUIT_SHUTDOWN; return; break; - } - - case SERVICE_RESET: - { - section->name = SECTION_PROG_LOGO; - screen->showNotification("Reset"); - break; - } case SERVICE_MUTE: - { - const bool value = !options->audio.music.enabled; - options->audio.music.enabled = value; - options->audio.sound.enabled = value; - JA_EnableMusic(value); - JA_EnableSound(value); - const std::string text = value ? "on" : "off"; - screen->showNotification("Audio " + text); + options->audio.sound.enabled = options->audio.music.enabled = !options->audio.music.enabled; + JA_EnableMusic(options->audio.music.enabled); + JA_EnableSound(options->audio.sound.enabled); + screen->showNotification("Audio " + boolToOnOff(options->audio.music.enabled)); break; - } default: - { break; } - } // Comprueba el input para el resto de objetos screen->checkInput(); diff --git a/source/service.cpp b/source/service.cpp index a7eca78..80be531 100644 --- a/source/service.cpp +++ b/source/service.cpp @@ -16,12 +16,12 @@ int checkServiceButton(Input *input, int index) else if (input->checkInput(input_fire_left, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i)) { - return SERVICE_CONFIG; + return SERVICE_SHADERS; } else if (input->checkInput(input_fire_center, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i)) { - return SERVICE_SHADERS; + return SERVICE_RESET; } else if (input->checkInput(input_fire_right, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i)) @@ -36,7 +36,7 @@ int checkServiceButton(Input *input, int index) else if (input->checkInput(input_down, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i)) { - return SERVICE_RESET; + return SERVICE_CONFIG; } else if (input->checkInput(input_left, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, i)) @@ -57,12 +57,12 @@ int checkServiceButton(Input *input, int index) else if (input->checkInput(input_fire_left, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, index)) { - return SERVICE_CONFIG; + return SERVICE_SHADERS; } else if (input->checkInput(input_fire_center, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, index)) { - return SERVICE_SHADERS; + return SERVICE_RESET; } else if (input->checkInput(input_fire_right, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, index)) @@ -77,7 +77,7 @@ int checkServiceButton(Input *input, int index) else if (input->checkInput(input_down, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, index)) { - return SERVICE_RESET; + return SERVICE_CONFIG; } else if (input->checkInput(input_left, INPUT_DO_NOT_ALLOW_REPEAT, INPUT_USE_GAMECONTROLLER, index)) diff --git a/source/title.cpp b/source/title.cpp index 3928e9e..61d114d 100644 --- a/source/title.cpp +++ b/source/title.cpp @@ -271,35 +271,24 @@ void Title::checkInput() switch (checkServiceButton(input)) { case SERVICE_RESET: - { section->name = SECTION_PROG_LOGO; screen->showNotification("Reset"); break; - } case SERVICE_MUTE: - { - const bool value = !options->audio.music.enabled; - options->audio.music.enabled = value; - options->audio.sound.enabled = value; - JA_EnableMusic(value); - JA_EnableSound(value); - const std::string text = value ? "on" : "off"; - screen->showNotification("Audio " + text); + options->audio.sound.enabled = options->audio.music.enabled = !options->audio.music.enabled; + JA_EnableMusic(options->audio.music.enabled); + JA_EnableSound(options->audio.sound.enabled); + screen->showNotification("Audio " + boolToOnOff(options->audio.music.enabled)); break; - } case SERVICE_SWAP_CONTROLLERS: - { swapControllers(); break; - } default: - { break; } - } // Comprueba si algun mando quiere ser configurado for (int i = 0; i < input->getNumControllers(); ++i)