Mail Archives: djgpp/2000/01/21/13:30:41
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 -