iOS: Fixed MFi game controller triggers to report the proper range of values.
authorAlex Szpakowski <slime73@gmail.com>
Mon, 09 Nov 2015 17:41:54 -0400
changeset 9908b63158b01a7d
parent 9907 2048ad756970
child 9909 b2c000b256ea
iOS: Fixed MFi game controller triggers to report the proper range of values.
src/joystick/iphoneos/SDL_sysjoystick.m
     1.1 --- a/src/joystick/iphoneos/SDL_sysjoystick.m	Mon Nov 09 08:55:07 2015 -0800
     1.2 +++ b/src/joystick/iphoneos/SDL_sysjoystick.m	Mon Nov 09 17:41:54 2015 -0400
     1.3 @@ -463,10 +463,10 @@
     1.4              /* Axis order matches the XInput Windows mappings. */
     1.5              SDL_PrivateJoystickAxis(joystick, 0, (Sint16) (gamepad.leftThumbstick.xAxis.value * 32767));
     1.6              SDL_PrivateJoystickAxis(joystick, 1, (Sint16) (gamepad.leftThumbstick.yAxis.value * -32767));
     1.7 -            SDL_PrivateJoystickAxis(joystick, 2, (Sint16) (gamepad.leftTrigger.value * 32767));
     1.8 +            SDL_PrivateJoystickAxis(joystick, 2, (Sint16) ((gamepad.leftTrigger.value * 65535) - 32768));
     1.9              SDL_PrivateJoystickAxis(joystick, 3, (Sint16) (gamepad.rightThumbstick.xAxis.value * 32767));
    1.10              SDL_PrivateJoystickAxis(joystick, 4, (Sint16) (gamepad.rightThumbstick.yAxis.value * -32767));
    1.11 -            SDL_PrivateJoystickAxis(joystick, 5, (Sint16) (gamepad.rightTrigger.value * 32767));
    1.12 +            SDL_PrivateJoystickAxis(joystick, 5, (Sint16) ((gamepad.rightTrigger.value * 65535) - 32768));
    1.13  
    1.14              hatstate = SDL_SYS_MFIJoystickHatStateForDPad(gamepad.dpad);
    1.15