migrant input: commit abans que gemini destroçe algo

This commit is contained in:
2025-08-04 11:37:46 +02:00
parent 90c080f3e3
commit 050b6716bf
10 changed files with 245 additions and 99 deletions

View File

@@ -213,12 +213,12 @@ void Title::printColorValue(const Color& color) {
void Title::handleControlKeys(SDL_Keycode key) {
switch (key) {
case SDLK_1:
define_buttons_->enable(Options::gamepads.at(0));
define_buttons_->enable(&Options::gamepads.getGamepad(Player::Id::PLAYER1));
resetCounter();
break;
case SDLK_2:
define_buttons_->enable(Options::gamepads.at(1));
define_buttons_->enable(&Options::gamepads.getGamepad(Player::Id::PLAYER2));
resetCounter();
break;
@@ -263,13 +263,13 @@ auto Title::shouldSkipInputCheck() const -> bool {
void Title::processControllerInputs() {
for (const auto& controller : Options::gamepads) {
if (isStartButtonPressed(controller)) {
handleStartButtonPress(controller);
if (isStartButtonPressed(&controller)) {
handleStartButtonPress(&controller);
}
}
}
auto Title::isStartButtonPressed(std::shared_ptr<Options::Gamepad> controller) -> bool {
auto Title::isStartButtonPressed(const Options::Gamepad *controller) -> bool {
return Input::get()->checkAction(
Input::Action::START,
Input::DO_NOT_ALLOW_REPEAT,
@@ -277,7 +277,7 @@ auto Title::isStartButtonPressed(std::shared_ptr<Options::Gamepad> controller) -
controller->instance);
}
void Title::handleStartButtonPress(std::shared_ptr<Options::Gamepad> controller) {
void Title::handleStartButtonPress(const Options::Gamepad *controller) {
if (!canProcessStartButton()) {
return;
}