diff options
author | Chris Robinson <[email protected]> | 2016-01-25 06:11:51 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-01-25 06:11:51 -0800 |
commit | f547ef6d391be5e0cd3e0477c3f8de859a47df69 (patch) | |
tree | d135e13f3a204af7eaac97a71744e308da661fe2 /Alc/effects/flanger.c | |
parent | 79e0f3e747880a3e7d8342a8602b796b84c0f322 (diff) |
Separate calculating ambisonic coefficients from the panning gains
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; |