aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 78f18782..b7471132 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -620,13 +620,13 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
DirGain = aluSqrt(Position[0]*Position[0] + Position[2]*Position[2]);
// elevation adjustment for directional gain. this sucks, but
// has low complexity
- AmbientGain = 1.0/aluSqrt(Device->NumChan) * (1.0-DirGain);
+ AmbientGain = aluSqrt(1.0/Device->NumChan);
for(s = 0;s < OUTPUTCHANNELS;s++)
ALSource->Params.DryGains[s] = 0.0f;
for(s = 0;s < (ALsizei)Device->NumChan;s++)
{
Channel chan = Device->Speaker2Chan[s];
- ALfloat gain = SpeakerGain[chan]*DirGain + AmbientGain;
+ ALfloat gain = AmbientGain + (SpeakerGain[chan]-AmbientGain)*DirGain;
ALSource->Params.DryGains[chan] = DryGain * gain;
}