aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-05-21 23:14:55 -0700
committerChris Robinson <[email protected]>2011-05-21 23:14:55 -0700
commitaf005668daa679665b6eb0957a87ed3a0cbed3f0 (patch)
tree697f96378d1c580be337df2883eae506f4b35585 /Alc
parentd07e94056d9522b70616e4e826156fccbbd6f278 (diff)
Avoid using an unnecessary temp variable
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index b387d7e1..b37d04e8 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -660,10 +660,9 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
{
const ALshort *hrtf_left, *hrtf_right;
- length = OrigDist;
- if(length > 0.0f)
+ if(OrigDist > 0.0f)
{
- ALfloat invlen = 1.0f/length;
+ ALfloat invlen = 1.0f/OrigDist;
Position[0] *= invlen;
Position[1] *= invlen;
Position[2] *= invlen;
@@ -674,10 +673,8 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext)
&hrtf_left, &hrtf_right);
for(i = 0;i < HRTF_LENGTH;i++)
{
- ALSource->Params.HrtfCoeffs[0][i][0] = hrtf_left[i]*(1.0/32767.0)*
- DryGain;
- ALSource->Params.HrtfCoeffs[0][i][1] = hrtf_right[i]*(1.0/32767.0)*
- DryGain;
+ ALSource->Params.HrtfCoeffs[0][i][0] = hrtf_left[i]*(1.0/32767.0) * DryGain;
+ ALSource->Params.HrtfCoeffs[0][i][1] = hrtf_right[i]*(1.0/32767.0) * DryGain;
}
}
else