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/reverb.c | |
parent | 79e0f3e747880a3e7d8342a8602b796b84c0f322 (diff) |
Separate calculating ambisonic coefficients from the panning gains
Diffstat (limited to 'Alc/effects/reverb.c')
-rw-r--r-- | Alc/effects/reverb.c | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index e1013309..f3de2116 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -1065,6 +1065,7 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection }, LatePanAngles[4] = { DEG2RAD(45.0f), DEG2RAD(-45.0f), DEG2RAD(135.0f), DEG2RAD(-135.0f) }; + ALfloat coeffs[MAX_AMBI_COEFFS]; ALfloat length, ev, az; ALuint i; @@ -1072,7 +1073,10 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection if(!(length > FLT_EPSILON)) { for(i = 0;i < 4;i++) - ComputeAngleGains(Device, EarlyPanAngles[i], 0.0f, Gain, State->Early.PanGain[i]); + { + CalcAngleCoeffs(EarlyPanAngles[i], 0.0f, coeffs); + ComputePanningGains(Device->AmbiCoeffs, Device->NumChannels, coeffs, Gain, State->Early.PanGain[i]); + } } else { @@ -1090,7 +1094,8 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection float offset, naz, nev; naz = EarlyPanAngles[i] + (modff((az-EarlyPanAngles[i])*length/F_TAU + 1.5f, &offset)-0.5f)*F_TAU; nev = (modff((ev )*length/F_TAU + 1.5f, &offset)-0.5f)*F_TAU; - ComputeAngleGains(Device, naz, nev, Gain, State->Early.PanGain[i]); + CalcAngleCoeffs(naz, nev, coeffs); + ComputePanningGains(Device->AmbiCoeffs, Device->NumChannels, coeffs, Gain, State->Early.PanGain[i]); } } @@ -1098,7 +1103,10 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection if(!(length > FLT_EPSILON)) { for(i = 0;i < 4;i++) - ComputeAngleGains(Device, LatePanAngles[i], 0.0f, Gain, State->Late.PanGain[i]); + { + CalcAngleCoeffs(LatePanAngles[i], 0.0f, coeffs); + ComputePanningGains(Device->AmbiCoeffs, Device->NumChannels, coeffs, Gain, State->Late.PanGain[i]); + } } else { @@ -1111,12 +1119,13 @@ static ALvoid Update3DPanning(const ALCdevice *Device, const ALfloat *Reflection float offset, naz, nev; naz = LatePanAngles[i] + (modff((az-LatePanAngles[i])*length/F_TAU + 1.5f, &offset)-0.5f)*F_TAU; nev = (modff((ev )*length/F_TAU + 1.5f, &offset)-0.5f)*F_TAU; - ComputeAngleGains(Device, naz, nev, Gain, State->Late.PanGain[i]); + CalcAngleCoeffs(naz, nev, coeffs); + ComputePanningGains(Device->AmbiCoeffs, Device->NumChannels, coeffs, Gain, State->Late.PanGain[i]); } } } -static ALvoid ALreverbState_update(ALreverbState *State, ALCdevice *Device, const ALeffectslot *Slot) +static ALvoid ALreverbState_update(ALreverbState *State, const ALCdevice *Device, const ALeffectslot *Slot) { const ALeffectProps *props = &Slot->EffectProps; ALuint frequency = Device->Frequency; |