Vitaliy Margolen : dinput: Assign button GUID to joystick buttons.
Alexandre Julliard
julliard at winehq.org
Mon Apr 14 07:14:09 CDT 2008
Module: wine
Branch: master
Commit: b9801bba314561d76f0db171d8fa30522ec17219
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b9801bba314561d76f0db171d8fa30522ec17219
Author: Vitaliy Margolen <wine-patches at kievinfo.com>
Date: Sat Apr 12 11:33:04 2008 -0600
dinput: Assign button GUID to joystick buttons.
---
dlls/dinput/joystick_linux.c | 1 +
dlls/dinput/joystick_linuxinput.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/dinput/joystick_linux.c b/dlls/dinput/joystick_linux.c
index a43f842..e9b8790 100644
--- a/dlls/dinput/joystick_linux.c
+++ b/dlls/dinput/joystick_linux.c
@@ -471,6 +471,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
for (i = 0; i < newDevice->buttons; i++)
{
memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[i + 12], df->dwObjSize);
+ df->rgodf[idx ].pguid = &GUID_Button;
df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_PSHBUTTON;
}
newDevice->base.data_format.wine_df = df;
diff --git a/dlls/dinput/joystick_linuxinput.c b/dlls/dinput/joystick_linuxinput.c
index c31fc28..76456b0 100644
--- a/dlls/dinput/joystick_linuxinput.c
+++ b/dlls/dinput/joystick_linuxinput.c
@@ -373,7 +373,7 @@ static BOOL joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
if (id >= have_joydevs) {
return FALSE;
}
-
+
if (!((dwDevType == 0) ||
((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 0x0800)) ||
(((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_JOYSTICK)) && (version >= 0x0800))))
@@ -498,6 +498,7 @@ static JoystickImpl *alloc_device(REFGUID rguid, const void *jvt, IDirectInputIm
memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[newDevice->numButtons + WINE_JOYSTICK_MAX_AXES + WINE_JOYSTICK_MAX_POVS], df->dwObjSize);
newDevice->buttons[i] = 0x80 | newDevice->numButtons;
+ df->rgodf[idx ].pguid = &GUID_Button;
df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(newDevice->numButtons++) | DIDFT_PSHBUTTON;
}
df->dwNumObjs = idx;
More information about the wine-cvs
mailing list