diff options
author | Chris Robinson <[email protected]> | 2011-09-29 03:51:46 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-09-29 03:51:46 -0700 |
commit | b6b3ca6e6ffab6aa943c760be1290954190ae66e (patch) | |
tree | c5281372ec06e7995aa412266205b62d596d1b49 /Alc/ALu.c | |
parent | 53572da7de8d2cf22ed996dec4b992ca378f371c (diff) |
Use inline assembly for fast float-to-int conversions
Diffstat (limited to 'Alc/ALu.c')
-rw-r--r-- | Alc/ALu.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -168,7 +168,7 @@ ALvoid CalcNonAttnSourceParams(ALsource *ALSource, const ALCcontext *ALContext) ALSource->Params.Step = maxstep<<FRACTIONBITS; else { - ALSource->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<<FRACTIONBITS; else { - ALSource->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; } |