Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
The triggers should be expanded out to the full range to match Direct…
Browse files Browse the repository at this point in the history
…Input behavior.

The game controller code will scale them back to 0 - 32767 when it converts the triggers axes.
  • Loading branch information
slouken committed Jun 7, 2013
1 parent effc779 commit 68ff282
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/joystick/windows/SDL_dxjoystick.c
Expand Up @@ -1499,8 +1499,8 @@ SDL_SYS_JoystickUpdate_XInput(SDL_Joystick * joystick)
SDL_PrivateJoystickAxis(joystick, 1, (Sint16)(-1*pXInputState->Gamepad.sThumbLY-1) );
SDL_PrivateJoystickAxis(joystick, 2, (Sint16)pXInputState->Gamepad.sThumbRX );
SDL_PrivateJoystickAxis(joystick, 3, (Sint16)(-1*pXInputState->Gamepad.sThumbRY-1) );
SDL_PrivateJoystickAxis(joystick, 4, (Sint16)((int)pXInputState->Gamepad.bLeftTrigger*32767/255) );
SDL_PrivateJoystickAxis(joystick, 5, (Sint16)((int)pXInputState->Gamepad.bRightTrigger*32767/255) );
SDL_PrivateJoystickAxis(joystick, 4, (Sint16)(((int)pXInputState->Gamepad.bLeftTrigger*65535/255) - 32768));
SDL_PrivateJoystickAxis(joystick, 5, (Sint16)(((int)pXInputState->Gamepad.bRightTrigger*65535/255) - 32768));

if ( ButtonChanged( pXInputState->Gamepad.wButtons, pXInputStatePrev->Gamepad.wButtons, XINPUT_GAMEPAD_DPAD_UP ) )
SDL_PrivateJoystickButton(joystick, 0, pXInputState->Gamepad.wButtons & XINPUT_GAMEPAD_DPAD_UP ? SDL_PRESSED : SDL_RELEASED );
Expand Down

0 comments on commit 68ff282

Please sign in to comment.