From b6b3ca6e6ffab6aa943c760be1290954190ae66e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 29 Sep 2011 03:51:46 -0700 Subject: Use inline assembly for fast float-to-int conversions --- Alc/ALu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Alc/ALu.c') diff --git a/Alc/ALu.c b/Alc/ALu.c index c02b0fdc..19683653 100644 --- a/Alc/ALu.c +++ b/Alc/ALu.c @@ -168,7 +168,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALSource->Params.Step = maxstep<Params.Step = (ALint)(Pitch*FRACTIONONE); + ALSource->Params.Step = fastf2i(Pitch*FRACTIONONE); if(ALSource->Params.Step == 0) ALSource->Params.Step = 1; } @@ -683,7 +683,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALSource->Params.Step = maxstep<Params.Step = (ALint)(Pitch*FRACTIONONE); + ALSource->Params.Step = fastf2i(Pitch*FRACTIONONE); if(ALSource->Params.Step == 0) ALSource->Params.Step = 1; } @@ -814,7 +814,7 @@ static __inline ALshort aluF2S(ALfloat val) { if(val > 1.0f) return 32767; if(val < -1.0f) return -32768; - return (ALint)(val*32767.0f); + return fastf2i(val*32767.0f); } static __inline ALushort aluF2US(ALfloat val) { return aluF2S(val)+32768; } -- cgit v1.2.3