summaryrefslogtreecommitdiffstats
path: root/Alc/effects/echo.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-10-02 18:05:42 -0700
committerChris Robinson <[email protected]>2014-10-02 18:05:42 -0700
commit95ba18cf4e52c439b85ece2daf0b404fa69c7b70 (patch)
tree2367b5d69488633fb8d596cf3e3b328d81b2753f /Alc/effects/echo.c
parent9377d0f23730ff0d42a870627ea9a75059c481f4 (diff)
Make ComputeAngleGains use ComputeDirectionalGains
Diffstat (limited to 'Alc/effects/echo.c')
-rw-r--r--Alc/effects/echo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/Alc/effects/echo.c b/Alc/effects/echo.c
index 17b7269b..69d9b84f 100644
--- a/Alc/effects/echo.c
+++ b/Alc/effects/echo.c
@@ -83,9 +83,10 @@ static ALboolean ALechoState_deviceUpdate(ALechoState *state, ALCdevice *Device)
static ALvoid ALechoState_update(ALechoState *state, ALCdevice *Device, const ALeffectslot *Slot)
{
+ ALfloat pandir[3] = { 0.0f, 0.0f, 0.0f };
ALuint frequency = Device->Frequency;
- ALfloat lrpan, gain;
- ALfloat dirGain;
+ ALfloat gain = Slot->Gain;
+ ALfloat lrpan;
state->Tap[0].delay = fastf2u(Slot->EffectProps.Echo.Delay * frequency) + 1;
state->Tap[1].delay = fastf2u(Slot->EffectProps.Echo.LRDelay * frequency);
@@ -99,14 +100,13 @@ static ALvoid ALechoState_update(ALechoState *state, ALCdevice *Device, const AL
1.0f - Slot->EffectProps.Echo.Damping,
LOWPASSFREQREF/frequency, 0.0f);
- gain = Slot->Gain;
- dirGain = fabsf(lrpan);
-
/* First tap panning */
- ComputeAngleGains(Device, atan2f(-lrpan, 0.0f), (1.0f-dirGain)*F_PI, gain, state->Gain[0]);
+ pandir[0] = -lrpan;
+ ComputeDirectionalGains(Device, pandir, gain, state->Gain[0]);
/* Second tap panning */
- ComputeAngleGains(Device, atan2f(+lrpan, 0.0f), (1.0f-dirGain)*F_PI, gain, state->Gain[1]);
+ pandir[0] = +lrpan;
+ ComputeDirectionalGains(Device, pandir, gain, state->Gain[1]);
}
static ALvoid ALechoState_process(ALechoState *state, ALuint SamplesToDo, const ALfloat *restrict SamplesIn, ALfloat (*restrict SamplesOut)[BUFFERSIZE])