dinput: Fix mapping of axes ids to property ids.

This commit is contained in:
Vitaliy Margolen 2007-08-05 12:18:26 -06:00 committed by Alexandre Julliard
parent d1bc63090e
commit 9e36848303
4 changed files with 4 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);

View File

@ -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;