delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/06/30/04:21:18

From: Nate Eldredge <neldredge AT hmc DOT edu>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Are THESE two statements EQUAL?
Date: 29 Jun 2000 14:50:28 -0700
Organization: Posted via Supernews, http://www.supernews.com
Lines: 42
Sender: nate AT mercury DOT bitbucket
Message-ID: <83u2ec9mxn.fsf@mercury.bitbucket>
References: <5t7klskbj285civf9serk693otnho6t5j0 AT 4ax DOT com> <7qmkls0k46jupmhklc5sqesf999hn7vmjl AT 4ax DOT com> <8F61A359BASINANUNUR AT 132 DOT 236 DOT 56 DOT 8> <mvbllska0qcuhbt0iau00jdn2vp078mon7 AT 4ax DOT com> <8F626A568ASINANUNUR AT 132 DOT 236 DOT 56 DOT 8>
X-Complaints-To: newsabuse AT supernews DOT com
User-Agent: Gnus/5.0802 (Gnus v5.8.2) Emacs/20.5
MIME-Version: 1.0
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Sinan_Unur AT mail DOT com (A. Sinan Unur) writes:

> as for BITMAP and PALLETE, all one should care about is the API
> through which you access these structures (that is the whole point
> why you are provided with a BITMAP data type rather than an array of
> int.) further, BITMAP and PALLETE are logically separate concepts
> regardless of any affinity that might exist between their underlying
> implementations.

And in fact, there isn't any.

typedef struct BITMAP            /* a bitmap structure */
{
   int w, h;                     /* width and height in pixels */
   int clip;                     /* flag if clipping is turned on */
   int cl, cr, ct, cb;           /* clip left, right, top and bottom values */
   GFX_VTABLE *vtable;           /* drawing functions */
   void (*write_bank)();         /* write bank selector, see bank.s */
   void (*read_bank)();          /* read bank selector, see bank.s */
   void *dat;                    /* the memory we allocated for the bitmap */
   int bitmap_id;                /* for identifying sub-bitmaps */
   void *extra;                  /* points to a structure with more info */
   int line_ofs;                 /* line offset (for screen sub-bitmaps) */
   int seg;                      /* bitmap segment */
   unsigned char *line[0];       /* pointers to the start of each line */
} BITMAP;

vs.

typedef struct RGB
{
   unsigned char r, g, b;
   unsigned char filler;
} RGB;
typedef RGB PALLETE[PAL_SIZE];

No similarities whatever.

-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


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