aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/alcEcho.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-05-29 16:51:00 -0700
committerChris Robinson <[email protected]>2009-05-29 16:51:00 -0700
commit2c20f2678478c2320a0236baf288baed8987b1f8 (patch)
treea1183d8badad01480382a8bdd18dca87c5cb1a8d /Alc/alcEcho.c
parent2a21a449b4828a08780e44d17586de4ba2119f0a (diff)
Apply slot gain on slot output, not input
Diffstat (limited to 'Alc/alcEcho.c')
-rw-r--r--Alc/alcEcho.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c
index 99bd8a54..7185e125 100644
--- a/Alc/alcEcho.c
+++ b/Alc/alcEcho.c
@@ -79,7 +79,7 @@ ALvoid EchoDestroy(ALeffectState *effect)
}
}
-ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, struct ALeffectslot *Slot, ALeffect *Effect)
+ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, ALeffect *Effect)
{
ALechoState *state = (ALechoState*)effect;
ALuint newdelay1, newdelay2;
@@ -107,13 +107,14 @@ ALvoid EchoUpdate(ALeffectState *effect, ALCcontext *Context, struct ALeffectslo
state->iirFilter.coeff = a;
}
-ALvoid EchoProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS])
+ALvoid EchoProcess(ALeffectState *effect, const ALeffectslot *Slot, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[OUTPUTCHANNELS])
{
ALechoState *state = (ALechoState*)effect;
const ALuint delay = state->BufferLength-1;
ALuint tap1off = state->Tap[0].offset;
ALuint tap2off = state->Tap[1].offset;
ALuint fboff = state->Tap[2].offset;
+ ALfloat gain = Slot->Gain;
ALfloat samp[2];
ALuint i;
@@ -135,6 +136,9 @@ ALvoid EchoProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *Sam
// Sample second tap. Reverse LR panning
samp[0] += state->SampleBuffer[tap2off]*state->GainR;
samp[1] += state->SampleBuffer[tap2off]*state->GainL;
+ // Apply slot gain
+ samp[0] *= gain;
+ samp[1] *= gain;
SamplesOut[i][FRONT_LEFT] += samp[0];
SamplesOut[i][FRONT_RIGHT] += samp[1];