From 110be7f500f08e4d926af80bbae8586ebafef983 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 23 Apr 2010 07:54:43 -0700 Subject: Add an option to scale the output mix --- Alc/ALu.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'Alc/ALu.c') diff --git a/Alc/ALu.c b/Alc/ALu.c index 4c23dad4..c5915c1b 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -234,7 +234,6 @@ ALvoid aluInitPanning(ALCdevice *Device) Channel Speaker2Chan[OUTPUTCHANNELS]; ALfloat Alpha, Theta; ALint pos, offset; - ALfloat maxout; ALuint s, s2; for(s = 0;s < OUTPUTCHANNELS;s++) @@ -381,23 +380,25 @@ ALvoid aluInitPanning(ALCdevice *Device) assert(0); } - maxout = 1.0f; - for(s = 0;s < OUTPUTCHANNELS;s++) + if(GetConfigValueBool(NULL, "scalemix", 0)) { - ALfloat out = 0.0f; - for(s2 = 0;s2 < OUTPUTCHANNELS;s2++) - out += Device->ChannelMatrix[s2][s]; - maxout = __max(maxout, out); - } + ALfloat maxout = 1.0f; + for(s = 0;s < OUTPUTCHANNELS;s++) + { + ALfloat out = 0.0f; + for(s2 = 0;s2 < OUTPUTCHANNELS;s2++) + out += Device->ChannelMatrix[s2][s]; + maxout = __max(maxout, out); + } - maxout = 1.0f/maxout; - for(s = 0;s < OUTPUTCHANNELS;s++) - { - for(s2 = 0;s2 < OUTPUTCHANNELS;s2++) - Device->ChannelMatrix[s2][s] *= maxout; + maxout = 1.0f/maxout; + for(s = 0;s < OUTPUTCHANNELS;s++) + { + for(s2 = 0;s2 < OUTPUTCHANNELS;s2++) + Device->ChannelMatrix[s2][s] *= maxout; + } } - for(pos = 0; pos < LUT_NUM; pos++) { /* clear all values */ -- cgit v1.2.3