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: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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