From 1c540181116a875f708890bc9c380b71cd1fd6ba Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 11 Apr 2009 17:04:55 -0700 Subject: Move the WetBuffer into the effect slot object This should make it easier to support multiple slots --- OpenAL32/Include/alAuxEffectSlot.h | 2 ++ OpenAL32/Include/alu.h | 2 ++ OpenAL32/alAuxEffectSlot.c | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alAuxEffectSlot.h b/OpenAL32/Include/alAuxEffectSlot.h index cc5b9d34..a818bb47 100644 --- a/OpenAL32/Include/alAuxEffectSlot.h +++ b/OpenAL32/Include/alAuxEffectSlot.h @@ -25,6 +25,8 @@ typedef struct ALeffectslot ALverbState *ReverbState; + ALfloat WetBuffer[BUFFERSIZE]; + ALuint refcount; // Index to itself diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index 913b0a51..7c6e95b7 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -22,6 +22,8 @@ enum { OUTPUTCHANNELS }; +#define BUFFERSIZE 24000 + extern ALboolean DuplicateStereo; __inline ALuint aluBytesFromFormat(ALenum format); diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index dd524f02..65db34b3 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -38,7 +38,7 @@ static ALvoid InitializeEffect(ALCcontext *Context, ALeffectslot *ALEffectSlot, ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) { ALCcontext *Context; - ALsizei i; + ALsizei i, j; Context = alcGetCurrentContext(); if(!Context) @@ -74,6 +74,8 @@ ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslots) (*list)->Gain = 1.0; (*list)->AuxSendAuto = AL_TRUE; + for(j = 0;j < BUFFERSIZE;j++) + (*list)->WetBuffer[j] = 0.0f; (*list)->refcount = 0; effectslots[i] = (ALuint)ALTHUNK_ADDENTRY(*list); -- cgit v1.2.3