From 6d1d61026d5c5ba75986c2cd8c499bcf72549197 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 19 Oct 2009 07:46:53 -0700 Subject: Be context-agnostic in the effect Create functions This allows the effect Update functions to handle the playback frequency being changed. By default the effects assume a maximum frequency of 192khz, however, it can go higher at the cost of the sample buffers being cleared and the risk of an abort() if reallocation fails --- OpenAL32/Include/alAuxEffectSlot.h | 8 ++++---- OpenAL32/alAuxEffectSlot.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index eb41132b..667d74dd 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -55,13 +55,13 @@ ALvoid ReleaseALAuxiliaryEffectSlots(ALCcontext *Context); struct ALeffectState { ALvoid (*Destroy)(ALeffectState *State); - ALvoid (*Update)(ALeffectState *State, ALCcontext *Context, ALeffect *Effect); + ALvoid (*Update)(ALeffectState *State, ALCcontext *Context, const ALeffect *Effect); ALvoid (*Process)(ALeffectState *State, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS]); }; -ALeffectState *EAXVerbCreate(ALCcontext *Context); -ALeffectState *VerbCreate(ALCcontext *Context); -ALeffectState *EchoCreate(ALCcontext *Context); +ALeffectState *EAXVerbCreate(void); +ALeffectState *VerbCreate(void); +ALeffectState *EchoCreate(void); #define ALEffect_Destroy(a) ((a)->Destroy((a))) #define ALEffect_Update(a,b,c) ((a)->Update((a),(b),(c))) diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index acefb624..1fd2f707 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -422,11 +422,11 @@ static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *ALEffectSlot, if(effect) { if(effect->type == AL_EFFECT_EAXREVERB) - NewState = EAXVerbCreate(Context); + NewState = EAXVerbCreate(); else if(effect->type == AL_EFFECT_REVERB) - NewState = VerbCreate(Context); + NewState = VerbCreate(); else if(effect->type == AL_EFFECT_ECHO) - NewState = EchoCreate(Context); + NewState = EchoCreate(); /* No new state? An error occured.. */ if(!NewState) return; -- cgit v1.2.3