diff options
author | Chris Robinson <[email protected]> | 2011-03-12 20:27:46 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-03-12 20:27:46 -0800 |
commit | 59fe4f8a367f9cc916201fbff48c4987e77436f0 (patch) | |
tree | 3f63e3055013b96dc70da38cab9e54935c59225a /OpenAL32 | |
parent | acb493665d22915983713579b6b780a6c4cb06d0 (diff) |
Don't return enums for disabled effects
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/alExtension.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/OpenAL32/alExtension.c b/OpenAL32/alExtension.c index 59ca48aa..3ed4395a 100644 --- a/OpenAL32/alExtension.c +++ b/OpenAL32/alExtension.c @@ -326,8 +326,28 @@ AL_API ALvoid* AL_APIENTRY alGetProcAddress(const ALchar *funcName) AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *enumName) { - ALsizei i = 0; + const struct { + const char *name; + int type; + } EffectList[] = { + { "AL_EFFECT_EAXREVERB", EAXREVERB }, + { "AL_EFFECT_REVERB", REVERB }, + { "AL_EFFECT_ECHO", ECHO }, + { "AL_EFFECT_RING_MODULATOR", MODULATOR }, + { "AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT", DEDICATED }, + { "AL_EFFECT_DEDICATED_DIALOGUE", DEDICATED }, + { NULL, 0 } + }; + ALsizei i; + + for(i = 0;EffectList[i].name;i++) + { + if(DisabledEffects[EffectList[i].type] && + strcmp(EffectList[i].name, enumName) == 0) + return (ALenum)0; + } + i = 0; while(enumeration[i].enumName && strcmp(enumeration[i].enumName, enumName) != 0) i++; |