www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/06/18/19:54:19

Xref: news2.mv.net comp.os.msdos.djgpp:5141
From: Shawn Hargreaves <slh100 AT york DOT ac DOT uk>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro's Grabber
Date: Tue, 18 Jun 1996 18:07:37 +0100
Organization: The University of York, UK
Lines: 41
Message-ID: <Pine.SGI.3.91.960618173249.174C-100000@tower.york.ac.uk>
NNTP-Posting-Host: tower.york.ac.uk
Mime-Version: 1.0
In-Reply-To: <jpjlohltb8k.fsf@piglet.cam.cornell.edu>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

> I just designed a few nice images to be used as sprites in the
> Allegro library.
> 
> I saved the screen as a 320 x 200 256 colour PCX file.  However,
> upon loading it in to the grabber program, when trying to grab an
> image from the PCX file, the dotted box seems to be on a grid, not
> allowing me to cut my images out properly.  Is there any way to fix
> this?  I looked at the code for the grabber routine, but couldn't
> find a way around this.

I did this to make life easier, sorry if it is having the opposite 
effect :-) My reasoning was that, given a lot of images in a single PCX 
file (eg. I typically draw all the frames of a 32x32 character animation 
in one PCX), without some sort of grid it would be a nightmare trying 
to grab just the right bit of the image. If you position all your frames on 
16x16 grid squares, it's much easier to get the right bit of the bitmap.

If you want to remove the grid, edit grabber.c and in the function:

void grab_bitmap(BITMAP *bmp)
{
   ... stuff deleted ...

   while (!mouse_b) {
      x = mouse_x & 0xFFF0;		<----- delete this line!
      if (x + bmp->w > graphic->w)
	 x = (graphic->w - bmp->w) & 0xFFF0;
      if (x < 0)
	 x = 0;
      y = mouse_y & 0xFFF0;		<----- delete this line!


I suppose this really ought to be configurable...


/*
 *	Shawn Hargreaves.        Why is 'phonetic' spelt with a ph?
 *	Check out Allegro and FED on http://www.york.ac.uk/~slh100/
 */


- Raw text -


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