aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-09-30 17:51:21 -0700
committerChris Robinson <[email protected]>2011-09-30 17:51:21 -0700
commitbf19186223d3b3cd684582b55868b58a0a0c2318 (patch)
tree39b7f071739d339445ee1fb29cfeab9f9ee57bd7 /Alc
parent087e75d47f14070a43a1b0332e639eedceea882c (diff)
Apply the initial wet send reverb decay before clamping the gains
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 9965e002..8f49ddd3 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -579,7 +579,24 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
AirAbsorptionFactor*EffectiveDist);
}
- //3. Apply directional soundcones
+ if(WetGainAuto)
+ {
+ /* Apply a decay-time transformation to the wet path, based on the
+ * attenuation of the dry path.
+ *
+ * Using the approximate (effective) source to listener distance, the
+ * initial decay of the reverb effect is calculated and applied to the
+ * wet path.
+ */
+ for(i = 0;i < NumSends;i++)
+ {
+ if(DecayDistance[i] > 0.0f)
+ WetGain[i] *= aluPow(0.001f /* -60dB */,
+ EffectiveDist / DecayDistance[i]);
+ }
+ }
+
+ /* Calculate directional soundcones */
Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * (180.0f/F_PI);
if(Angle >= InnerAngle && Angle <= OuterAngle)
{
@@ -626,23 +643,6 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
WetGainHF[i] *= ALSource->Send[i].WetGainHF;
}
- if(WetGainAuto)
- {
- /* Apply a decay-time transformation to the wet path, based on the
- * attenuation of the dry path.
- *
- * Using the approximate (effective) source to listener distance, the
- * initial decay of the reverb effect is calculated and applied to the
- * wet path.
- */
- for(i = 0;i < NumSends;i++)
- {
- if(DecayDistance[i] > 0.0f)
- WetGain[i] *= aluPow(0.001f /* -60dB */,
- EffectiveDist / DecayDistance[i]);
- }
- }
-
// Calculate Velocity
if(DopplerFactor != 0.0f)
{