diff options
author | Chris Robinson <[email protected]> | 2011-05-06 02:53:22 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-06 02:53:22 -0700 |
commit | 6928487aa116c4645a0ae1651e0fba90499960d6 (patch) | |
tree | 280e10b2f8953575a78316dc42492e093ccb77b2 | |
parent | e608317e704b746ad52999d9cd15c8f2030e5c19 (diff) |
Remove some redundancy
-rw-r--r-- | Alc/ALu.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -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 { |