From 45a245d7def739e9facf9eddddd1f5410595c74a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 11 Aug 2011 21:43:21 -0700 Subject: Round the HRTF sample step count --- Alc/hrtf.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Alc/hrtf.c') diff --git a/Alc/hrtf.c b/Alc/hrtf.c index a88c37e5..c90a45dc 100644 --- a/Alc/hrtf.c +++ b/Alc/hrtf.c @@ -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 -- cgit v1.2.3