diff options
author | Chris Robinson <[email protected]> | 2011-05-21 23:14:55 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-05-21 23:14:55 -0700 |
commit | af005668daa679665b6eb0957a87ed3a0cbed3f0 (patch) | |
tree | 697f96378d1c580be337df2883eae506f4b35585 /Alc | |
parent | d07e94056d9522b70616e4e826156fccbbd6f278 (diff) |
Avoid using an unnecessary temp variable
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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 |