diff options
-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; } } } |