diff options
author | Chris Robinson <[email protected]> | 2011-10-02 22:05:03 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-10-02 22:05:03 -0700 |
commit | e1cbf06653171e9fff398cf07641bac9d51262d8 (patch) | |
tree | e4b9cca4a9e0a7cf474bf30cec5a5c5ecd3dbe00 /Alc | |
parent | 5a1959f0cf998a8ecae0a78a9d21d2c0d9da3e76 (diff) |
Don't use a double when calculating the HRTF coefficients
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/hrtf.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -161,15 +161,15 @@ void GetLerpedHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azi // coefficients if gain is too low. if(gain > 0.0001f) { - ALdouble scale = gain * (1.0/32767.0); + gain *= 1.0f/32767.0f; for(i = 0;i < HRIR_LENGTH;i++) { coeffs[i][0] = lerp(lerp(Hrtf->coeffs[lidx[0]][i], Hrtf->coeffs[lidx[1]][i], mu[0]), lerp(Hrtf->coeffs[lidx[2]][i], Hrtf->coeffs[lidx[3]][i], mu[1]), - mu[2]) * scale; + mu[2]) * gain; coeffs[i][1] = lerp(lerp(Hrtf->coeffs[ridx[0]][i], Hrtf->coeffs[ridx[1]][i], mu[0]), lerp(Hrtf->coeffs[ridx[2]][i], Hrtf->coeffs[ridx[3]][i], mu[1]), - mu[2]) * scale; + mu[2]) * gain; } } else @@ -241,7 +241,7 @@ ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat a // coefficients. if(gain > 0.0001f) { - ALdouble scale = gain * (1.0/32767.0); + gain *= 1.0f/32767.0f; for(i = 0;i < HRIR_LENGTH;i++) { left = coeffs[i][0] - (coeffStep[i][0] * counter); @@ -249,10 +249,10 @@ ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat a coeffs[i][0] = lerp(lerp(Hrtf->coeffs[lidx[0]][i], Hrtf->coeffs[lidx[1]][i], mu[0]), lerp(Hrtf->coeffs[lidx[2]][i], Hrtf->coeffs[lidx[3]][i], mu[1]), - mu[2]) * scale; + mu[2]) * gain; coeffs[i][1] = lerp(lerp(Hrtf->coeffs[ridx[0]][i], Hrtf->coeffs[ridx[1]][i], mu[0]), lerp(Hrtf->coeffs[ridx[2]][i], Hrtf->coeffs[ridx[3]][i], mu[1]), - mu[2]) * scale; + mu[2]) * gain; coeffStep[i][0] = step * (coeffs[i][0] - left); coeffStep[i][1] = step * (coeffs[i][1] - right); |