From a5ccae57793c75c6c4162d29be0ac6c5eae8ec63 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 1 Jul 2011 02:29:10 -0700 Subject: Do air absorption with linear gain values This copies the way the calculation is done with the wet path --- Alc/ALu.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'Alc/ALu.c') diff --git a/Alc/ALu.c b/Alc/ALu.c index 66cf6009..7cddb5a8 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -537,17 +537,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) // Distance-based air absorption if(AirAbsorptionFactor > 0.0f && EffectiveDist > 0.0f) - { - ALfloat absorb; - - // Absorption calculation is done in dB - absorb = (AirAbsorptionFactor*AIRABSORBGAINDBHF) * - EffectiveDist; - // Convert dB to linear gain before applying - absorb = aluPow(10.0f, absorb/20.0f); - - DryGainHF *= absorb; - } + DryGainHF *= aluPow(AIRABSORBGAINHF, AirAbsorptionFactor*EffectiveDist); //3. Apply directional soundcones Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * (180.0/M_PI); -- cgit v1.2.3