mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-23 17:35:34 +00:00
Added explicit case from Uint8 to int before subtracting offset
This commit is contained in:
parent
bec9d740ec
commit
d81eaf8da5
|
@ -222,7 +222,7 @@ HIDAPI_DriverStadia_HandleStatePacket(SDL_Joystick *joystick, SDL_DriverStadia_C
|
||||||
|
|
||||||
#define READ_STICK_AXIS(offset) \
|
#define READ_STICK_AXIS(offset) \
|
||||||
(data[offset] == 0x80 ? 0 : \
|
(data[offset] == 0x80 ? 0 : \
|
||||||
(Sint16)HIDAPI_RemapVal((float)(data[offset] - 0x80), 0x01 - 0x80, 0xff - 0x80, SDL_MIN_SINT16, SDL_MAX_SINT16))
|
(Sint16)HIDAPI_RemapVal((float)((int)data[offset] - 0x80), 0x01 - 0x80, 0xff - 0x80, SDL_MIN_SINT16, SDL_MAX_SINT16))
|
||||||
{
|
{
|
||||||
axis = READ_STICK_AXIS(4);
|
axis = READ_STICK_AXIS(4);
|
||||||
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis);
|
SDL_PrivateJoystickAxis(joystick, SDL_CONTROLLER_AXIS_LEFTX, axis);
|
||||||
|
|
Loading…
Reference in a new issue