Skip to content

Commit

Permalink
use the same mapping for all controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Jan 25, 2017
1 parent 580cb93 commit 83c50d5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions pfba/gui/gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; i<PLAYER_COUNT; i++) {
input->SetJoystickMapping(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; i<PLAYER_COUNT; i++) {
input->SetJoystickMapping(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);
}
}
}

Expand Down

0 comments on commit 83c50d5

Please sign in to comment.