aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/panning.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-03-23 15:11:33 -0700
committerChris Robinson <[email protected]>2016-03-23 15:11:33 -0700
commit2847590d454f4fa51ec2561d47d2872bf01997d5 (patch)
tree23152aba159173d45ac0dc1935876628996fc4b7 /Alc/panning.c
parent147274f165b5cf8f1f004567c777e0e274c9e228 (diff)
Simplify setting a custom channel map configuration
Diffstat (limited to 'Alc/panning.c')
-rw-r--r--Alc/panning.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/Alc/panning.c b/Alc/panning.c
index 9c504b04..8d66df04 100644
--- a/Alc/panning.c
+++ b/Alc/panning.c
@@ -430,30 +430,20 @@ static bool LoadChannelSetup(ALCdevice *device)
{
ALuint chan = speakermap[i];
ALuint j, k = 0;
+ ALfloat gain;
for(j = 0;j < MAX_AMBI_COEFFS;j++)
chanmap[i].Config[j] = 0.0f;
chanmap[i].ChanName = device->RealOut.ChannelName[chan];
- for(j = 0;j < 1;j++)
- {
- if((conf.ChanMask&(1<<j)))
- chanmap[i].Config[j] = conf.HFMatrix[i][k++] / coeff_scale[j] * conf.HFOrderGain[0];
- }
- for(;j < 4;j++)
- {
- if((conf.ChanMask&(1<<j)))
- chanmap[i].Config[j] = conf.HFMatrix[i][k++] / coeff_scale[j] * conf.HFOrderGain[1];
- }
- for(;j < 9;j++)
- {
- if((conf.ChanMask&(1<<j)))
- chanmap[i].Config[j] = conf.HFMatrix[i][k++] / coeff_scale[j] * conf.HFOrderGain[2];
- }
- for(;j < 16;j++)
+ for(j = 0;j < MAX_AMBI_COEFFS;j++)
{
+ if(j == 0) gain = conf.HFOrderGain[0];
+ else if(j == 1) gain = conf.HFOrderGain[1];
+ else if(j == 4) gain = conf.HFOrderGain[2];
+ else if(j == 9) gain = conf.HFOrderGain[3];
if((conf.ChanMask&(1<<j)))
- chanmap[i].Config[j] = conf.HFMatrix[i][k++] / coeff_scale[j] * conf.HFOrderGain[3];
+ chanmap[i].Config[j] = conf.HFMatrix[i][k++] / coeff_scale[j] * gain;
}
}