diff options
-rw-r--r-- | Alc/mixer.c | 8 |
1 files changed, 4 insertions, 4 deletions
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<<FRACTIONBITS)))); - return (val1+0.5f) / 32767.5f; + return val1 / 32767.0f; } static __inline ALfloat cos_lerp16(ALfloat val1, ALfloat val2, ALint frac) { ALfloat mult = (1.0f-cos(frac * (1.0f/(1<<FRACTIONBITS)) * M_PI)) * 0.5f; val1 += ((val2-val1)*mult); - return (val1+0.5f) / 32767.5f; + return val1 / 32767.0f; } |