From 83c50d5076e249c3639298aee1ce22e81847384d Mon Sep 17 00:00:00 2001 From: rsn8887 Date: Tue, 24 Jan 2017 18:27:48 -0600 Subject: [PATCH] use the same mapping for all controllers --- pfba/gui/gui.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pfba/gui/gui.cpp b/pfba/gui/gui.cpp index 37cfd93..679c6da 100644 --- a/pfba/gui/gui.cpp +++ b/pfba/gui/gui.cpp @@ -998,19 +998,23 @@ void Gui::UpdateInputMapping(bool isRomConfig) { if (isRomConfig) { input->SetKeyboardMapping(config->GetRomPlayerInputKeys(0)); int deadzone = 2000 + config->GetRomValue(Option::Index::JOY_DEADZONE) * 2000; - input->SetJoystickMapping(0, config->GetRomPlayerInputButtons(0), deadzone); - input->players[0].axis_lx = config->GetRomValue(Option::Index::JOY_AXIS_LX); - input->players[0].axis_ly = config->GetRomValue(Option::Index::JOY_AXIS_LY); - input->players[0].axis_rx = config->GetRomValue(Option::Index::JOY_AXIS_RX); - input->players[0].axis_ry = config->GetRomValue(Option::Index::JOY_AXIS_RY); + for (int i=0; iSetJoystickMapping(i, config->GetRomPlayerInputButtons(i), deadzone); + input->players[i].axis_lx = config->GetRomValue(Option::Index::JOY_AXIS_LX); + input->players[i].axis_ly = config->GetRomValue(Option::Index::JOY_AXIS_LY); + input->players[i].axis_rx = config->GetRomValue(Option::Index::JOY_AXIS_RX); + input->players[i].axis_ry = config->GetRomValue(Option::Index::JOY_AXIS_RY); + } } else { input->SetKeyboardMapping(config->GetGuiPlayerInputKeys(0)); int deadzone = 2000 + config->GetGuiValue(Option::Index::JOY_DEADZONE) * 2000; - input->SetJoystickMapping(0, config->GetGuiPlayerInputButtons(0), deadzone); - input->players[0].axis_lx = config->GetGuiValue(Option::Index::JOY_AXIS_LX); - input->players[0].axis_ly = config->GetGuiValue(Option::Index::JOY_AXIS_LY); - input->players[0].axis_rx = config->GetGuiValue(Option::Index::JOY_AXIS_RX); - input->players[0].axis_ry = config->GetGuiValue(Option::Index::JOY_AXIS_RY); + for (int i=0; iSetJoystickMapping(i, config->GetGuiPlayerInputButtons(i), deadzone); + input->players[i].axis_lx = config->GetGuiValue(Option::Index::JOY_AXIS_LX); + input->players[i].axis_ly = config->GetGuiValue(Option::Index::JOY_AXIS_LY); + input->players[i].axis_rx = config->GetGuiValue(Option::Index::JOY_AXIS_RX); + input->players[i].axis_ry = config->GetGuiValue(Option::Index::JOY_AXIS_RY); + } } }