From 34ea7eba9e5f750aaa18713c51da852555064d39 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 29 May 2009 01:32:54 -0700 Subject: Add preliminary support for the EAX Reverb effect Not all parameters are supported yet, though it is a little more fuctional than standard reverb --- Alc/ALu.c | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'Alc/ALu.c') diff --git a/Alc/ALu.c b/Alc/ALu.c index f00fdafa..b36e7018 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -743,11 +743,6 @@ static ALvoid CalcSourceParams(const ALCcontext *ALContext, wetgainhf[i] = DryGainHF; } - // Note that this is really applied by the effect slot. However, - // it's easier (more optimal) to handle it here. - if(ALSource->Send[i].Slot->effect.type == AL_EFFECT_REVERB) - wetgainhf[i] *= ALSource->Send[0].Slot->effect.Reverb.GainHF; - switch(ALSource->Send[i].WetFilter.type) { case AL_FILTER_LOWPASS: @@ -1025,9 +1020,9 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma if(ALSource->FirstStart && DataPosInt == 0 && DataPosFrac == 0) { for(i = 0;i < OUTPUTCHANNELS;i++) - dryGainStep[i] = 0; + dryGainStep[i] = 0.0f; for(i = 0;i < MAX_SENDS;i++) - wetGainStep[i] = 0; + wetGainStep[i] = 0.0f; } else { @@ -1315,10 +1310,18 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma // effect slot processing while(ALEffectSlot) { - if(ALEffectSlot->effect.type == AL_EFFECT_REVERB) - VerbProcess(ALEffectSlot->ReverbState, SamplesToDo, ALEffectSlot->WetBuffer, DryBuffer); - else if(ALEffectSlot->effect.type == AL_EFFECT_ECHO) - EchoProcess(ALEffectSlot->EchoState, SamplesToDo, ALEffectSlot->WetBuffer, DryBuffer); + switch(ALEffectSlot->effect.type) + { + case AL_EFFECT_REVERB: + VerbProcess(ALEffectSlot->ReverbState, SamplesToDo, ALEffectSlot->WetBuffer, DryBuffer); + break; + case AL_EFFECT_ECHO: + EchoProcess(ALEffectSlot->EchoState, SamplesToDo, ALEffectSlot->WetBuffer, DryBuffer); + break; + case AL_EFFECT_EAXREVERB: + EAXVerbProcess(ALEffectSlot->ReverbState, SamplesToDo, ALEffectSlot->WetBuffer, DryBuffer); + break; + } for(i = 0;i < SamplesToDo;i++) ALEffectSlot->WetBuffer[i] = 0.0f; -- cgit v1.2.3