Module: wine Branch: master Commit: ec7bdf6154aa79670667b9153b2f8b09ea0691b3 URL: https://source.winehq.org/git/wine.git/?a=commit;h=ec7bdf6154aa79670667b9153...
Author: Andrew Eikum aeikum@codeweavers.com Date: Mon May 6 08:46:12 2019 -0500
winebus.sys: Fix ball value reporting.
Signed-off-by: Andrew Eikum aeikum@codeweavers.com Signed-off-by: Aric Stewart aric@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/winebus.sys/bus_sdl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c index 4cbf561..49ec699 100644 --- a/dlls/winebus.sys/bus_sdl.c +++ b/dlls/winebus.sys/bus_sdl.c @@ -275,8 +275,8 @@ static void set_ball_value(struct platform_private *ext, int index, int value1, if (value1 < -127) value1 = -127; if (value2 > 127) value2 = 127; if (value2 < -127) value2 = -127; - ext->report_buffer[offset] = value1; - ext->report_buffer[offset + 1] = value2; + *((WORD*)&ext->report_buffer[offset]) = LE_WORD(value1); + *((WORD*)&ext->report_buffer[offset + sizeof(WORD)]) = LE_WORD(value2); }
static void set_hat_value(struct platform_private *ext, int index, int value) @@ -400,7 +400,7 @@ static BOOL build_report_descriptor(struct platform_private *ext) descript_size += sizeof(REPORT_AXIS_HEADER); descript_size += (sizeof(REPORT_AXIS_USAGE) * ball_count * 2); descript_size += sizeof(REPORT_REL_AXIS_TAIL); - report_size += (sizeof(WORD) * ball_count); + report_size += (sizeof(WORD) * 2 * ball_count); }
hat_count = pSDL_JoystickNumHats(ext->sdl_joystick);