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

dinput: Allow DIEFF_CARTESIAN directions when cAxes matches.

parent 20476319
......@@ -2224,7 +2224,7 @@ static HRESULT WINAPI hid_joystick_effect_SetParameters( IDirectInputEffect *ifa
count = impl->params.cAxes;
if (params->cAxes < count) return DIERR_INVALIDPARAM;
if ((direction_flags & DIEFF_POLAR) && count != 2) return DIERR_INVALIDPARAM;
if ((direction_flags & DIEFF_CARTESIAN) && count < 2) return DIERR_INVALIDPARAM;
if ((direction_flags & DIEFF_CARTESIAN) && params->cAxes != count) return DIERR_INVALIDPARAM;
if (!count) memset( directions, 0, sizeof(directions) );
else if (direction_flags & DIEFF_POLAR)
......
......@@ -6061,11 +6061,9 @@ static void test_periodic_effect( IDirectInputDevice8W *device, HANDLE file, DWO
desc.rglDirection[1] = 2000;
desc.rglDirection[2] = 3000;
hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_DIRECTION | DIEP_NODOWNLOAD );
todo_wine_if( i == 2 )
ok( hr == DIERR_INVALIDPARAM, "SetParameters returned %#x\n", hr );
desc.cAxes = i;
hr = IDirectInputEffect_SetParameters( effect, &desc, DIEP_DIRECTION | DIEP_NODOWNLOAD );
todo_wine_if( i == 1 )
ok( hr == DI_DOWNLOADSKIPPED, "SetParameters returned %#x\n", hr );
desc.dwFlags = 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