Options: afegida opció per invertir el y_axis (la recre te els mandos mal cablejats)

This commit is contained in:
2025-06-26 22:26:38 +02:00
parent c923f0d310
commit ed91bff7df
4 changed files with 21 additions and 6 deletions

View File

@@ -160,8 +160,8 @@ void Director::loadScoreFile()
void Director::bindInputs()
{
// Teclado - Movimiento del jugador
Input::get()->bindKey(InputAction::UP, SDL_SCANCODE_UP);
Input::get()->bindKey(InputAction::DOWN, SDL_SCANCODE_DOWN);
Input::get()->bindKey(InputAction::UP, Options::settings.is_y_axis_inverted ? SDL_SCANCODE_DOWN : SDL_SCANCODE_UP);
Input::get()->bindKey(InputAction::DOWN, Options::settings.is_y_axis_inverted ? SDL_SCANCODE_UP : SDL_SCANCODE_DOWN);
Input::get()->bindKey(InputAction::LEFT, SDL_SCANCODE_LEFT);
Input::get()->bindKey(InputAction::RIGHT, SDL_SCANCODE_RIGHT);
@@ -202,8 +202,8 @@ void Director::bindInputs()
for (int i = 0; i < NUM_GAMEPADS; ++i)
{
// Mando - Movimiento del jugador
Input::get()->bindGameControllerButton(i, InputAction::UP, SDL_GAMEPAD_BUTTON_DPAD_UP);
Input::get()->bindGameControllerButton(i, InputAction::DOWN, SDL_GAMEPAD_BUTTON_DPAD_DOWN);
Input::get()->bindGameControllerButton(i, InputAction::UP, Options::settings.is_y_axis_inverted ? SDL_GAMEPAD_BUTTON_DPAD_DOWN : SDL_GAMEPAD_BUTTON_DPAD_UP);
Input::get()->bindGameControllerButton(i, InputAction::DOWN, Options::settings.is_y_axis_inverted ? SDL_GAMEPAD_BUTTON_DPAD_UP : SDL_GAMEPAD_BUTTON_DPAD_DOWN);
Input::get()->bindGameControllerButton(i, InputAction::LEFT, SDL_GAMEPAD_BUTTON_DPAD_LEFT);
Input::get()->bindGameControllerButton(i, InputAction::RIGHT, SDL_GAMEPAD_BUTTON_DPAD_RIGHT);