aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/chorus.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-12-23 08:51:28 -0800
committerChris Robinson <[email protected]>2018-12-23 08:51:28 -0800
commit3fe38fed7c29869a43b42d634417452b1a5fedbc (patch)
treeb61cd690dbaced50afef8ff69c880d9a99136149 /Alc/effects/chorus.cpp
parente218999b4f408b7fd35daa9d021288b68f5b4ab5 (diff)
Mix effect slot output to the effect target if it's set
Diffstat (limited to 'Alc/effects/chorus.cpp')
-rw-r--r--Alc/effects/chorus.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/Alc/effects/chorus.cpp b/Alc/effects/chorus.cpp
index 925cd09f..1a444525 100644
--- a/Alc/effects/chorus.cpp
+++ b/Alc/effects/chorus.cpp
@@ -146,11 +146,23 @@ void ChorusState::update(const ALCcontext *Context, const ALeffectslot *Slot, co
mFeedback = props->Chorus.Feedback;
/* Gains for left and right sides */
- ALfloat coeffs[MAX_AMBI_COEFFS];
- CalcAngleCoeffs(-F_PI_2, 0.0f, 0.0f, coeffs);
- ComputePanGains(&device->Dry, coeffs, Slot->Params.Gain, mGains[0].Target);
- CalcAngleCoeffs( F_PI_2, 0.0f, 0.0f, coeffs);
- ComputePanGains(&device->Dry, coeffs, Slot->Params.Gain, mGains[1].Target);
+ ALfloat coeffs[2][MAX_AMBI_COEFFS];
+ CalcAngleCoeffs(-F_PI_2, 0.0f, 0.0f, coeffs[0]);
+ CalcAngleCoeffs( F_PI_2, 0.0f, 0.0f, coeffs[1]);
+ if(ALeffectslot *target{Slot->Params.Target})
+ {
+ mOutBuffer = target->WetBuffer;
+ mOutChannels = target->NumChannels;
+ ComputePanGains(target, coeffs[0], Slot->Params.Gain, mGains[0].Target);
+ ComputePanGains(target, coeffs[1], Slot->Params.Gain, mGains[1].Target);
+ }
+ else
+ {
+ mOutBuffer = device->Dry.Buffer;
+ mOutChannels = device->Dry.NumChannels;
+ ComputePanGains(&device->Dry, coeffs[0], Slot->Params.Gain, mGains[0].Target);
+ ComputePanGains(&device->Dry, coeffs[1], Slot->Params.Gain, mGains[1].Target);
+ }
ALfloat rate{props->Chorus.Rate};
if(!(rate > 0.0f))