Re: [AD] Optimized rotation routine

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


Grzegorz Adam Hankiewicz wrote:
> The part where you said "duplicating API entries" or
> something like that. It's probably not liked by
> anyone here :) Putting the new necessary functions
in
> aintern for addons looks good to me.

OK, I'll add as little as possible but still enough
for add-on libraries, and only to aintern.h.

Btw, the current API is slightly inconsistent since
there is a `rotate_scaled_sprite_flip()' but no
`pivot_scaled_sprite_flip()'. Is
`rotate_scaled_sprite_flip()' really needed, given
that there is a `rotate_scaled_sprite_v_flip()' and
instructions for how to use it for flipping around any
axis?

Should I also include the scanline drawers that remove
the restrictions of the bitmaps so that you can take a
screen bitmap as source and also map between bitmaps
of different color depths? It doesn't add anything to
the API so I think it might not hurt.

Also, what is sensible to do when scale<0 in
`rotate_scaled_sprite()' & co? Draw flipped or don't
draw at all?

> Apart from the speed, it's really
> impressive how smooth you rotate the sprites, even
> after zooming them. 

Actually, it's just a matter of replacing
fcos()/fsin() by cos()/sin(), and never round the
fixed point coordinates to integers...

> Nice work. I wonder if you have any connection to
the
> render routines of "Tetanus on Drugs", which shows a
> nice use of rotations.

No, there's no connection that I know of :-)

Sven

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/



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