aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/flanger.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/flanger.c
parent9377d0f23730ff0d42a870627ea9a75059c481f4 (diff)
Make ComputeAngleGains use ComputeDirectionalGains
Diffstat (limited to 'Alc/effects/flanger.c')
-rw-r--r--Alc/effects/flanger.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c
index 6395f4bf..a38b3b13 100644
--- a/Alc/effects/flanger.c
+++ b/Alc/effects/flanger.c
@@ -93,6 +93,8 @@ static ALboolean ALflangerState_deviceUpdate(ALflangerState *state, ALCdevice *D
static ALvoid ALflangerState_update(ALflangerState *state, ALCdevice *Device, const ALeffectslot *Slot)
{
+ static const ALfloat left_dir[3] = { -1.0f, 0.0f, 0.0f };
+ static const ALfloat right_dir[3] = { 1.0f, 0.0f, 0.0f };
ALfloat frequency = (ALfloat)Device->Frequency;
ALfloat rate;
ALint phase;
@@ -111,8 +113,8 @@ static ALvoid ALflangerState_update(ALflangerState *state, ALCdevice *Device, co
state->delay = fastf2i(Slot->EffectProps.Flanger.Delay * frequency);
/* Gains for left and right sides */
- ComputeAngleGains(Device, atan2f(-1.0f, 0.0f), 0.0f, Slot->Gain, state->Gain[0]);
- ComputeAngleGains(Device, atan2f(+1.0f, 0.0f), 0.0f, Slot->Gain, state->Gain[1]);
+ ComputeDirectionalGains(Device, left_dir, Slot->Gain, state->Gain[0]);
+ ComputeDirectionalGains(Device, right_dir, Slot->Gain, state->Gain[1]);
phase = Slot->EffectProps.Flanger.Phase;
rate = Slot->EffectProps.Flanger.Rate;