delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/10/28/01:51:23

Message-ID: <3817D3CE.6A9FCBAB@snetch.cpg.com.au>
Date: Thu, 28 Oct 1999 14:40:46 +1000
From: Michael Abbott aka frEk <20014670 AT snetch DOT cpg DOT com DOT au>
Organization: Student of Computer Power Institute
X-Mailer: Mozilla 4.05 [en] (Win95; I)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: Error blitting to bitmap
References: <F77915E7F086D31197F4009027CC81C903CA2A AT ASL-NT-EXCH2>
Reply-To: djgpp AT delorie DOT com

Heya

> Lasse Hassing writes:
> > int main() {
> >   FlukkiB = load_pcx("flukki.pcx", MyPal);
> >   generate_optimized_palette(FlukkiB, MyPal, NULL);
> [snip]
> >  // init Allegro!!
> >  allegro_init();

Actually, looking on the generate_optimized_palette (...), used in the
makes me think of a previous problem I was having.

I write a lot of GameBoy stuff so recently I was trying to write a 4
colour quantizer to convert to the GameBoy's screen. I used
generate_optimized_palette with an array leaving 4 values and it left me
a protection fault. As soon as I changed the number of colours needed to
256 colours it worked. Would there be any reason it's doing this?

I could write a quick set of example code if necessary...

> >  // Set active palete
> >  set_pallete(MyPal);
>
> Not a bug, but there is no reason to use any palette stuff (or to
> bother with the previous palette generation) since your program
> is running in a truecolor mode.

But, select_palette() and unselect_palette() would work fine in this
case right if it was a 256 colour bitmap being loaded with
set_color_conversion (COLORCONV_NONE); ?

- Michael

- Raw text -


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