Module: wine Branch: master Commit: 2665272d6cd4bdd4c8c5ef2c6171c4ae6cdbfdf7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=2665272d6cd4bdd4c8c5ef2c61...
Author: Vitaliy Margolen wine-patches@kievinfo.com Date: Sun Nov 29 21:07:25 2009 -0700
dinput: Pass event instance ID to queue_event instead of offset.
---
dlls/dinput/device.c | 4 ++-- dlls/dinput/device_private.h | 2 +- dlls/dinput/joystick_linux.c | 3 +-- dlls/dinput/joystick_linuxinput.c | 3 +-- dlls/dinput/keyboard.c | 4 ++-- dlls/dinput/mouse.c | 4 ++-- 6 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/dlls/dinput/device.c b/dlls/dinput/device.c index 941206c..cf91153 100644 --- a/dlls/dinput/device.c +++ b/dlls/dinput/device.c @@ -533,10 +533,10 @@ int find_property(const DataFormat *df, LPCDIPROPHEADER ph) * queue_event - add new event to the ring queue */
-void queue_event(LPDIRECTINPUTDEVICE8A iface, int ofs, DWORD data, DWORD time, DWORD seq) +void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD time, DWORD seq) { IDirectInputDevice2AImpl *This = (IDirectInputDevice2AImpl *)iface; - int next_pos; + int next_pos, ofs = id_to_offset(&This->data_format, inst_id);
/* Event is being set regardless of the queue state */ if (This->hEvent) SetEvent(This->hEvent); diff --git a/dlls/dinput/device_private.h b/dlls/dinput/device_private.h index 3463382..d62e32e 100644 --- a/dlls/dinput/device_private.h +++ b/dlls/dinput/device_private.h @@ -78,7 +78,7 @@ extern DWORD get_config_key(HKEY, HKEY, const char*, char*, DWORD); /* Routines to do DataFormat / WineFormat conversions */ extern void fill_DataFormat(void *out, DWORD size, const void *in, const 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 inst_id, 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); diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c index 2203a20..1396ea5 100644 --- a/dlls/dinput/joystick_linux.c +++ b/dlls/dinput/joystick_linux.c @@ -614,8 +614,7 @@ static void joy_polldev(JoystickGenericImpl *This_in) { } } if (inst_id >= 0) - queue_event((LPDIRECTINPUTDEVICE8A)This, - id_to_offset(&This->generic.base.data_format, inst_id), + queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, value, jse.time, This->generic.base.dinput->evsequence++); } } diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c index 67a1ee3..6c3c8cc 100644 --- a/dlls/dinput/joystick_linuxinput.c +++ b/dlls/dinput/joystick_linuxinput.c @@ -824,8 +824,7 @@ static void joy_polldev(JoystickGenericImpl *iface) break; } if (inst_id >= 0) - queue_event((LPDIRECTINPUTDEVICE8A)This, - id_to_offset(&This->generic.base.data_format, inst_id), + queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, value, ie.time.tv_usec, This->generic.base.dinput->evsequence++); } } diff --git a/dlls/dinput/keyboard.c b/dlls/dinput/keyboard.c index de8c63c..3692878 100644 --- a/dlls/dinput/keyboard.c +++ b/dlls/dinput/keyboard.c @@ -107,9 +107,9 @@ static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM This->DInputKeyState[dik_code] = new_diks; TRACE(" setting %02X to %02X\n", dik_code, This->DInputKeyState[dik_code]);
- dik_code = id_to_offset(&This->base.data_format, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON); EnterCriticalSection(&This->base.crit); - queue_event((LPDIRECTINPUTDEVICE8A)This, dik_code, new_diks, hook->time, This->base.dinput->evsequence++); + queue_event((LPDIRECTINPUTDEVICE8A)This, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON, + new_diks, hook->time, This->base.dinput->evsequence++); LeaveCriticalSection(&This->base.crit);
return ret; diff --git a/dlls/dinput/mouse.c b/dlls/dinput/mouse.c index 7b95be3..4809c56 100644 --- a/dlls/dinput/mouse.c +++ b/dlls/dinput/mouse.c @@ -324,7 +324,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM { /* Already have X, need to queue it */ if (inst_id != -1) - queue_event((LPDIRECTINPUTDEVICE8A)This, id_to_offset(&This->base.data_format, inst_id), + queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, wdata, GetCurrentTime(), This->base.dinput->evsequence); inst_id = DIDFT_MAKEINSTANCE(WINE_MOUSE_Y_AXIS_INSTANCE) | DIDFT_RELAXIS; wdata = pt1.y; @@ -379,7 +379,7 @@ static int dinput_mouse_hook( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM if (inst_id != -1) { _dump_mouse_state(&This->m_state); - queue_event((LPDIRECTINPUTDEVICE8A)This, id_to_offset(&This->base.data_format, inst_id), + queue_event((LPDIRECTINPUTDEVICE8A)This, inst_id, wdata, GetCurrentTime(), This->base.dinput->evsequence++); }