From 6dbd488d13d455f4538595cb5b30788048a6d20a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 20 May 2019 21:16:13 -0700 Subject: Avoid unnecessary use of CalcAngleCoeffs --- Alc/alu.cpp | 2 +- Alc/effects/chorus.cpp | 6 +++--- Alc/effects/dedicated.cpp | 2 +- Alc/effects/distortion.cpp | 2 +- Alc/effects/fshifter.cpp | 2 +- Alc/effects/pshifter.cpp | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Alc/alu.cpp b/Alc/alu.cpp index dd99a9f5..d1e0772a 100644 --- a/Alc/alu.cpp +++ b/Alc/alu.cpp @@ -754,7 +754,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo * input channels of the source sends. */ ALfloat coeffs[MAX_AMBI_CHANNELS]; - CalcAngleCoeffs(az, ev, Spread, coeffs); + CalcDirectionCoeffs({xpos, ypos, zpos}, Spread, coeffs); for(ALsizei i{0};i < NumSends;i++) { diff --git a/Alc/effects/chorus.cpp b/Alc/effects/chorus.cpp index 98f01fa7..74b46a10 100644 --- a/Alc/effects/chorus.cpp +++ b/Alc/effects/chorus.cpp @@ -139,7 +139,7 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co * delay and depth to allow enough padding for resampling. */ const ALCdevice *device{Context->Device}; - auto frequency = static_cast(device->Frequency); + const auto frequency = static_cast(device->Frequency); mDelay = maxi(float2int(props->Chorus.Delay*frequency*FRACTIONONE + 0.5f), mindelay); mDepth = minf(props->Chorus.Depth * mDelay, static_cast(mDelay - mindelay)); @@ -147,8 +147,8 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co /* Gains for left and right sides */ ALfloat coeffs[2][MAX_AMBI_CHANNELS]; - CalcAngleCoeffs(al::MathDefs::Pi()*-0.5f, 0.0f, 0.0f, coeffs[0]); - CalcAngleCoeffs(al::MathDefs::Pi()* 0.5f, 0.0f, 0.0f, coeffs[1]); + CalcDirectionCoeffs({-1.0f, 0.0f, 0.0f}, 0.0f, coeffs[0]); + CalcDirectionCoeffs({ 1.0f, 0.0f, 0.0f}, 0.0f, coeffs[1]); mOutBuffer = target.Main->Buffer; mOutChannels = target.Main->NumChannels; diff --git a/Alc/effects/dedicated.cpp b/Alc/effects/dedicated.cpp index 4c528a61..14d0c3c8 100644 --- a/Alc/effects/dedicated.cpp +++ b/Alc/effects/dedicated.cpp @@ -81,7 +81,7 @@ void DedicatedState::update(const ALCcontext* UNUSED(context), const ALeffectslo else { ALfloat coeffs[MAX_AMBI_CHANNELS]; - CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs); + CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f, coeffs); mOutBuffer = target.Main->Buffer; mOutChannels = target.Main->NumChannels; diff --git a/Alc/effects/distortion.cpp b/Alc/effects/distortion.cpp index 3639297f..d2bcd018 100644 --- a/Alc/effects/distortion.cpp +++ b/Alc/effects/distortion.cpp @@ -90,7 +90,7 @@ void DistortionState::update(const ALCcontext *context, const ALeffectslot *slot ); ALfloat coeffs[MAX_AMBI_CHANNELS]; - CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs); + CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f, coeffs); mOutBuffer = target.Main->Buffer; mOutChannels = target.Main->NumChannels; diff --git a/Alc/effects/fshifter.cpp b/Alc/effects/fshifter.cpp index 4587b721..e3dc6f1d 100644 --- a/Alc/effects/fshifter.cpp +++ b/Alc/effects/fshifter.cpp @@ -131,7 +131,7 @@ void FshifterState::update(const ALCcontext *context, const ALeffectslot *slot, } ALfloat coeffs[MAX_AMBI_CHANNELS]; - CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs); + CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f, coeffs); mOutBuffer = target.Main->Buffer; mOutChannels = target.Main->NumChannels; diff --git a/Alc/effects/pshifter.cpp b/Alc/effects/pshifter.cpp index f95579d7..1d85fb9e 100644 --- a/Alc/effects/pshifter.cpp +++ b/Alc/effects/pshifter.cpp @@ -190,7 +190,7 @@ void PshifterState::update(const ALCcontext* UNUSED(context), const ALeffectslot mPitchShift = mPitchShiftI * (1.0f/FRACTIONONE); ALfloat coeffs[MAX_AMBI_CHANNELS]; - CalcAngleCoeffs(0.0f, 0.0f, 0.0f, coeffs); + CalcDirectionCoeffs({0.0f, 0.0f, -1.0f}, 0.0f, coeffs); mOutBuffer = target.Main->Buffer; mOutChannels = target.Main->NumChannels; -- cgit v1.2.3