Fixed bug in joystick motion, thanks to Alexandre Duret-Lutz
authorSam Lantinga <slouken@lokigames.com>
Thu, 07 Jun 2001 14:57:07 +0000
changeset 49 6f3c474f9abd
parent 48 f97decee03a9
child 50 eda2f15ffb70
Fixed bug in joystick motion, thanks to Alexandre Duret-Lutz
src/joystick/win32/SDL_mmjoystick.c
--- a/src/joystick/win32/SDL_mmjoystick.c	Thu Jun 07 14:53:18 2001 +0000
+++ b/src/joystick/win32/SDL_mmjoystick.c	Thu Jun 07 14:57:07 2001 +0000
@@ -235,7 +235,7 @@
 	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);