From a59332f6221cbb0b0aedae90ff9b2becf464f543 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 19 Apr 2016 13:58:33 -0700 Subject: Combine two if checks into one --- Alc/panning.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'Alc') diff --git a/Alc/panning.c b/Alc/panning.c index 5803a4e0..ed10c321 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -607,17 +607,13 @@ static void InitHQPanning(ALCdevice *device, const AmbDecConf *conf, const ALuin size_t count; ALuint i; - if((conf->ChanMask & ~0x831b)) - count = (conf->ChanMask > 0xf) ? (conf->ChanMask > 0x1ff) ? 16: 9 : 4; - else - count = (conf->ChanMask > 0xf) ? (conf->ChanMask > 0x1ff) ? 7 : 5 : 3; - devname = al_string_get_cstr(device->DeviceName); if(GetConfigValueBool(devname, "decoder", "distance-comp", 1)) decflags |= BFDF_DistanceComp; if((conf->ChanMask & ~0x831b)) { + count = (conf->ChanMask > 0xf) ? 9 : 4; for(i = 0;i < count;i++) { device->Dry.Ambi.Map[i].Scale = 1.0f; @@ -627,6 +623,8 @@ static void InitHQPanning(ALCdevice *device, const AmbDecConf *conf, const ALuin else { static int map[MAX_AMBI_COEFFS] = { 0, 1, 3, 4, 8, 9, 15 }; + + count = (conf->ChanMask > 0xf) ? (conf->ChanMask > 0x1ff) ? 7 : 5 : 3; for(i = 0;i < count;i++) { device->Dry.Ambi.Map[i].Scale = 1.0f; -- cgit v1.2.3