www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/04/21/01:10:32

Date: Sun, 20 Apr 1997 22:51:22 -0600
From: ragingfish AT hotmail DOT com
Subject: Allegro's rotate_sprite()
Newsgroups: comp.os.msdos.djgpp
Message-ID: <861594218.30354@dejanews.com>
Reply-To: ragingfish AT hotmail DOT com
Organization: Deja News Usenet Posting Service
Lines: 46
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019