diff options
author | Chris Robinson <[email protected]> | 2008-02-08 21:03:48 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2008-02-08 21:03:48 -0800 |
commit | ec7f20644da31cce18072ed12e06ef3b991008e8 (patch) | |
tree | f03fefb8d86e53f972e7ee601c911e207c129b76 | |
parent | 3d5fa917039579171501d4cc224a8c12a3ec6c66 (diff) |
Fast float-to-int function is no longer needed
-rw-r--r-- | Alc/ALu.c | 16 |
1 files changed, 2 insertions, 14 deletions
@@ -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); |