aboutsummaryrefslogtreecommitdiffstats
path: root/OpenAL32/alAuxEffectSlot.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-05-29 01:32:54 -0700
committerChris Robinson <[email protected]>2009-05-29 01:32:54 -0700
commit34ea7eba9e5f750aaa18713c51da852555064d39 (patch)
treefbb4a356a02fbe508fc241ac3b31a62d5dd841d4 /OpenAL32/alAuxEffectSlot.c
parent6d3ba44f55772cc6a545ca2c9407833ed85233f6 (diff)
Add preliminary support for the EAX Reverb effect
Not all parameters are supported yet, though it is a little more fuctional than standard reverb
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r--OpenAL32/alAuxEffectSlot.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c
index 810b380e..c9b8ac62 100644
--- a/OpenAL32/alAuxEffectSlot.c
+++ b/OpenAL32/alAuxEffectSlot.c
@@ -470,38 +470,37 @@ ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotfv(ALuint effectslot, ALenum param, A
static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *ALEffectSlot, ALeffect *effect)
{
- if(!effect)
+ if((!effect) || (effect->type != ALEffectSlot->effect.type))
{
- memset(&ALEffectSlot->effect, 0, sizeof(ALEffectSlot->effect));
VerbDestroy(ALEffectSlot->ReverbState);
ALEffectSlot->ReverbState = NULL;
EchoDestroy(ALEffectSlot->EchoState);
ALEffectSlot->EchoState = NULL;
+ }
+ if(!effect)
+ {
+ memset(&ALEffectSlot->effect, 0, sizeof(ALEffectSlot->effect));
return;
}
- if(effect->type == AL_EFFECT_REVERB)
+ memcpy(&ALEffectSlot->effect, effect, sizeof(*effect));
+ if(effect->type == AL_EFFECT_EAXREVERB)
+ {
+ if(!ALEffectSlot->ReverbState)
+ ALEffectSlot->ReverbState = EAXVerbCreate(Context);
+ VerbUpdate(Context, ALEffectSlot, effect);
+ }
+ else if(effect->type == AL_EFFECT_REVERB)
{
- if(ALEffectSlot->EchoState)
- {
- EchoDestroy(ALEffectSlot->EchoState);
- ALEffectSlot->EchoState = NULL;
- }
if(!ALEffectSlot->ReverbState)
ALEffectSlot->ReverbState = VerbCreate(Context);
VerbUpdate(Context, ALEffectSlot, effect);
}
else if(effect->type == AL_EFFECT_ECHO)
{
- if(ALEffectSlot->ReverbState)
- {
- VerbDestroy(ALEffectSlot->ReverbState);
- ALEffectSlot->ReverbState = NULL;
- }
if(!ALEffectSlot->EchoState)
ALEffectSlot->EchoState = EchoCreate(Context);
EchoUpdate(Context, ALEffectSlot, effect);
}
- memcpy(&ALEffectSlot->effect, effect, sizeof(*effect));
}