From: Tyson Whitehead twhitehead@gmail.com
Testing with a MS Sidewinde 2 under Windows reveals that playing a codition effect on just one axis can only be done by explicitly setting the other axes to a zero strength as unspecified axes run at full strength and not no strength as might be expected.
The choosen axis must also be the Y axis in order for the result of the rotation to agree with what happens with non-condition effects. This is because the the -Y axis is the reference axis for the direction (i.e., no rotation plays back on the Y axis). --- dlls/joy.cpl/dinput.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-)
diff --git a/dlls/joy.cpl/dinput.c b/dlls/joy.cpl/dinput.c index 925c6d0038c..8838b0ffa1c 100644 --- a/dlls/joy.cpl/dinput.c +++ b/dlls/joy.cpl/dinput.c @@ -92,12 +92,15 @@ static BOOL CALLBACK enum_effects( const DIEFFECTINFOW *info, void *context ) .dwMagnitude = DI_FFNOMINALMAX, .dwPeriod = DI_SECONDS / 2, }; - DICONDITION condition = + DICONDITION condition[2] = { - .dwPositiveSaturation = 10000, - .dwNegativeSaturation = 10000, - .lPositiveCoefficient = 10000, - .lNegativeCoefficient = 10000, + {0}, + { + .dwPositiveSaturation = 10000, + .dwNegativeSaturation = 10000, + .lPositiveCoefficient = 10000, + .lNegativeCoefficient = 10000, + }, }; DIRAMPFORCE ramp = { @@ -130,8 +133,15 @@ static BOOL CALLBACK enum_effects( const DIEFFECTINFOW *info, void *context ) break; }
- do hr = IDirectInputDevice2_CreateEffect( device, &info->guid, ¶ms, &effect, NULL ); - while (FAILED(hr) && --params.cAxes); + do + { + hr = IDirectInputDevice2_CreateEffect( device, &info->guid, ¶ms, &effect, NULL ); + if (FAILED(hr) && DIEFT_GETTYPE(info->dwEffType) == DIEFT_CONDITION) + { + params.cbTypeSpecificParams = sizeof(condition[1]); + params.lpvTypeSpecificParams = &condition[1]; + } + } while (FAILED(hr) && --params.cAxes);
if (FAILED(hr)) {