From a1fb7500f0044bfcb6f9f7a566839a593d8ee259 Mon Sep 17 00:00:00 2001 From: Sergio Valor Date: Sat, 3 Aug 2024 08:05:43 +0200 Subject: [PATCH] afegida tecla de reset --- source/common/input.h | 1 + source/director.cpp | 1 + source/game.cpp | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/source/common/input.h b/source/common/input.h index 3744107..af3b329 100644 --- a/source/common/input.h +++ b/source/common/input.h @@ -37,6 +37,7 @@ enum inputs_e input_window_inc_size, input_window_dec_size, input_video_shaders, + input_reset, // Input obligatorio input_number_of_inputs diff --git a/source/director.cpp b/source/director.cpp index 6ae2d85..c6ab8f6 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -123,6 +123,7 @@ void Director::initInput() input->bindKey(input_window_inc_size, SDL_SCANCODE_F2); input->bindKey(input_window_fullscreen, SDL_SCANCODE_F3); input->bindKey(input_video_shaders, SDL_SCANCODE_F4); + input->bindKey(input_reset, SDL_SCANCODE_F10); const int numGamePads = input->getNumControllers(); for (int i = 0; i < numGamePads; ++i) diff --git a/source/game.cpp b/source/game.cpp index eb32196..eb76c77 100644 --- a/source/game.cpp +++ b/source/game.cpp @@ -2133,6 +2133,12 @@ void Game::checkInput() return; } + else if (input->checkInput(input_reset, DO_NOT_ALLOW_REPEAT)) + { + section->name = SECTION_PROG_LOGO; + return; + } + else if (input->checkInput(input_pause, DO_NOT_ALLOW_REPEAT)) { pause(!paused);