Rebase against 8ddff3f51faca2c0824e204a69f69e241fb93d15.

This commit is contained in:
Alistair Leslie-Hughes
2021-05-26 10:10:15 +10:00
parent 69765f438b
commit 34afd80e2e
7 changed files with 49 additions and 60 deletions

View File

@@ -1,4 +1,4 @@
From bf98a453bb814564ccf848d76d06c4b544cfa998 Mon Sep 17 00:00:00 2001
From 2c404d618908f4655623611ce720b6b27d0c1de6 Mon Sep 17 00:00:00 2001
From: Andrew Church <achurch@achurch.org>
Date: Mon, 25 Feb 2019 11:21:03 +1100
Subject: [PATCH] dinput: Allow remapping of joystick buttons
@@ -18,10 +18,10 @@ Wine-bug: https://bugs.winehq.org/show_bug.cgi?id=35815
5 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/dlls/dinput/joystick.c b/dlls/dinput/joystick.c
index 0ec1ceb..b8b0027 100644
index 2354ff3b822..36086f0035f 100644
--- a/dlls/dinput/joystick.c
+++ b/dlls/dinput/joystick.c
@@ -950,6 +950,7 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_
@@ -1034,6 +1034,7 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_
int tokens = 0;
int axis = 0;
int pov = 0;
@@ -29,7 +29,7 @@ index 0ec1ceb..b8b0027 100644
get_app_key(&hkey, &appkey);
@@ -961,6 +962,34 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_
@@ -1045,6 +1046,34 @@ HRESULT setup_dinput_options(JoystickGenericImpl *This, const int *default_axis_
TRACE("setting default deadzone to: \"%s\" %d\n", buffer, This->deadzone);
}
@@ -65,10 +65,10 @@ index 0ec1ceb..b8b0027 100644
if (!This->axis_map) return DIERR_OUTOFMEMORY;
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index 963e62f..6286746 100644
index ec4cb94c034..7dc9deff8c4 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -807,10 +807,13 @@ static void joy_polldev(LPDIRECTINPUTDEVICE8A iface)
@@ -856,10 +856,13 @@ static void joy_polldev( IDirectInputDevice8W *iface )
jse.type,jse.number,jse.value);
if (jse.type & JS_EVENT_BUTTON)
{
@@ -85,10 +85,10 @@ index 963e62f..6286746 100644
else if (jse.type & JS_EVENT_AXIS)
{
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index 910e755..8ea268e 100644
index ef7b160ba58..7830cce3ced 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -836,6 +836,8 @@ static void joy_polldev(LPDIRECTINPUTDEVICE8A iface)
@@ -908,6 +908,8 @@ static void joy_polldev( IDirectInputDevice8W *iface )
if (btn & 0x80)
{
btn &= 0x7F;
@@ -98,10 +98,10 @@ index 910e755..8ea268e 100644
This->generic.js.rgbButtons[btn] = value = ie.value ? 0x80 : 0x00;
}
diff --git a/dlls/dinput/joystick_osx.c b/dlls/dinput/joystick_osx.c
index 0701b9f..224e203 100644
index 174a78b7fd4..60e3967d921 100644
--- a/dlls/dinput/joystick_osx.c
+++ b/dlls/dinput/joystick_osx.c
@@ -809,6 +809,8 @@ static void poll_osx_device_state(LPDIRECTINPUTDEVICE8A iface)
@@ -844,6 +844,8 @@ static void poll_osx_device_state( IDirectInputDevice8W *iface )
TRACE("valueRef %s val %d oldVal %d newVal %d\n", debugstr_cf(valueRef), val, oldVal, newVal);
if (oldVal != newVal)
{
@@ -111,7 +111,7 @@ index 0701b9f..224e203 100644
queue_event(iface,inst_id,newVal,GetCurrentTime(),device->generic.base.dinput->evsequence++);
}
diff --git a/dlls/dinput/joystick_private.h b/dlls/dinput/joystick_private.h
index e758cac..4a382c2 100644
index 0f191787158..606475759ef 100644
--- a/dlls/dinput/joystick_private.h
+++ b/dlls/dinput/joystick_private.h
@@ -33,6 +33,9 @@
@@ -121,7 +121,7 @@ index e758cac..4a382c2 100644
+/* Number of buttons for which to allow remapping */
+#define MAX_MAP_BUTTONS 128
+
typedef void joy_polldev_handler(LPDIRECTINPUTDEVICE8A iface);
typedef void joy_polldev_handler( IDirectInputDevice8W *iface );
typedef struct JoystickGenericImpl
@@ -47,6 +50,7 @@ typedef struct JoystickGenericImpl
@@ -133,5 +133,5 @@ index e758cac..4a382c2 100644
joy_polldev_handler *joy_polldev;
--
1.9.1
2.30.2