delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/13/15:35:27

Message-ID: <378B93E4.337AE042@ameritech.net>
Date: Tue, 13 Jul 1999 15:30:44 -0400
From: S Prasad <aangels AT ameritech DOT net>
X-Mailer: Mozilla 4.04 [en]C-AIT (Win95; I)
MIME-Version: 1.0
Newsgroups: comp.os.msdos.djgpp
To: djgpp AT delorie DOT com
Subject: Re: Allegro 16-bit, using palettes and such
References: <3 DOT 0 DOT 32 DOT 19990713151216 DOT 0079f2b0 AT mail DOT colba DOT net>
Reply-To: djgpp AT delorie DOT com

varobert AT colba DOT net wrote:
> 
> Since all your bmps are 256 color, you could use a lookup table, say one of
> 256x256, with one entry per color per shade, with 256 color and 256 shades,
> which you precalculate for each bitmaps (that you load in 256 colors).
> 

First of all, thank you for the response.

It seems like a plausible idea; in fact, this is how I do it in
256-color mode...
But with true-color, I have to cast the pointer when accessing the
Bitmap, like this:

  Color = ( (short*) Bitmap->line[y] ) [x];

But when I do this, the Color becomes a 16-bit value, not a palette
index.  So, using the code I have above, is there a way to do lighting
effects (as you can see, I have no way of implementing the method of a
[256][256] array).

- Raw text -


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