diff options
author | Chris Robinson <[email protected]> | 2011-03-12 20:37:22 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-03-12 20:37:22 -0800 |
commit | 8249dc8559aae9762fd3047120abeef0ae0303b6 (patch) | |
tree | 21f46ccc4b7ac85db6bb09203a7722f58954d99b | |
parent | 59fe4f8a367f9cc916201fbff48c4987e77436f0 (diff) |
Combine multiple lists into one
-rw-r--r-- | Alc/ALc.c | 11 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 7 | ||||
-rw-r--r-- | OpenAL32/alExtension.c | 26 |
3 files changed, 19 insertions, 25 deletions
@@ -507,17 +507,6 @@ static void alc_init(void) str = GetConfigValue(NULL, "excludefx", ""); if(str[0]) { - const struct { - const char *name; - int type; - } EffectList[] = { - { "eaxreverb", EAXREVERB }, - { "reverb", REVERB }, - { "echo", ECHO }, - { "modulator", MODULATOR }, - { "dedicated", DEDICATED }, - { NULL, 0 } - }; int n; size_t len; const char *next = str; diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 68e3e372..43f36b04 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -371,6 +371,13 @@ static __inline ALuint FrameSizeFromDevFmt(enum DevFmtChannels chans, } +extern const struct EffectList { + const char *name; + int type; + const char *ename; +} EffectList[]; + + struct ALCdevice_struct { ALCboolean Connected; diff --git a/OpenAL32/alExtension.c b/OpenAL32/alExtension.c index 3ed4395a..9f5cad65 100644 --- a/OpenAL32/alExtension.c +++ b/OpenAL32/alExtension.c @@ -275,6 +275,16 @@ static const ALenums enumeration[] = { }; +const struct EffectList EffectList[] = { + { "eaxreverb", EAXREVERB, "AL_EFFECT_EAXREVERB" }, + { "reverb", REVERB, "AL_EFFECT_REVERB" }, + { "echo", ECHO, "AL_EFFECT_ECHO" }, + { "modulator", MODULATOR, "AL_EFFECT_RING_MODULATOR" }, + { "dedicated", DEDICATED, "AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT" }, + { "dedicated", DEDICATED, "AL_EFFECT_DEDICATED_DIALOGUE" }, + { NULL, 0, NULL } +}; + AL_API ALboolean AL_APIENTRY alIsExtensionPresent(const ALchar *extName) { @@ -326,24 +336,12 @@ AL_API ALvoid* AL_APIENTRY alGetProcAddress(const ALchar *funcName) AL_API ALenum AL_APIENTRY alGetEnumValue(const ALchar *enumName) { - 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++) + for(i = 0;EffectList[i].ename;i++) { if(DisabledEffects[EffectList[i].type] && - strcmp(EffectList[i].name, enumName) == 0) + strcmp(EffectList[i].ename, enumName) == 0) return (ALenum)0; } |