dinput: Support both DIEFFECT_DX5 and DIEFFECT_DX6 parameters.

Star Wars Episode I Racer force-feedback doesn't work otherwise as it
passes a DIEFFECT_DX5 struct to SetParameters.

Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Rémi Bernon 2021-11-08 09:35:02 +01:00 committed by Alexandre Julliard
parent 869a0ddaca
commit 67d38c6991
1 changed files with 2 additions and 2 deletions

View File

@ -2043,7 +2043,7 @@ static HRESULT WINAPI hid_joystick_effect_GetParameters( IDirectInputEffect *ifa
TRACE( "iface %p, params %p, flags %#x.\n", iface, params, flags );
if (!params) return DI_OK;
if (params->dwSize != sizeof(DIEFFECT)) return DIERR_INVALIDPARAM;
if (params->dwSize != sizeof(DIEFFECT_DX6) && params->dwSize != sizeof(DIEFFECT_DX5)) return DIERR_INVALIDPARAM;
capacity = params->cAxes;
object_flags = params->dwFlags & (DIEFF_OBJECTIDS | DIEFF_OBJECTOFFSETS);
direction_flags = params->dwFlags & (DIEFF_CARTESIAN | DIEFF_POLAR | DIEFF_SPHERICAL);
@ -2199,7 +2199,7 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa
TRACE( "iface %p, params %p, flags %#x.\n", iface, params, flags );
if (!params) return E_POINTER;
if (params->dwSize != sizeof(DIEFFECT)) return DIERR_INVALIDPARAM;
if (params->dwSize != sizeof(DIEFFECT_DX6) && params->dwSize != sizeof(DIEFFECT_DX5)) return DIERR_INVALIDPARAM;
object_flags = params->dwFlags & (DIEFF_OBJECTIDS | DIEFF_OBJECTOFFSETS);
direction_flags = params->dwFlags & (DIEFF_CARTESIAN | DIEFF_POLAR | DIEFF_SPHERICAL);