dinput: Fix mapping of axes ids to property ids.
This commit is contained in:
parent
d1bc63090e
commit
9e36848303
|
@ -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;
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue