diff options
Diffstat (limited to 'Alc/effects/flanger.c')
-rw-r--r-- | Alc/effects/flanger.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c index f6191abd..5fcc8be8 100644 --- a/Alc/effects/flanger.c +++ b/Alc/effects/flanger.c @@ -91,11 +91,10 @@ static ALboolean ALflangerState_deviceUpdate(ALflangerState *state, ALCdevice *D return AL_TRUE; } -static ALvoid ALflangerState_update(ALflangerState *state, ALCdevice *Device, const ALeffectslot *Slot) +static ALvoid ALflangerState_update(ALflangerState *state, const 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 coeffs[MAX_AMBI_COEFFS]; ALfloat rate; ALint phase; @@ -113,8 +112,10 @@ static ALvoid ALflangerState_update(ALflangerState *state, ALCdevice *Device, co state->delay = fastf2i(Slot->EffectProps.Flanger.Delay * frequency); /* Gains for left and right sides */ - ComputeDirectionalGains(Device, left_dir, Slot->Gain, state->Gain[0]); - ComputeDirectionalGains(Device, right_dir, Slot->Gain, state->Gain[1]); + CalcXYZCoeffs(-1.0f, 0.0f, 0.0f, coeffs); + ComputePanningGains(Device->AmbiCoeffs, Device->NumChannels, coeffs, Slot->Gain, state->Gain[0]); + CalcXYZCoeffs( 1.0f, 0.0f, 0.0f, coeffs); + ComputePanningGains(Device->AmbiCoeffs, Device->NumChannels, coeffs, Slot->Gain, state->Gain[1]); phase = Slot->EffectProps.Flanger.Phase; rate = Slot->EffectProps.Flanger.Rate; |