Fix overflow in recent gamecontroller trigger change.
authorJørgen P. Tjernø <jorgen@valvesoftware.com>
Fri, 19 Apr 2013 16:02:16 -0700
changeset 7081 ab543a0ef80c
parent 7080 7353267a2ce2
child 7082 e9d6004d2978
Fix overflow in recent gamecontroller trigger change.
src/joystick/SDL_gamecontroller.c
--- a/src/joystick/SDL_gamecontroller.c	Fri Apr 19 10:51:21 2013 -0700
+++ b/src/joystick/SDL_gamecontroller.c	Fri Apr 19 16:02:16 2013 -0700
@@ -164,7 +164,7 @@
 							case SDL_CONTROLLER_AXIS_TRIGGERLEFT:
 							case SDL_CONTROLLER_AXIS_TRIGGERRIGHT:
 								/* Shift it to be 0 - 32767. */
-								value = ( value + 32768 ) / 2;
+								value = value / 2 + 16384;
 							default:
 								break;
 						}