From 6928487aa116c4645a0ae1651e0fba90499960d6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 6 May 2011 02:53:22 -0700 Subject: Remove some redundancy --- Alc/ALu.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Alc/ALu.c b/Alc/ALu.c index ccf6e45a..6f71bdac 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -456,7 +456,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALfloat InnerAngle,OuterAngle,Angle,Distance,OrigDist; ALfloat Direction[3],Position[3],SourceToListener[3]; ALfloat Velocity[3],ListenerVel[3]; - ALfloat MinVolume,MaxVolume,MinDist,MaxDist,Rolloff,OuterGainHF; + ALfloat MinVolume,MaxVolume,MinDist,MaxDist,Rolloff; ALfloat ConeVolume,ConeHF,SourceVolume,ListenerGain; ALfloat DopplerFactor, DopplerVelocity, SpeedOfSound; ALfloat AirAbsorptionFactor; @@ -506,7 +506,6 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) Rolloff = ALSource->flRollOffFactor; InnerAngle = ALSource->flInnerAngle * ConeScale; OuterAngle = ALSource->flOuterAngle * ConeScale; - OuterGainHF = ALSource->OuterGainHF; AirAbsorptionFactor = ALSource->AirAbsorptionFactor; //1. Translate Listener to origin (convert to head relative) @@ -652,13 +651,13 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) if(Angle >= InnerAngle && Angle <= OuterAngle) { ALfloat scale = (Angle-InnerAngle) / (OuterAngle-InnerAngle); - ConeVolume = (1.0f+(ALSource->flOuterGain-1.0f)*scale); - ConeHF = (1.0f+(OuterGainHF-1.0f)*scale); + ConeVolume = lerp(1.0, ALSource->flOuterGain, scale); + ConeHF = lerp(1.0, ALSource->OuterGainHF, scale); } else if(Angle > OuterAngle) { - ConeVolume = (1.0f+(ALSource->flOuterGain-1.0f)); - ConeHF = (1.0f+(OuterGainHF-1.0f)); + ConeVolume = ALSource->flOuterGain; + ConeHF = ALSource->OuterGainHF; } else { -- cgit v1.2.3