diff options
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALc.c | 2 | ||||
-rw-r--r-- | Alc/ALu.c | 15 | ||||
-rw-r--r-- | Alc/effects/dedicated.c | 4 | ||||
-rw-r--r-- | Alc/panning.c | 2 |
4 files changed, 9 insertions, 14 deletions
@@ -1538,7 +1538,7 @@ void SetDefaultChannelOrder(ALCdevice *device) } } -extern inline ALint GetChannelIdxByName(const ALCdevice *device, enum Channel chan); +extern inline ALint GetChannelIndex(const enum Channel names[MAX_OUTPUT_CHANNELS], enum Channel chan); /* ALCcontext_DeferUpdates @@ -563,16 +563,11 @@ ALvoid CalcNonAttnSourceParams(ALvoice *voice, const ALsource *ALSource, const A voice->Direct.OutChannels = Device->RealOut.NumChannels; for(c = 0;c < num_channels;c++) { + int idx; for(j = 0;j < MAX_OUTPUT_CHANNELS;j++) voice->Direct.Gains[c].Target[j] = 0.0f; - for(j = 0;j < Device->RealOut.NumChannels;j++) - { - if(chans[c].channel == Device->RealOut.ChannelName[j]) - { - voice->Direct.Gains[c].Target[j] = DryGain; - break; - } - } + if((idx=GetChannelIdxByName(Device->RealOut, chans[c].channel)) != -1) + voice->Direct.Gains[c].Target[idx] = DryGain; } } else for(c = 0;c < num_channels;c++) @@ -580,7 +575,7 @@ ALvoid CalcNonAttnSourceParams(ALvoice *voice, const ALsource *ALSource, const A int idx; for(j = 0;j < MAX_OUTPUT_CHANNELS;j++) voice->Direct.Gains[c].Target[j] = 0.0f; - if((idx=GetChannelIdxByName(Device, chans[c].channel)) != -1) + if((idx=GetChannelIdxByName(Device->Dry, chans[c].channel)) != -1) voice->Direct.Gains[c].Target[idx] = DryGain; } @@ -676,7 +671,7 @@ ALvoid CalcNonAttnSourceParams(ALvoice *voice, const ALsource *ALSource, const A int idx; for(j = 0;j < MAX_OUTPUT_CHANNELS;j++) voice->Direct.Gains[c].Target[j] = 0.0f; - if((idx=GetChannelIdxByName(Device, chans[c].channel)) != -1) + if((idx=GetChannelIdxByName(Device->Dry, chans[c].channel)) != -1) voice->Direct.Gains[c].Target[idx] = DryGain; for(i = 0;i < NumSends;i++) diff --git a/Alc/effects/dedicated.c b/Alc/effects/dedicated.c index 2706a672..447e6b95 100644 --- a/Alc/effects/dedicated.c +++ b/Alc/effects/dedicated.c @@ -57,7 +57,7 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, const ALCdevice * if(Slot->EffectType == AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT) { int idx; - if((idx=GetChannelIdxByName(device, LFE)) != -1) + if((idx=GetChannelIdxByName(device->Dry, LFE)) != -1) state->gains[idx] = Gain; } else if(Slot->EffectType == AL_EFFECT_DEDICATED_DIALOGUE) @@ -65,7 +65,7 @@ static ALvoid ALdedicatedState_update(ALdedicatedState *state, const ALCdevice * int idx; /* Dialog goes to the front-center speaker if it exists, otherwise it * plays from the front-center location. */ - if((idx=GetChannelIdxByName(device, FrontCenter)) != -1) + if((idx=GetChannelIdxByName(device->Dry, FrontCenter)) != -1) state->gains[idx] = Gain; else { diff --git a/Alc/panning.c b/Alc/panning.c index beb928d9..1765d1c8 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -534,7 +534,7 @@ ALvoid aluInitPanning(ALCdevice *device) for(i = 0;i < device->Dry.NumChannels;i++) { - int chan = GetChannelIdxByName(device, CubeInfo[i].Channel); + int chan = GetChannelIdxByName(device->Dry, CubeInfo[i].Channel); GetLerpedHrtfCoeffs(device->Hrtf, CubeInfo[i].Elevation, CubeInfo[i].Angle, 1.0f, 1.0f, device->Hrtf_Params[chan].Coeffs, device->Hrtf_Params[chan].Delay); } |