aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2008-02-08 21:03:48 -0800
committerChris Robinson <[email protected]>2008-02-08 21:03:48 -0800
commitec7f20644da31cce18072ed12e06ef3b991008e8 (patch)
treef03fefb8d86e53f972e7ee601c911e207c129b76 /Alc
parent3d5fa917039579171501d4cc224a8c12a3ec6c66 (diff)
Fast float-to-int function is no longer needed
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALu.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/Alc/ALu.c b/Alc/ALu.c
index c88261f9..609faa9d 100644
--- a/Alc/ALu.c
+++ b/Alc/ALu.c
@@ -162,24 +162,12 @@ __inline ALuint aluChannelsFromFormat(ALenum format)
}
}
-static __inline ALint aluF2L(ALfloat Value)
-{
-#if 0
- if(sizeof(ALint) == 4 && sizeof(double) == 8)
- {
- double temp;
- temp = Value + (((65536.0*65536.0*16.0)+(65536.0*65536.0*8.0))*65536.0);
- return *((ALint*)&temp);
- }
-#endif
- return (ALint)Value;
-}
static __inline ALshort aluF2S(ALfloat Value)
{
ALint i;
- i = aluF2L(Value);
+ i = (ALint)Value;
i = __min( 32767, i);
i = __max(-32768, i);
return ((ALshort)i);
@@ -678,7 +666,7 @@ ALvoid aluMixData(ALCcontext *ALContext,ALvoid *buffer,ALsizei size,ALenum forma
WetSample = ALSource->LastWetSample;
//Compute 18.14 fixed point step
- increment = aluF2L(Pitch*(1L<<FRACTIONBITS));
+ increment = (ALint)(Pitch*(ALfloat)(1L<<FRACTIONBITS));
if(increment > (MAX_PITCH<<FRACTIONBITS))
increment = (MAX_PITCH<<FRACTIONBITS);