aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALu.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r--Alc/ALu.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index 7d95b101..781a986e 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -813,12 +813,12 @@ ALvoid CalcSourceParams(ALvoice *voice, const ALsource *ALSource, const ALCconte
case InverseDistance:
if(MinDist > 0.0f)
{
- if((MinDist + (Rolloff * (ClampedDist - MinDist))) > 0.0f)
- Attenuation = MinDist / (MinDist + (Rolloff * (ClampedDist - MinDist)));
+ ALfloat dist = lerp(MinDist, ClampedDist, Rolloff);
+ if(dist > 0.0f) Attenuation = MinDist / dist;
for(i = 0;i < NumSends;i++)
{
- if((MinDist + (RoomRolloff[i] * (ClampedDist - MinDist))) > 0.0f)
- RoomAttenuation[i] = MinDist / (MinDist + (RoomRolloff[i] * (ClampedDist - MinDist)));
+ dist = lerp(MinDist, ClampedDist, RoomRolloff[i]);
+ if(dist > 0.0f) RoomAttenuation[i] = MinDist / dist;
}
}
break;