aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/echo.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-01-25 06:11:51 -0800
committerChris Robinson <[email protected]>2016-01-25 06:11:51 -0800
commitf547ef6d391be5e0cd3e0477c3f8de859a47df69 (patch)
treed135e13f3a204af7eaac97a71744e308da661fe2 /Alc/effects/echo.c
parent79e0f3e747880a3e7d8342a8602b796b84c0f322 (diff)
Separate calculating ambisonic coefficients from the panning gains
Diffstat (limited to 'Alc/effects/echo.c')
-rw-r--r--Alc/effects/echo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c
index f5a53c36..e2bb6407 100644
--- a/Alc/effects/echo.c
+++ b/Alc/effects/echo.c
@@ -81,10 +81,10 @@ static ALboolean ALechoState_deviceUpdate(ALechoState *state, ALCdevice *Device)
return AL_TRUE;
}
-static ALvoid ALechoState_update(ALechoState *state, ALCdevice *Device, const ALeffectslot *Slot)
+static ALvoid ALechoState_update(ALechoState *state, const ALCdevice *Device, const ALeffectslot *Slot)
{
- ALfloat pandir[3] = { 0.0f, 0.0f, 0.0f };
ALuint frequency = Device->Frequency;
+ ALfloat coeffs[MAX_AMBI_COEFFS];
ALfloat gain, lrpan;
state->Tap[0].delay = fastf2u(Slot->EffectProps.Echo.Delay * frequency) + 1;
@@ -103,12 +103,12 @@ static ALvoid ALechoState_update(ALechoState *state, ALCdevice *Device, const AL
gain = Slot->Gain;
/* First tap panning */
- pandir[0] = -lrpan;
- ComputeDirectionalGains(Device, pandir, gain, state->Gain[0]);
+ CalcXYZCoeffs(-lrpan, 0.0f, 0.0f, coeffs);
+ ComputePanningGains(Device->AmbiCoeffs, Device->NumChannels, coeffs, gain, state->Gain[0]);
/* Second tap panning */
- pandir[0] = +lrpan;
- ComputeDirectionalGains(Device, pandir, gain, state->Gain[1]);
+ CalcXYZCoeffs( lrpan, 0.0f, 0.0f, coeffs);
+ ComputePanningGains(Device->AmbiCoeffs, Device->NumChannels, coeffs, gain, state->Gain[1]);
}
static ALvoid ALechoState_process(ALechoState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE], ALuint NumChannels)