Afegida tecla per a canviar el escalat sencer

This commit is contained in:
2025-03-08 10:54:44 +01:00
parent d4e3995d71
commit fdb85ac393
5 changed files with 20 additions and 8 deletions

View File

@@ -77,6 +77,7 @@ Director::Director(int argc, const char *argv[])
// Crea los objetos
Screen::init(window_, renderer_);
SDL_ShowCursor(SDL_DISABLE);
Resource::init();
Notifier::init("", "8bithud");
Screen::get()->setNotificationsEnabled(true);
@@ -84,7 +85,6 @@ Director::Director(int argc, const char *argv[])
initInput();
Debug::init();
Cheevos::init(Asset::get()->get("cheevos.bin"));
SDL_ShowCursor(SDL_DISABLE);
}
Director::~Director()
@@ -247,6 +247,7 @@ void Director::initInput()
Input::get()->bindKey(InputAction::TOGGLE_SHADERS, SDL_SCANCODE_F4);
Input::get()->bindKey(InputAction::NEXT_PALETTE, SDL_SCANCODE_F5);
Input::get()->bindKey(InputAction::PREVIOUS_PALETTE, SDL_SCANCODE_F6);
Input::get()->bindKey(InputAction::TOGGLE_INTEGER_SCALE, SDL_SCANCODE_F7);
Input::get()->bindKey(InputAction::TOGGLE_MUSIC, SDL_SCANCODE_M);
Input::get()->bindKey(InputAction::TOGGLE_BORDER, SDL_SCANCODE_B);

View File

@@ -266,15 +266,15 @@ void Game::checkDebugEvents(const SDL_Event &event)
changeRoom(room_->getRoom(BORDER_RIGHT));
break;
case SDL_SCANCODE_F7:
Notifier::get()->show({"ACHIEVEMENT UNLOCKED!", "I LIKE MY MULTICOLOURED FRIENDS"}, NotificationText::LEFT, 3, false, "F7");
case SDL_SCANCODE_7:
Notifier::get()->show({"ACHIEVEMENT UNLOCKED!", "I LIKE MY MULTICOLOURED FRIENDS"}, NotificationText::CENTER, -1, false, "F7");
break;
case SDL_SCANCODE_F8:
case SDL_SCANCODE_8:
Notifier::get()->show({"JAILDESIGNER", "IS LOGGED IN"}, NotificationText::LEFT, 4, false);
break;
case SDL_SCANCODE_F9:
case SDL_SCANCODE_9:
Notifier::get()->show({"JAILDESIGNER", "IS LOGGED IN"}, NotificationText::LEFT, 5, false);
break;
default:

View File

@@ -104,5 +104,13 @@ namespace globalInputs
Screen::get()->previousPalette();
Notifier::get()->show({"PALETTE " + options.video.palette}, NotificationText::CENTER);
}
else if (Input::get()->checkInput(InputAction::TOGGLE_INTEGER_SCALE, REPEAT_FALSE))
{
options.video.integer_scale = !options.video.integer_scale;
SDL_RenderSetIntegerScale(Screen::get()->getRenderer(), options.video.integer_scale ? SDL_TRUE : SDL_FALSE);
Screen::get()->setVideoMode(options.video.mode);
Notifier::get()->show({"INTEGER SCALE " + std::string(options.video.integer_scale ? "ENABLED" : "DISABLED")}, NotificationText::CENTER);
}
}
}

View File

@@ -33,6 +33,7 @@ enum class InputAction
WINDOW_INC_ZOOM,
WINDOW_DEC_ZOOM,
TOGGLE_VIDEOMODE,
TOGGLE_INTEGER_SCALE,
TOGGLE_BORDER,
TOGGLE_MUSIC,
NEXT_PALETTE,