diff options
author | Chris Robinson <chris.kcat@gmail.com> | 2011-08-11 21:43:21 -0700 |
---|---|---|
committer | Chris Robinson <chris.kcat@gmail.com> | 2011-08-11 21:43:21 -0700 |
commit | 45a245d7def739e9facf9eddddd1f5410595c74a (patch) | |
tree | 0e8323590c7ad9d41bf4e3ec827c5cc48cac0b17 /Alc | |
parent | 1e60481040c504c17c267b1faab6f32d748b5990 (diff) |
Round the HRTF sample step count
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/hrtf.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -191,12 +191,12 @@ void GetLerpedHrtfCoeffs(ALfloat elevation, ALfloat azimuth, ALfloat gain, ALflo // given delta factor between 0.0 and 1.0. ALuint GetMovingHrtfCoeffs(ALfloat elevation, ALfloat azimuth, ALfloat gain, ALfloat delta, ALint counter, ALfloat (*coeffs)[2], ALuint *delays, ALfloat (*coeffStep)[2], ALint *delayStep) { - ALfloat step; ALuint evidx[2], azidx[2]; - ALfloat mu[3]; ALuint lidx[4], ridx[4]; - ALuint i; ALfloat left, right; + ALfloat mu[3]; + ALfloat step; + ALuint i; // Claculate elevation indices and interpolation factor. CalcEvIndices(elevation, evidx, &mu[2]); @@ -224,7 +224,8 @@ ALuint GetMovingHrtfCoeffs(ALfloat elevation, ALfloat azimuth, ALfloat gain, ALf ridx[3] = evOffset[evidx[1]] + ((azCount[evidx[1]]-azidx[1]) % azCount[evidx[1]]); // Calculate the stepping parameters. - delta = __max(0.015f * delta * Hrtf.sampleRate, 1.0f); + delta = floor(delta*(Hrtf.sampleRate*0.015f) + 0.5); + delta = __max(delta, 1.0f); step = 1.0f / delta; // Calculate the normalized and attenuated target HRIR coefficients using |