www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/08/02/12:57:59

Reply-To: <arfa AT clara DOT net>
From: "Arthur" <arfa AT clara DOT net>
To: "DJGPP Mailing List" <djgpp AT delorie DOT com>
Subject: RE: Allegro Bitmap Question 2
Date: Sun, 2 Aug 1998 17:58:12 +0100
Message-ID: <000001bdbe36$bbf5c700$d14e08c3@arthur>
MIME-Version: 1.0
In-Reply-To: <35c48784.1351913@nntp.ix.netcom.com>
Importance: Normal

> Argh!  Ok, so I've learned that an 8 pixel by 8 pixel bitmap takes up
> 64 bytes in memory...great.  Yet for some reason, even if I feed two
> identical tiles into memcmp, it claims that they are different.  Could
> someone please look at the following code and tell me what I'm doing
> wrong?  This is a program for ripping unique 8 by 8 tiles from a pcx
> file.

A BITMAP is a structure containing the various elements of the bitmap (including
width, height, clipping details etc). You need to access the data part of the
structure directly, not the structure itself. The actual picture data is not stored
inside the BITMAP structure itself, just pointers to that data. I think this is
detailed in the Allegro manual?

If you have a BITMAP called fresh_tile, fresh_tile->line[0] will return the address
of the start of raw bitmap data in memory (if I remember correctly).

James Arthur
jaa AT arfa DOT clara DOT net
ICQ#15054819

- Raw text -


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