Brendan Shanks : dinput: Fix Xbox One controller D-pad on Mac.
Alexandre Julliard
julliard at winehq.org
Wed Feb 10 15:34:01 CST 2021
Module: wine
Branch: master
Commit: 46980e799b844c090efe865d74d43a68520a94f4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=46980e799b844c090efe865d74d43a68520a94f4
Author: Brendan Shanks <bshanks at codeweavers.com>
Date: Tue Feb 9 14:38:57 2021 -0800
dinput: Fix Xbox One controller D-pad on Mac.
Signed-off-by: Brendan Shanks <bshanks at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dinput/joystick_osx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
index 4ec72465500..b91b9d14b12 100644
--- a/dlls/dinput/joystick_osx.c
+++ b/dlls/dinput/joystick_osx.c
@@ -840,10 +840,10 @@ static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface)
return;
val = IOHIDValueGetIntegerValue(valueRef);
oldVal = device->generic.js.rgdwPOV[pov_idx];
- if (val >= 8)
+ if ((val > device->generic.props[idx].lDevMax) || (val < device->generic.props[idx].lDevMin))
newVal = -1;
else
- newVal = val * 4500;
+ newVal = (val - device->generic.props[idx].lDevMin) * 4500;
device->generic.js.rgdwPOV[pov_idx] = newVal;
TRACE("valueRef %s val %d oldVal %d newVal %d\n", debugstr_cf(valueRef), val, oldVal, newVal);
if (oldVal != newVal)
More information about the wine-cvs
mailing list