Avoid unnecessary use of CalcAngleCoeffs

This commit is contained in:
Chris Robinson 2019-05-20 21:16:13 -07:00
parent 136caf0cb0
commit 6dbd488d13
6 changed files with 8 additions and 8 deletions

View File

@ -754,7 +754,7 @@ void CalcPanningAndFilters(ALvoice *voice, const ALfloat xpos, const ALfloat ypo
* input channels of the source sends. * input channels of the source sends.
*/ */
ALfloat coeffs[MAX_AMBI_CHANNELS]; ALfloat coeffs[MAX_AMBI_CHANNELS];
CalcAngleCoeffs(az, ev, Spread, coeffs); CalcDirectionCoeffs({xpos, ypos, zpos}, Spread, coeffs);
for(ALsizei i{0};i < NumSends;i++) for(ALsizei i{0};i < NumSends;i++)
{ {

View File

@ -139,7 +139,7 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co
* delay and depth to allow enough padding for resampling. * delay and depth to allow enough padding for resampling.
*/ */
const ALCdevice *device{Context->Device}; const ALCdevice *device{Context->Device};
auto frequency = static_cast<ALfloat>(device->Frequency); const auto frequency = static_cast<ALfloat>(device->Frequency);
mDelay = maxi(float2int(props->Chorus.Delay*frequency*FRACTIONONE + 0.5f), mindelay); mDelay = maxi(float2int(props->Chorus.Delay*frequency*FRACTIONONE + 0.5f), mindelay);
mDepth = minf(props->Chorus.Depth * mDelay, static_cast<ALfloat>(mDelay - mindelay)); mDepth = minf(props->Chorus.Depth * mDelay, static_cast<ALfloat>(mDelay - mindelay));
@ -147,8 +147,8 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co
/* Gains for left and right sides */ /* Gains for left and right sides */
ALfloat coeffs[2][MAX_AMBI_CHANNELS]; ALfloat coeffs[2][MAX_AMBI_CHANNELS];
CalcAngleCoeffs(al::MathDefs<float>::Pi()*-0.5f, 0.0f, 0.0f, coeffs[0]); CalcDirectionCoeffs({-1.0f, 0.0f, 0.0f}, 0.0f, coeffs[0]);
CalcAngleCoeffs(al::MathDefs<float>::Pi()* 0.5f, 0.0f, 0.0f, coeffs[1]); CalcDirectionCoeffs({ 1.0f, 0.0f, 0.0f}, 0.0f, coeffs[1]);
mOutBuffer = target.Main->Buffer; mOutBuffer = target.Main->Buffer;
mOutChannels = target.Main->NumChannels; mOutChannels = target.Main->NumChannels;

View File

@ -81,7 +81,7 @@ void DedicatedState::update(const ALCcontext* UNUSED(context), const ALeffectslo
else else
{ {
ALfloat coeffs[MAX_AMBI_CHANNELS]; 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; mOutBuffer = target.Main->Buffer;
mOutChannels = target.Main->NumChannels; mOutChannels = target.Main->NumChannels;

View File

@ -90,7 +90,7 @@ void DistortionState::update(const ALCcontext *context, const ALeffectslot *slot
); );
ALfloat coeffs[MAX_AMBI_CHANNELS]; 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; mOutBuffer = target.Main->Buffer;
mOutChannels = target.Main->NumChannels; mOutChannels = target.Main->NumChannels;

View File

@ -131,7 +131,7 @@ void FshifterState::update(const ALCcontext *context, const ALeffectslot *slot,
} }
ALfloat coeffs[MAX_AMBI_CHANNELS]; 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; mOutBuffer = target.Main->Buffer;
mOutChannels = target.Main->NumChannels; mOutChannels = target.Main->NumChannels;

View File

@ -190,7 +190,7 @@ void PshifterState::update(const ALCcontext* UNUSED(context), const ALeffectslot
mPitchShift = mPitchShiftI * (1.0f/FRACTIONONE); mPitchShift = mPitchShiftI * (1.0f/FRACTIONONE);
ALfloat coeffs[MAX_AMBI_CHANNELS]; 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; mOutBuffer = target.Main->Buffer;
mOutChannels = target.Main->NumChannels; mOutChannels = target.Main->NumChannels;