[AD] fixtoi optimization

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


This may not be a revolution for Allegro, but
replacing

(x >> 16) + ((x & 0x8000) >> 15)

by

((x + 0x8000) >> 16 )

in the fixtoi function improves its speed by 20-40%.

The two implementations seem to give always the same
result (hopefully!)

fixtoi is sometimes used in inner loop of functions
like rotated_scaled_sprite, so this may interest you.

___________________________________________________________
Do You Yahoo!?
Achetez, vendez! À votre prix! Sur http://encheres.yahoo.fr



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/