aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index b3f99ef7..ea2f6526 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -710,8 +710,21 @@ static ALvoid CalcSourceParams(const ALCcontext *ALContext,
break;
}
+ // Source Gain + Attenuation and clamp to Min/Max Gain
+ DryMix = SourceVolume * flAttenuation;
+ DryMix = __min(DryMix,MaxVolume);
+ DryMix = __max(DryMix,MinVolume);
+
+ for(i = 0;i < MAX_SENDS;i++)
+ {
+ ALfloat WetMix = SourceVolume * RoomAttenuation[i];
+ WetMix = __min(WetMix,MaxVolume);
+ wetsend[i] = __max(WetMix,MinVolume);
+ wetgainhf[i] = 1.0f;
+ }
+
// Distance-based air absorption
- if(ALSource->AirAbsorptionFactor > 0.0f && ALContext->DistanceModel != AL_NONE)
+ if(ALSource->AirAbsorptionFactor > 0.0f && ALSource->DistanceModel != AL_NONE)
{
ALfloat dist = Distance-MinDist;
ALfloat absorb;
@@ -727,19 +740,6 @@ static ALvoid CalcSourceParams(const ALCcontext *ALContext,
wetgainhf[i] *= absorb;
}
- // Source Gain + Attenuation and clamp to Min/Max Gain
- DryMix = SourceVolume * flAttenuation;
- DryMix = __min(DryMix,MaxVolume);
- DryMix = __max(DryMix,MinVolume);
-
- for(i = 0;i < MAX_SENDS;i++)
- {
- ALfloat WetMix = SourceVolume * RoomAttenuation[i];
- WetMix = __min(WetMix,MaxVolume);
- wetsend[i] = __max(WetMix,MinVolume);
- wetgainhf[i] = 1.0f;
- }
-
//3. Apply directional soundcones
Angle = aluAcos(aluDotproduct(Direction,SourceToListener)) * 180.0f/M_PI;
if(Angle >= InnerAngle && Angle <= OuterAngle)