Commit 9e368483 authored by Vitaliy Margolen's avatar Vitaliy Margolen Committed by Alexandre Julliard

dinput: Fix mapping of axes ids to property ids.

parent d1bc6309
...@@ -448,7 +448,7 @@ static int offset_to_object(const DataFormat *df, int offset) ...@@ -448,7 +448,7 @@ static int offset_to_object(const DataFormat *df, int offset)
return -1; return -1;
} }
static int id_to_object(LPCDIDATAFORMAT df, int id) int id_to_object(LPCDIDATAFORMAT df, int id)
{ {
int i; int i;
......
...@@ -78,6 +78,7 @@ extern HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *forma ...@@ -78,6 +78,7 @@ extern HRESULT create_DataFormat(LPCDIDATAFORMAT asked_format, DataFormat *forma
extern void release_DataFormat(DataFormat *df) ; extern void release_DataFormat(DataFormat *df) ;
extern void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, DWORD seq); extern void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, DWORD seq);
/* Helper functions to work with data format */ /* 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 id_to_offset(const DataFormat *df, int id);
extern int find_property(const DataFormat *df, LPCDIPROPHEADER ph); extern int find_property(const DataFormat *df, LPCDIPROPHEADER ph);
......
...@@ -764,7 +764,7 @@ static void joy_polldev(JoystickImpl *This) { ...@@ -764,7 +764,7 @@ static void joy_polldev(JoystickImpl *This) {
if (number < 12) if (number < 12)
{ {
inst_id = DIDFT_MAKEINSTANCE(number) | (number < 8 ? DIDFT_ABSAXIS : DIDFT_POV); 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 */ /* FIXME do deadzone and saturation here */
TRACE("changing axis %d => %d\n", jse.number, number); TRACE("changing axis %d => %d\n", jse.number, number);
......
...@@ -667,7 +667,7 @@ static void joy_polldev(JoystickImpl *This) ...@@ -667,7 +667,7 @@ static void joy_polldev(JoystickImpl *This)
break; break;
} }
inst_id = DIDFT_MAKEINSTANCE(axis) | (ie.code < ABS_HAT0X ? DIDFT_ABSAXIS : DIDFT_POV); 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) { switch (ie.code) {
case ABS_X: This->js.lX = value; break; case ABS_X: This->js.lX = value; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment