www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/21/13:30:41

Message-ID: <F77915E7F086D31197F4009027CC81C91CCA52@probe-2.as-london.acclaim.com>
From: Shawn Hargreaves <SHargreaves AT acclaimstudios DOT co DOT uk>
To: djgpp AT delorie DOT com
Subject: Re: Fast Palette changing: I DID IT!!
Date: Fri, 21 Jan 2000 17:05:08 -0000
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2650.21)
Reply-To: djgpp AT delorie DOT com

Night Walker writes:
> I succesfully drew a 8bpp bitmap on a 16bpp screen twice, each 
> with a different palette, just changing value to pallete_color.
>
> I replaced in GRAPHICS.C:
> 
> //=====================
> int pallete_color[256];
> //=====================
> with:
> //======================================
> int __nw_palette_array[256];
> int *pallete_color = __nw_palette_array;
[snip]

Good to hear you got it working. But be warned that these changes to
the lib might cause you problems in some cases, as you've broken
support for things like drawing 256 color sprites onto images of
any format other than the current screen mode, and also you'll need
to repeat a similar change in the C drawing code (src/c/cspr.h) if
you ever want to get build your program on non-Intel platforms (eg.
using the X version).

An alternative method that wouldn't require any changes to the
library source would be to just copy your own tables over the
existing palette_array[]. That's slightly less efficient (1024 bytes 
to move) but as long as you draw your sprites in palette order, I'd 
be surprised if you even notice the real world performance difference.
Of course, only trying it will tell for sure...


	Shawn Hargreaves.

- Raw text -


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