dinput: Assign button GUID to joystick buttons.
This commit is contained in:
parent
2e80f11c5e
commit
b9801bba31
|
@ -471,6 +471,7 @@ static HRESULT alloc_device(REFGUID rguid, const void *jvt, IDirectInputImpl *di
|
||||||
for (i = 0; i < newDevice->buttons; i++)
|
for (i = 0; i < newDevice->buttons; i++)
|
||||||
{
|
{
|
||||||
memcpy(&df->rgodf[idx], &c_dfDIJoystick2.rgodf[i + 12], df->dwObjSize);
|
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;
|
df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_PSHBUTTON;
|
||||||
}
|
}
|
||||||
newDevice->base.data_format.wine_df = df;
|
newDevice->base.data_format.wine_df = df;
|
||||||
|
|
|
@ -373,7 +373,7 @@ static BOOL joydev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTAN
|
||||||
if (id >= have_joydevs) {
|
if (id >= have_joydevs) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!((dwDevType == 0) ||
|
if (!((dwDevType == 0) ||
|
||||||
((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 0x0800)) ||
|
((dwDevType == DIDEVTYPE_JOYSTICK) && (version < 0x0800)) ||
|
||||||
(((dwDevType == DI8DEVCLASS_GAMECTRL) || (dwDevType == DI8DEVTYPE_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);
|
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;
|
newDevice->buttons[i] = 0x80 | newDevice->numButtons;
|
||||||
|
df->rgodf[idx ].pguid = &GUID_Button;
|
||||||
df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(newDevice->numButtons++) | DIDFT_PSHBUTTON;
|
df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(newDevice->numButtons++) | DIDFT_PSHBUTTON;
|
||||||
}
|
}
|
||||||
df->dwNumObjs = idx;
|
df->dwNumObjs = idx;
|
||||||
|
|
Loading…
Reference in New Issue