aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-11-14 07:13:59 -0800
committerChris Robinson <[email protected]>2008-11-14 07:13:59 -0800
commitd72b132c57145bd6cd4c531fe0a8c65b348c2c29 (patch)
tree910ffeef08d6b278e12da0032867efed2bb58ee7 /OpenAL32
parent506912aed7a1ae84fbc0407741c85ac2d5e109d2 (diff)
Add an option to disable specific EFX effect types
Diffstat (limited to 'OpenAL32')
-rw-r--r--OpenAL32/Include/alEffect.h7
-rw-r--r--OpenAL32/alEffect.c10
2 files changed, 15 insertions, 2 deletions
diff --git a/OpenAL32/Include/alEffect.h b/OpenAL32/Include/alEffect.h
index 24f12c5e..5f6723bc 100644
--- a/OpenAL32/Include/alEffect.h
+++ b/OpenAL32/Include/alEffect.h
@@ -38,6 +38,13 @@ extern "C" {
#define AL_REVERB_DECAY_HFLIMIT 0x000D
+enum {
+ REVERB = 0,
+ MAX_EFFECTS
+};
+extern ALboolean DisabledEffects[MAX_EFFECTS];
+
+
typedef struct ALeffect_struct
{
// Effect type (AL_EFFECT_NULL, ...)
diff --git a/OpenAL32/alEffect.c b/OpenAL32/alEffect.c
index 8f52bcaf..939b663f 100644
--- a/OpenAL32/alEffect.c
+++ b/OpenAL32/alEffect.c
@@ -29,6 +29,10 @@
#include "alThunk.h"
#include "alError.h"
+
+ALboolean DisabledEffects[MAX_EFFECTS];
+
+
static ALeffect *g_EffectList;
static ALuint g_EffectCount;
@@ -165,8 +169,10 @@ ALvoid AL_APIENTRY alEffecti(ALuint effect, ALenum param, ALint iValue)
if(param == AL_EFFECT_TYPE)
{
- if(iValue == AL_EFFECT_NULL ||
- iValue == AL_EFFECT_REVERB)
+ ALboolean isOk = (iValue == AL_EFFECT_NULL ||
+ (iValue == AL_EFFECT_REVERB && !DisabledEffects[REVERB]));
+
+ if(isOk)
InitEffectParams(ALEffect, iValue);
else
alSetError(AL_INVALID_VALUE);