From 9e36848303016215f3e52dbb22c772765d8a15b1 Mon Sep 17 00:00:00 2001 From: Vitaliy Margolen Date: Sun, 5 Aug 2007 12:18:26 -0600 Subject: [PATCH] dinput: Fix mapping of axes ids to property ids. --- dlls/dinput/device.c | 2 +- dlls/dinput/device_private.h | 1 + dlls/dinput/joystick_linux.c | 2 +- dlls/dinput/joystick_linuxinput.c | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 1dc6e4ae78a..10e31cd412c 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -448,7 +448,7 @@ static int offset_to_object(const DataFormat *df, int offset) return -1; } -static int id_to_object(LPCDIDATAFORMAT df, int id) +int id_to_object(LPCDIDATAFORMAT df, int id) { int i; diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index 27bccc778bc..ade7f9e2235 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -78,6 +78,7 @@ extern HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *forma extern void release_DataFormat(DataFormat *df) ; extern void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, DWORD seq); /* Helper functions to work with data format */ +extern int id_to_object(LPCDIDATAFORMAT df, int id); extern int id_to_offset(const DataFormat *df, int id); extern int find_property(const DataFormat *df, LPCDIPROPHEADER ph); diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 67cc4935f6e..79c7bc16cf5 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -764,7 +764,7 @@ static void joy_polldev(JoystickImpl *This) { if (number < 12) { inst_id = DIDFT_MAKEINSTANCE(number) | (number < 8 ? DIDFT_ABSAXIS : DIDFT_POV); - value = map_axis(This, jse.value, number); + value = map_axis(This, jse.value, id_to_object(This->base.data_format.wine_df, inst_id)); /* FIXME do deadzone and saturation here */ TRACE("changing axis %d => %d\n", jse.number, number); diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 6a8dd447319..8e8dd4b492d 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -667,7 +667,7 @@ static void joy_polldev(JoystickImpl *This) break; } inst_id = DIDFT_MAKEINSTANCE(axis) | (ie.code < ABS_HAT0X ? DIDFT_ABSAXIS : DIDFT_POV); - value = map_axis(This, axis, ie.value); + value = map_axis(This, id_to_object(This->base.data_format.wine_df, inst_id), ie.value); switch (ie.code) { case ABS_X: This->js.lX = value; break;