diff options
author | Chris Robinson <[email protected]> | 2016-03-25 14:47:30 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-03-25 14:47:30 -0700 |
commit | 05dace65257ed8828a2e3a5cc3add0016b1ac72e (patch) | |
tree | 57abb15f5636fc758803e139ae4474c05b2d72f5 /Alc | |
parent | 31489861847dcb15a2f21ffb70d98f9da6051c8f (diff) |
Mix Dedicated effects to the real output if possible
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/effects/dedicated.c | 27 |
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; } } } |