mirror of
https://github.com/joel16/SDL2.git
synced 2024-12-05 01:46:25 +00:00
Fixed bug in joystick motion, thanks to Alexandre Duret-Lutz
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%4050
This commit is contained in:
parent
4c41ee7dc2
commit
e82590fade
@ -235,7 +235,7 @@ void SDL_SYS_JoystickUpdate(SDL_Joystick *joystick)
|
||||
transaxis = joystick->hwdata->transaxis;
|
||||
for (i = 0; i < joystick->naxes; i++) {
|
||||
if (joyinfo.dwFlags & flags[i]) {
|
||||
value = (int)((float)(pos[i] + transaxis[i].offset) * transaxis[i].scale);
|
||||
value = (int)(((float)pos[i] + transaxis[i].offset) * transaxis[i].scale);
|
||||
change = (value - joystick->axes[i]);
|
||||
if ( (change < -JOY_AXIS_THRESHOLD) || (change > JOY_AXIS_THRESHOLD) ) {
|
||||
SDL_PrivateJoystickAxis(joystick, (Uint8)i, (Sint16)value);
|
||||
|
Loading…
Reference in New Issue
Block a user