diff options
author | Chris Robinson <[email protected]> | 2014-11-05 02:54:11 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-11-05 02:54:11 -0800 |
commit | c834c3fae59327a69914b22e8b7b357282963d3e (patch) | |
tree | 95587e365aef205eb70aedaddcdca765b9287910 /Alc/effects | |
parent | e5016f814a265ed592a88acea95cf912c4bfdf12 (diff) |
Set gains using the device channel index
Diffstat (limited to 'Alc/effects')
-rw-r--r-- | Alc/effects/dedicated.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c index e3014967..755ed611 100644 --- a/Alc/effects/dedicated.c +++ b/Alc/effects/dedicated.c @@ -56,15 +56,17 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, ALCdevice *device Gain = Slot->Gain * Slot->EffectProps.Dedicated.Gain; if(Slot->EffectType == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT) { - if(GetChannelIdxByName(device, LFE) != -1) - state->gains[LFE] = Gain; + int idx; + if((idx=GetChannelIdxByName(device, LFE)) != -1) + state->gains[idx] = Gain; } 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(GetChannelIdxByName(device, FrontCenter) != -1) - state->gains[FrontCenter] = Gain; + if((idx=GetChannelIdxByName(device, FrontCenter)) != -1) + state->gains[idx] = Gain; else { static const ALfloat front_dir[3] = { 0.0f, 0.0f, -1.0f }; |