diff options
author | Chris Robinson <[email protected]> | 2011-03-12 20:54:49 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-03-12 20:54:49 -0800 |
commit | b1d4508d90eeb245bfc0f720fa9c0da7df8444fa (patch) | |
tree | 12e9d11a4fb137465db191073f71044925eacdda /OpenAL32/alEffect.c | |
parent | 8249dc8559aae9762fd3047120abeef0ae0303b6 (diff) |
Use a loop to make sure the requested effect is not disabled
Diffstat (limited to 'OpenAL32/alEffect.c')
-rw-r--r-- | OpenAL32/alEffect.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c index 69a5b32d..b5f7a8b0 100644 --- a/OpenAL32/alEffect.c +++ b/OpenAL32/alEffect.c @@ -167,13 +167,14 @@ AL_API ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue) { if(param == AL_EFFECT_TYPE) { - ALboolean isOk = (iValue == AL_EFFECT_NULL || - (iValue == AL_EFFECT_EAXREVERB && !DisabledEffects[EAXREVERB]) || - (iValue == AL_EFFECT_REVERB && !DisabledEffects[REVERB]) || - (iValue == AL_EFFECT_ECHO && !DisabledEffects[ECHO]) || - (iValue == AL_EFFECT_RING_MODULATOR && !DisabledEffects[MODULATOR]) || - ((iValue == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT || - iValue == AL_EFFECT_DEDICATED_DIALOGUE) && !DisabledEffects[DEDICATED])); + ALboolean isOk = (iValue == AL_EFFECT_NULL); + ALint i; + for(i = 0;!isOk && EffectList[i].val;i++) + { + if(iValue == EffectList[i].val && + !DisabledEffects[EffectList[i].type]) + isOk = AL_TRUE; + } if(isOk) InitEffectParams(ALEffect, iValue); |