aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2007-12-18 19:13:41 -0800
committerChris Robinson <[email protected]>2007-12-18 19:13:41 -0800
commite5609279dae8578429e0605d2dabfe04bc1cab4a (patch)
treed590dec8b4e9a80116035f900e72709b179de54a /Alc
parentafd3b71849d0d7484904f8e39825d83b894fe564 (diff)
Implement AL_AUXILIARY_SEND_FILTER_GAIN_AUTO property
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index a3a563c7..ccaa5fe5 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -302,7 +302,7 @@ static ALvoid CalcSourceParams(ALCcontext *ALContext, ALsource *ALSource,
// Source Gain + Attenuation
DryMix = SourceVolume * flAttenuation;
- WetMix = SourceVolume * RoomAttenuation;
+ WetMix = SourceVolume * (ALSource->WetGainAuto ? RoomAttenuation : 1.0f);
// Clamp to Min/Max Gain
DryMix = __min(DryMix,MaxVolume);
@@ -320,6 +320,8 @@ static ALvoid CalcSourceParams(ALCcontext *ALContext, ALsource *ALSource,
{
ALfloat scale = (Angle-InnerAngle) / (OuterAngle-InnerAngle);
ConeVolume = (1.0f+(OuterGain-1.0f)*scale);
+ if(ALSource->WetGainAuto)
+ WetMix *= ConeVolume;
if(ALSource->DryGainHFAuto)
DryGainHF *= (1.0f+(OuterGainHF-1.0f)*scale);
if(ALSource->WetGainHFAuto)
@@ -328,6 +330,8 @@ static ALvoid CalcSourceParams(ALCcontext *ALContext, ALsource *ALSource,
else if(Angle > OuterAngle)
{
ConeVolume = (1.0f+(OuterGain-1.0f));
+ if(ALSource->WetGainAuto)
+ WetMix *= ConeVolume;
if(ALSource->DryGainHFAuto)
DryGainHF *= (1.0f+(OuterGainHF-1.0f));
if(ALSource->WetGainHFAuto)