Rémi Bernon : winebus.sys: Fix inverted SDL joystick hat switch y axis.

Alexandre Julliard julliard at winehq.org
Fri Oct 15 15:40:04 CDT 2021


Module: wine
Branch: master
Commit: 38059e7ecf3100d7904192ec72733687463b75b4
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=38059e7ecf3100d7904192ec72733687463b75b4

Author: Rémi Bernon <rbernon at codeweavers.com>
Date:   Fri Oct 15 13:17:40 2021 +0200

winebus.sys: Fix inverted SDL joystick hat switch y axis.

SDL_HAT_UP should work as SDL_CONTROLLER_BUTTON_DPAD_UP.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=40658
Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winebus.sys/bus_sdl.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index 4fb91e4dc6d..16e7a2f6f30 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -161,14 +161,14 @@ static void set_hat_value(struct unix_device *iface, int index, int value)
     switch (value)
     {
     case SDL_HAT_CENTERED: break;
-    case SDL_HAT_UP: y = 1; break;
-    case SDL_HAT_RIGHTUP: y = x = 1; break;
+    case SDL_HAT_DOWN: y = 1; break;
+    case SDL_HAT_RIGHTDOWN: y = x = 1; break;
     case SDL_HAT_RIGHT: x = 1; break;
-    case SDL_HAT_RIGHTDOWN: x = 1; y = -1; break;
-    case SDL_HAT_DOWN: y = -1; break;
-    case SDL_HAT_LEFTDOWN: x = y = -1; break;
+    case SDL_HAT_RIGHTUP: x = 1; y = -1; break;
+    case SDL_HAT_UP: y = -1; break;
+    case SDL_HAT_LEFTUP: x = y = -1; break;
     case SDL_HAT_LEFT: x = -1; break;
-    case SDL_HAT_LEFTUP: x = -1; y = 1; break;
+    case SDL_HAT_LEFTDOWN: x = -1; y = 1; break;
     }
     hid_device_set_hatswitch_x(iface, index, x);
     hid_device_set_hatswitch_y(iface, index, y);




More information about the wine-cvs mailing list