dinput: Effect length can actually be 0.
This fixes force feedback devices slamming for 10ms at full strength, as attack is an absolute value, not a factor of effect level.
This commit is contained in:
parent
1f8f7cf7af
commit
f1beea4f86
|
@ -606,13 +606,12 @@ static HRESULT WINAPI LinuxInputEffectImpl_SetParameters(
|
||||||
else env = NULL;
|
else env = NULL;
|
||||||
|
|
||||||
if (peff->lpEnvelope == NULL) {
|
if (peff->lpEnvelope == NULL) {
|
||||||
/* if this type had an envelope, reset it
|
/* if this type had an envelope, reset it */
|
||||||
* note that length can never be zero, so we set it to something minuscule */
|
|
||||||
if (env) {
|
if (env) {
|
||||||
env->attack_length = 0x10;
|
env->attack_length = 0;
|
||||||
env->attack_level = 0x7FFF;
|
env->attack_level = 0;
|
||||||
env->fade_length = 0x10;
|
env->fade_length = 0;
|
||||||
env->fade_level = 0x7FFF;
|
env->fade_level = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* did we get passed an envelope for a type that doesn't even have one? */
|
/* did we get passed an envelope for a type that doesn't even have one? */
|
||||||
|
|
Loading…
Reference in New Issue