From f14cf8289eae832b090c4067ae66a19be08b7029 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 20 Oct 2009 08:31:44 -0700 Subject: Add a method to update device-dependant effect parameters. The effect state's update method will be called afterwards --- OpenAL32/Include/alAuxEffectSlot.h | 2 ++ OpenAL32/alAuxEffectSlot.c | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index 667d74dd..14e3b2f9 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -55,6 +55,7 @@ ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context); struct ALeffectState { ALvoid (*Destroy)(ALeffectState *State); + ALboolean (*DeviceUpdate)(ALeffectState *State, ALCdevice *Device); ALvoid (*Update)(ALeffectState *State, ALCcontext *Context, const ALeffect *Effect); ALvoid (*Process)(ALeffectState *State, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS]); }; @@ -64,6 +65,7 @@ ALeffectState *VerbCreate(void); ALeffectState *EchoCreate(void); #define ALEffect_Destroy(a) ((a)->Destroy((a))) +#define ALEffect_DeviceUpdate(a,b) ((a)->DeviceUpdate((a),(b))) #define ALEffect_Update(a,b,c) ((a)->Update((a),(b),(c))) #define ALEffect_Process(a,b,c,d,e) ((a)->Process((a),(b),(c),(d),(e))) diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 1fd2f707..7a9c6326 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -428,8 +428,13 @@ static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *ALEffectSlot, else if(effect->type == AL_EFFECT_ECHO) NewState = EchoCreate(); /* No new state? An error occured.. */ - if(!NewState) + if(NewState == NULL || + ALEffect_DeviceUpdate(NewState, Context->Device) == AL_FALSE) + { + if(NewState) + ALEffect_Destroy(NewState); return; + } } if(ALEffectSlot->EffectState) ALEffect_Destroy(ALEffectSlot->EffectState); -- cgit v1.2.3