aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-11-23 18:07:19 -0800
committerChris Robinson <[email protected]>2014-11-23 18:07:19 -0800
commit837b38b1664e5d36a652443f7ec6e6dc3e0c5f80 (patch)
tree81f2967e8ec3808e6acbec8cccffdd64d2504cec /Alc
parent5464a5c630d612c10c67bee92fbca4c5adba387b (diff)
Swap delta and step, remove double semicolons
Diffstat (limited to 'Alc')
-rw-r--r--Alc/hrtf.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index 1e371fa4..c3068a09 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -246,8 +246,8 @@ ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat a
}
// Calculate the stepping parameters.
- delta = maxf(floorf(delta*(Hrtf->sampleRate*0.015f) + 0.5f), 1.0f);
- step = 1.0f / delta;
+ step = maxf(floorf(delta*(Hrtf->sampleRate*0.015f) + 0.5f), 1.0f);
+ delta = 1.0f / step;
/* Calculate 4 blending weights for 2D bilinear interpolation. */
blend[0] = (1.0f-mu[0]) * (1.0f-mu[2]);
@@ -269,8 +269,8 @@ ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat a
Hrtf->delays[ridx[2]]*blend[2] + Hrtf->delays[ridx[3]]*blend[3]) *
dirfact + 0.5f) << HRTFDELAY_BITS;
- delayStep[0] = fastf2i(step * (delays[0] - left));
- delayStep[1] = fastf2i(step * (delays[1] - right));
+ delayStep[0] = fastf2i(delta * (delays[0] - left));
+ delayStep[1] = fastf2i(delta * (delays[1] - right));
/* Calculate the sample offsets for the HRIR indices. */
lidx[0] *= Hrtf->irSize;
@@ -298,13 +298,13 @@ ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat a
c = (Hrtf->coeffs[lidx[0]+i]*blend[0] + Hrtf->coeffs[lidx[1]+i]*blend[1] +
Hrtf->coeffs[lidx[2]+i]*blend[2] + Hrtf->coeffs[lidx[3]+i]*blend[3]);
- coeffs[i][0] = lerp(PassthruCoeff, c, dirfact) * gain * (1.0f/32767.0f);;
+ coeffs[i][0] = lerp(PassthruCoeff, c, dirfact) * gain * (1.0f/32767.0f);
c = (Hrtf->coeffs[ridx[0]+i]*blend[0] + Hrtf->coeffs[ridx[1]+i]*blend[1] +
Hrtf->coeffs[ridx[2]+i]*blend[2] + Hrtf->coeffs[ridx[3]+i]*blend[3]);
- coeffs[i][1] = lerp(PassthruCoeff, c, dirfact) * gain * (1.0f/32767.0f);;
+ coeffs[i][1] = lerp(PassthruCoeff, c, dirfact) * gain * (1.0f/32767.0f);
- coeffStep[i][0] = step * (coeffs[i][0] - left);
- coeffStep[i][1] = step * (coeffs[i][1] - right);
+ coeffStep[i][0] = delta * (coeffs[i][0] - left);
+ coeffStep[i][1] = delta * (coeffs[i][1] - right);
for(i = 1;i < Hrtf->irSize;i++)
{
@@ -313,13 +313,13 @@ ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat a
c = (Hrtf->coeffs[lidx[0]+i]*blend[0] + Hrtf->coeffs[lidx[1]+i]*blend[1] +
Hrtf->coeffs[lidx[2]+i]*blend[2] + Hrtf->coeffs[lidx[3]+i]*blend[3]);
- coeffs[i][0] = lerp(0.0f, c, dirfact) * gain * (1.0f/32767.0f);;
+ coeffs[i][0] = lerp(0.0f, c, dirfact) * gain * (1.0f/32767.0f);
c = (Hrtf->coeffs[ridx[0]+i]*blend[0] + Hrtf->coeffs[ridx[1]+i]*blend[1] +
Hrtf->coeffs[ridx[2]+i]*blend[2] + Hrtf->coeffs[ridx[3]+i]*blend[3]);
- coeffs[i][1] = lerp(0.0f, c, dirfact) * gain * (1.0f/32767.0f);;
+ coeffs[i][1] = lerp(0.0f, c, dirfact) * gain * (1.0f/32767.0f);
- coeffStep[i][0] = step * (coeffs[i][0] - left);
- coeffStep[i][1] = step * (coeffs[i][1] - right);
+ coeffStep[i][0] = delta * (coeffs[i][0] - left);
+ coeffStep[i][1] = delta * (coeffs[i][1] - right);
}
}
else
@@ -332,8 +332,8 @@ ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat a
coeffs[i][0] = 0.0f;
coeffs[i][1] = 0.0f;
- coeffStep[i][0] = step * -left;
- coeffStep[i][1] = step * -right;
+ coeffStep[i][0] = delta * -left;
+ coeffStep[i][1] = delta * -right;
}
}
@@ -341,7 +341,7 @@ ALuint GetMovingHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat a
* complete its transition. The mixer will only apply stepping for this
* many samples.
*/
- return fastf2u(delta);
+ return fastf2u(step);
}