Commit 67d38c69 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

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: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 869a0dda
...@@ -2043,7 +2043,7 @@ static HRESULT WINAPI hid_joystick_effect_GetParameters( IDirectInputEffect *ifa ...@@ -2043,7 +2043,7 @@ static HRESULT WINAPI hid_joystick_effect_GetParameters( IDirectInputEffect *ifa
TRACE( "iface %p, params %p, flags %#x.\n", iface, params, flags ); TRACE( "iface %p, params %p, flags %#x.\n", iface, params, flags );
if (!params) return DI_OK; 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; capacity = params->cAxes;
object_flags = params->dwFlags & (DIEFF_OBJECTIDS | DIEFF_OBJECTOFFSETS); object_flags = params->dwFlags & (DIEFF_OBJECTIDS | DIEFF_OBJECTOFFSETS);
direction_flags = params->dwFlags & (DIEFF_CARTESIAN | DIEFF_POLAR | DIEFF_SPHERICAL); direction_flags = params->dwFlags & (DIEFF_CARTESIAN | DIEFF_POLAR | DIEFF_SPHERICAL);
...@@ -2199,7 +2199,7 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa ...@@ -2199,7 +2199,7 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa
TRACE( "iface %p, params %p, flags %#x.\n", iface, params, flags ); TRACE( "iface %p, params %p, flags %#x.\n", iface, params, flags );
if (!params) return E_POINTER; 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); object_flags = params->dwFlags & (DIEFF_OBJECTIDS | DIEFF_OBJECTOFFSETS);
direction_flags = params->dwFlags & (DIEFF_CARTESIAN | DIEFF_POLAR | DIEFF_SPHERICAL); direction_flags = params->dwFlags & (DIEFF_CARTESIAN | DIEFF_POLAR | DIEFF_SPHERICAL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment