Re: [AD] palette color conversion

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Ok, looking a bit closer at the source revealed my guess was right.
Attached is a quick fix, it leaves most things untouched, it just
checks if the colordepth is 8 and the pal parameter to load_bmp is
NULL. If so, the _fixup_loaded_bitmap function doesn't generate an
optimized palette (which is never returned), but uses the
_current_palette instead. If this is a good idea, it should probably
go to the load_tga,load_pcx.. as well.
The advantage of my patch is, i can now use all my old truecolor
programs on 8bit gfx cards, without any change.
But i discovered that the whole palette conversion stuff isn't written
particularly well, and some code gets doubled between the readbmp.c
and the datafile.c - so maybe it would be better to enhance the
_fixup_loaded_bitmap function, and remove the doubled code from the
bmp.c, tga.c.. and datafile.c ?

Elias Pschernig



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/