diff options
author | Chris Robinson <[email protected]> | 2009-10-20 08:31:44 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-10-20 08:31:44 -0700 |
commit | f14cf8289eae832b090c4067ae66a19be08b7029 (patch) | |
tree | 72429089a328f49f494f9234bad41cf23d99a534 /OpenAL32 | |
parent | 790aa686214559377c4ec398762c1e7cd655f8a5 (diff) |
Add a method to update device-dependant effect parameters.
The effect state's update method will be called afterwards
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alAuxEffectSlot.h | 2 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 7 |
2 files changed, 8 insertions, 1 deletions
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); |