diff options
author | Chris Robinson <[email protected]> | 2011-09-23 23:03:59 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-23 23:03:59 -0700 |
commit | b4f9f894806fe5fa9adb1ebb481392838cc81e2e (patch) | |
tree | bc19f4ceb87a32dad496adb59640e214e1b1e44f /OpenAL32 | |
parent | a9b6b284c0ab4c098510198c78b759bf0eac483e (diff) |
Use float types for the resamplers instead of double
Diffstat (limited to 'OpenAL32')
-rw-r--r-- | OpenAL32/Include/alu.h | 14 |
1 files changed, 7 insertions, 7 deletions
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; } |