From 1d3926e1872657da9b0490cff233454b583ff964 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 18 May 2011 18:49:41 -0700 Subject: Remove some more duplication --- Alc/alcEcho.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'Alc') diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c index 68549fde..35b94a90 100644 --- a/Alc/alcEcho.c +++ b/Alc/alcEcho.c @@ -105,7 +105,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff { ALechoState *state = (ALechoState*)effect; ALuint frequency = Context->Device->Frequency; - ALfloat lrpan, cw, a, g; + ALfloat lrpan, cw, g; state->Tap[0].delay = (ALuint)(Effect->Echo.Delay * frequency) + 1; state->Tap[1].delay = (ALuint)(Effect->Echo.LRDelay * frequency); @@ -119,10 +119,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, const ALeff cw = cos(2.0*M_PI * LOWPASSFREQCUTOFF / frequency); g = 1.0f - Effect->Echo.Damping; - a = 0.0f; - if(g < 0.9999f) // 1-epsilon - a = (1 - g*cw - aluSqrt(2*g*(1-cw) - g*g*(1 - cw*cw))) / (1 - g); - state->iirFilter.coeff = a; + state->iirFilter.coeff = lpCoeffCalc(g, cw); } static ALvoid EchoProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[MAXCHANNELS]) -- cgit v1.2.3