all repos — mgba @ e80cf92eeee2469823ef3187299fde115890340a

mGBA Game Boy Advance Emulator

Qt: Return active axis values as signs, to ensure sets are consistent
Jeffrey Pfau jeffrey@endrift.com
Thu, 18 Dec 2014 01:20:08 -0800
commit

e80cf92eeee2469823ef3187299fde115890340a

parent

0ae81e6e8fbb1e1fff888c01c3f0c44d1ebfa841

1 files changed, 1 insertions(+), 1 deletions(-)

jump to
M src/platform/qt/InputController.cppsrc/platform/qt/InputController.cpp

@@ -136,7 +136,7 @@ int i;

for (i = 0; i < numButtons; ++i) { int32_t axis = SDL_JoystickGetAxis(joystick, i); if (axis >= AXIS_THRESHOLD || axis <= -AXIS_THRESHOLD) { - activeAxes.insert(qMakePair(i, axis)); + activeAxes.insert(qMakePair(i, axis > 0 ? 1 : -1)); } } return activeAxes;