From 7e362249ff57109dcb8dfb4abbade46edea5746c Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 25 Sep 2010 21:13:40 -0700 Subject: Convert shorts so that 0 remains 0 --- Alc/mixer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Alc/mixer.c') diff --git a/Alc/mixer.c b/Alc/mixer.c index 56315097..a5c3d3c1 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -48,7 +48,7 @@ static __inline ALshort aluF2S(ALfloat Value) if(Value <= -1.0f) i = -32768; else if(Value >= 1.0f) i = 32767; - else i = (ALint)(Value*32767.5f - 0.5f); + else i = (ALint)(Value*32767.0f); return ((ALshort)i); } @@ -78,20 +78,20 @@ static __inline ALfloat cos_lerp32(ALfloat val1, ALfloat val2, ALint frac) static __inline ALfloat point16(ALfloat val1, ALfloat val2, ALint frac) { - return (val1+0.5f) / 32767.5f; + return val1 / 32767.0f; (void)val2; (void)frac; } static __inline ALfloat lerp16(ALfloat val1, ALfloat val2, ALint frac) { val1 += ((val2-val1)*(frac * (1.0f/(1<