From b4f9f894806fe5fa9adb1ebb481392838cc81e2e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 23 Sep 2011 23:03:59 -0700 Subject: Use float types for the resamplers instead of double --- OpenAL32/Include/alu.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'OpenAL32') diff --git a/OpenAL32/Include/alu.h b/OpenAL32/Include/alu.h index f041ffc5..b6924908 100644 --- a/OpenAL32/Include/alu.h +++ b/OpenAL32/Include/alu.h @@ -162,17 +162,17 @@ static __inline ALint clampi(ALint val, ALint min, ALint max) { return mini(max, maxi(min, val)); } -static __inline ALdouble lerp(ALdouble val1, ALdouble val2, ALdouble mu) +static __inline ALfloat lerp(ALfloat val1, ALfloat val2, ALfloat mu) { return val1 + (val2-val1)*mu; } -static __inline ALdouble cubic(ALdouble val0, ALdouble val1, ALdouble val2, ALdouble val3, ALdouble mu) +static __inline ALfloat cubic(ALfloat val0, ALfloat val1, ALfloat val2, ALfloat val3, ALfloat mu) { - ALdouble mu2 = mu*mu; - ALdouble a0 = -0.5*val0 + 1.5*val1 + -1.5*val2 + 0.5*val3; - ALdouble a1 = val0 + -2.5*val1 + 2.0*val2 + -0.5*val3; - ALdouble a2 = -0.5*val0 + 0.5*val2; - ALdouble a3 = val1; + ALfloat mu2 = mu*mu; + ALfloat a0 = -0.5f*val0 + 1.5f*val1 + -1.5f*val2 + 0.5f*val3; + ALfloat a1 = val0 + -2.5f*val1 + 2.0f*val2 + -0.5f*val3; + ALfloat a2 = -0.5f*val0 + 0.5f*val2; + ALfloat a3 = val1; return a0*mu*mu2 + a1*mu2 + a2*mu + a3; } -- cgit v1.2.3