diff options
author | Chris Robinson <[email protected]> | 2020-04-21 23:58:53 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-04-21 23:58:53 -0700 |
commit | 2deb5e47d1f72f211961289e6fa92ae6c89184fb (patch) | |
tree | e8a47e93709f4be475ffa2b57d0a5af358f4b7ed /alc/effects/chorus.cpp | |
parent | a97e6e6a125c561d0804c3b0d5976b8f18093027 (diff) |
Avoid an unnecessary out parameter
Diffstat (limited to 'alc/effects/chorus.cpp')
-rw-r--r-- | alc/effects/chorus.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/alc/effects/chorus.cpp b/alc/effects/chorus.cpp index 97ab85d1..418c5d2d 100644 --- a/alc/effects/chorus.cpp +++ b/alc/effects/chorus.cpp @@ -110,12 +110,12 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co switch(props->Chorus.Waveform) { - case AL_CHORUS_WAVEFORM_TRIANGLE: - mWaveform = WaveForm::Triangle; - break; - case AL_CHORUS_WAVEFORM_SINUSOID: - mWaveform = WaveForm::Sinusoid; - break; + case AL_CHORUS_WAVEFORM_TRIANGLE: + mWaveform = WaveForm::Triangle; + break; + case AL_CHORUS_WAVEFORM_SINUSOID: + mWaveform = WaveForm::Sinusoid; + break; } /* The LFO depth is scaled to be relative to the sample delay. Clamp the @@ -131,13 +131,12 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co mFeedback = props->Chorus.Feedback; /* Gains for left and right sides */ - float coeffs[2][MAX_AMBI_CHANNELS]; - CalcDirectionCoeffs({-1.0f, 0.0f, 0.0f}, 0.0f, coeffs[0]); - CalcDirectionCoeffs({ 1.0f, 0.0f, 0.0f}, 0.0f, coeffs[1]); + const auto lcoeffs = CalcDirectionCoeffs({-1.0f, 0.0f, 0.0f}, 0.0f); + const auto rcoeffs = CalcDirectionCoeffs({ 1.0f, 0.0f, 0.0f}, 0.0f); mOutTarget = target.Main->Buffer; - ComputePanGains(target.Main, coeffs[0], Slot->Params.Gain, mGains[0].Target); - ComputePanGains(target.Main, coeffs[1], Slot->Params.Gain, mGains[1].Target); + ComputePanGains(target.Main, lcoeffs.data(), Slot->Params.Gain, mGains[0].Target); + ComputePanGains(target.Main, rcoeffs.data(), Slot->Params.Gain, mGains[1].Target); float rate{props->Chorus.Rate}; if(!(rate > 0.0f)) |