summaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-06-18 16:45:26 -0700
committerChris Robinson <[email protected]>2011-06-18 16:45:26 -0700
commit40b8934487dc29612dbed77d42802fedc91e57f5 (patch)
tree131c1f716a6b8e049657edc733d54b86e6111749 /Alc
parent0d39ac652889bc2ecea0286fe24fcdcd6c04995e (diff)
Calculate wet gain when needed
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 6d7fdfe3..185f48c5 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -491,15 +491,13 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
break;
}
- // Source Gain + Attenuation
- DryGain = SourceVolume * Attenuation;
- for(i = 0;i < NumSends;i++)
- WetGain[i] = SourceVolume * RoomAttenuation[i];
-
EffectiveDist = 0.0f;
if(MinDist > 0.0f && Attenuation < 1.0f)
EffectiveDist = (MinDist/Attenuation - MinDist)*MetersPerUnit;
+ // Source Gain + Attenuation
+ DryGain = SourceVolume * Attenuation;
+
// Distance-based air absorption
if(AirAbsorptionFactor > 0.0f && EffectiveDist > 0.0f)
{
@@ -554,6 +552,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
if(Slot->AuxSendAuto)
{
+ WetGain[i] = SourceVolume * RoomAttenuation[i];
if(ALSource->WetGainAuto)
WetGain[i] *= ConeVolume;
if(ALSource->WetGainHFAuto)