delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/01/21/11:18:46

Message-ID: <388863A7.BC1629C8@tiscalinet.it>
Date: Fri, 21 Jan 2000 14:48:23 +0100
From: Night Walker <night DOT walker AT tiscalinet DOT it>
X-Mailer: Mozilla 4.7 [en] (Win95; I)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Fast Palette changing: I DID IT!!
Reply-To: djgpp AT delorie DOT com

I did it!

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;
//======================================

and in SPRITE16.S, SPRITE24.S and SPRITE32.S i deleted the "$" before
_pallete_color.
Then, i recompiled ALLEGRO.

In my program, i created 2 int arrays, and filled them with
set_palette().
I made pallete_color to point the first array, and drew the bitmap.
I made pallete_color to point the second array, and drew again the
bitmap near the first.
The effect I got was the same obtained with calling set_palette() before
drawing the bitmap each time.

Thanx to Shawn Hargreaves and Damian Yerrick for the feedback.
Night Walker.


- Raw text -


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