|
I'm haveing trouble with 256-color bitmaps. |
FalseMasterJ
Member #6,642
December 2005
|
First the game is set up to be at any color depth. Now I want to be able to use the palette in the datafile with my 256-color bitmaps (also in the datafile) by bliting it on another bitmap whose color depth may not be 256-colors. How can I do all of this?
|
Tobias Dammers
Member #2,604
August 2002
|
Generally, allegro was not intended to mix bitmaps of different color depths at all. That said: DATAFILE* dat; load_datafile(dat, "data.dat"); set_palette((RGB*)dat[PALETTE_PCX].dat); Assuming that PALETTE_PCX is defined in the (properly included) datafile header and that the corresponding datafile entry is in fact a palette. If you are in a >8bpp mode, then you need to set the proper color conversion. The easiest (and least error prone) procedure is this: Alternatively, you can: --- |
FalseMasterJ
Member #6,642
December 2005
|
Thank you Tobias Dammers. This was a problem that stumped me in almost every allegro game I made. since I could figure it out I just make the whole game one or the other.
|
|