aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/effects/dedicated.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-03-25 14:47:30 -0700
committerChris Robinson <[email protected]>2016-03-25 14:47:30 -0700
commit05dace65257ed8828a2e3a5cc3add0016b1ac72e (patch)
tree57abb15f5636fc758803e139ae4474c05b2d72f5 /Alc/effects/dedicated.c
parent31489861847dcb15a2f21ffb70d98f9da6051c8f (diff)
Mix Dedicated effects to the real output if possible
Diffstat (limited to 'Alc/effects/dedicated.c')
-rw-r--r--Alc/effects/dedicated.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c
index 447e6b95..893f3abc 100644
--- a/Alc/effects/dedicated.c
+++ b/Alc/effects/dedicated.c
@@ -57,22 +57,37 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, const ALCdevice *
if(Slot->EffectType == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT)
{
int idx;
- if((idx=GetChannelIdxByName(device->Dry, LFE)) != -1)
+ if((idx=GetChannelIdxByName(device->RealOut, LFE)) != -1)
+ {
state->gains[idx] = Gain;
+ STATIC_CAST(ALeffectState,state)->OutBuffer = device->RealOut.Buffer;
+ STATIC_CAST(ALeffectState,state)->OutChannels = device->RealOut.NumChannels;
+ }
}
else if(Slot->EffectType == AL_EFFECT_DEDICATED_DIALOGUE)
{
int idx;
/* Dialog goes to the front-center speaker if it exists, otherwise it
* plays from the front-center location. */
- if((idx=GetChannelIdxByName(device->Dry, FrontCenter)) != -1)
+ if((idx=GetChannelIdxByName(device->RealOut, FrontCenter)) != -1)
+ {
state->gains[idx] = Gain;
+ STATIC_CAST(ALeffectState,state)->OutBuffer = device->RealOut.Buffer;
+ STATIC_CAST(ALeffectState,state)->OutChannels = device->RealOut.NumChannels;
+ }
else
{
- ALfloat coeffs[MAX_AMBI_COEFFS];
- CalcXYZCoeffs(0.0f, 0.0f, -1.0f, coeffs);
- ComputePanningGains(device->Dry.AmbiCoeffs, device->Dry.NumChannels,
- coeffs, Gain, state->gains);
+ if((idx=GetChannelIdxByName(device->Dry, FrontCenter)) != -1)
+ state->gains[idx] = Gain;
+ else
+ {
+ ALfloat coeffs[MAX_AMBI_COEFFS];
+ CalcXYZCoeffs(0.0f, 0.0f, -1.0f, coeffs);
+ ComputePanningGains(device->Dry.AmbiCoeffs, device->Dry.NumChannels,
+ coeffs, Gain, state->gains);
+ }
+ STATIC_CAST(ALeffectState,state)->OutBuffer = device->Dry.Buffer;
+ STATIC_CAST(ALeffectState,state)->OutChannels = device->Dry.NumChannels;
}
}
}