diff --git a/source/director.cpp b/source/director.cpp index 375bd49..de3c446 100644 --- a/source/director.cpp +++ b/source/director.cpp @@ -187,6 +187,7 @@ void Director::bindInputs() Input::get()->bindKey(InputType::AUTO_FIRE, SDL_SCANCODE_F6); Input::get()->bindKey(InputType::CHANGE_LANG, SDL_SCANCODE_F7); Input::get()->bindKey(InputType::SHOWINFO, SDL_SCANCODE_F8); + Input::get()->bindKey(InputType::VIDEO_INTEGER_SCALE, SDL_SCANCODE_F9); Input::get()->bindKey(InputType::RESET, SDL_SCANCODE_F10); // Asigna botones a inputs diff --git a/source/global_inputs.cpp b/source/global_inputs.cpp index dcfd169..036ee6d 100644 --- a/source/global_inputs.cpp +++ b/source/global_inputs.cpp @@ -238,6 +238,14 @@ namespace globalInputs return; } + if (Input::get()->checkInput(InputType::VIDEO_INTEGER_SCALE, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD)) + { + options.video.integer_scale = !options.video.integer_scale; + SDL_RenderSetIntegerScale(Screen::get()->getRenderer(), options.video.integer_scale ? SDL_TRUE : SDL_FALSE); + Screen::get()->setVideoMode(); + Notifier::get()->show({"Integer scale " + std::string(options.video.integer_scale ? "on" : "off")}); + } + #ifdef DEBUG // Comprueba el teclado para mostrar la información de debug if (Input::get()->checkInput(InputType::SHOWINFO, INPUT_DO_NOT_ALLOW_REPEAT, InputDeviceToUse::KEYBOARD)) diff --git a/source/input.h b/source/input.h index f7f340c..ecd2e2e 100644 --- a/source/input.h +++ b/source/input.h @@ -38,6 +38,7 @@ enum class InputType : int WINDOW_INC_SIZE, WINDOW_DEC_SIZE, VIDEO_SHADERS, + VIDEO_INTEGER_SCALE, RESET, MUTE, CHANGE_LANG,