delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/07/13/16:52:17

From: varobert AT colba DOT net
Message-Id: <3.0.32.19990713165002.007a7590@mail.colba.net>
X-Sender: varobert AT mail DOT colba DOT net
X-Mailer: Windows Eudora Pro Version 3.0 (32)
Date: Tue, 13 Jul 1999 16:50:26 -0400
To: djgpp AT delorie DOT com
Subject: Re: Allegro 16-bit, using palettes and such
Mime-Version: 1.0
Reply-To: djgpp AT delorie DOT com

Then I suggest you use a 256-color bitmap as a temporary buffer, then you
can do all your calculations and spit out a 16-bit color bitmap...

At 03:30 PM 7/13/99 -0400, you wrote:
>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