migrant input: corregit GamepadManager.swapPlayers()

This commit is contained in:
2025-08-04 12:42:55 +02:00
parent 450edbd8b0
commit 64ee4727ce
4 changed files with 38 additions and 34 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.getGamepad(Player::Id::PLAYER1));
define_buttons_->enable(&Options::gamepad_manager.getGamepad(Player::Id::PLAYER1));
resetCounter();
break;
case SDLK_2:
define_buttons_->enable(&Options::gamepads.getGamepad(Player::Id::PLAYER2));
define_buttons_->enable(&Options::gamepad_manager.getGamepad(Player::Id::PLAYER2));
resetCounter();
break;
@@ -262,14 +262,14 @@ auto Title::shouldSkipInputCheck() const -> bool {
}
void Title::processControllerInputs() {
for (const auto& controller : Options::gamepads) {
for (const auto& controller : Options::gamepad_manager) {
if (isStartButtonPressed(&controller)) {
handleStartButtonPress(&controller);
}
}
}
auto Title::isStartButtonPressed(const 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(const Options::Gamepad *controller) -> bool {
controller->instance);
}
void Title::handleStartButtonPress(const Options::Gamepad *controller) {
void Title::handleStartButtonPress(const Options::Gamepad* controller) {
if (!canProcessStartButton()) {
return;
}