Mail Archives: djgpp/1996/11/10/01:42:06
Question:
Has anyone else noticed that Allegro has a built-in limit on the size
of the bitmap to be rotated by rotate_sprite?
Specifically, the maximum size of a sprite is 181x181, else only the 4th
quadrant (the lower-right) is displayed, though if you want the whole
bitmap to be visible (without the corners clipped off) you must use a
120x120.
Anyways, this limit is NOT DIRECTLY IMPOSED BY ALLEGRO, but by the way
Allegro does math (with the 16.16 fixed system), the numbers are just too
big for the system. Here's the math:
Distance (Use good old Pythagoras' theorum):
A*A+B*B=C*C
182 (One above the max size) * 182+182*182=66248, largest number with 16
bits is 65535.
I don't know what effect this has (I suspect something with the fsqrt
function not liking neg's, since it wraps around), but I know that only
the 4th quadrant will be displayed.
Has anyone written a fixed rotate routine that doesn't have this
limitation?
- Raw text -