Mail Archives: djgpp/1997/04/21/01:10:32
I've had a great deal of trouble getting Allegro's rotate_sprite to rotate
anything without clipping off its right and bottom edges. I've
searched through the newsgroup archives & found a few other people
with this problem, but no solutions. Anyone have an idea on how to get
rotate_sprite to cooperate?
Here's a snippet of source that reproduces the problem. It must be used
with a 10x10 or bigger ROTATE.PCX file in the current dir.
//test program for rotating
#include "allegro.h"
main() {
BITMAP *gfx;
BITMAP *tenbyten;
BITMAP *tbtcopy;
PALLETE colors;
allegro_init();
install_keyboard();
set_gfx_mode(GFX_VGA, 320, 200, 0, 0);
gfx = load_pcx("rotate.pcx", colors);
tenbyten=create_bitmap(10,10);
tbtcopy=create_bitmap(10,10);
blit(gfx,tenbyten,0,0,0,0,tenbyten->w,tenbyten->h);
destroy_bitmap(gfx); //save a little mem.
clear(tbtcopy);
rotate_sprite(tbtcopy,tenbyten,0,0,itofix(64));
set_pallete(colors);
draw_sprite(screen,tenbyten,0,0);
draw_sprite(screen,tbtcopy,15,0);
readkey();
set_gfx_mode(GFX_TEXT, 80, 25, 0, 0);
}
Thanks in advance for your help.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
- Raw text -