Re: [AD] palette change for load_bitmap

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


> Ok, in this version, there's no extra parameter.

Fine. But I think we should properly document the behaviour of 
_fixup_loaded_bitmap in the source file, something like:

/* _fixup_loaded_bitmap:
 *  Helper function for adjusting the color depth of a loaded image.
 *  Converts the bitmap BMP to the color depth BPP. If BMP is a 8-bit
 *  bitmap, PAL must be the palette attached to the bitmap. If BPP is
 *  equal to 8, the conversion is performed either by building a palette
 *  optimized for the bitmap if PAL is not NULL (in which case PAL gets
 *  filled in with this palette) or by using the current palette if PAL
 *  is NULL. In any other cases, PAL is unused.
 */

And I've now realized that the patch changes the behaviour of load_bitmap(), 
load_bmp(), load_pcx() and load_tga() when loading truecolor images, the 
color depth is 8 and PAL is NULL. That's ok, since passing NULL as the PAL 
argument was never documented. But it must now be documented.

> > - can't we get rid of the 332 palette too ?
>
> It's removed now when no palette argument is given. The other case -
> returning a palette although a true-color bitmap is returned - is
> probably useless, but I see no reason to change this behavior now.

I agree with you, but it looks like your patch doesn't: when the destination 
color depth is not the same as the source color depth, but both are higher 
than 8-bit, the palette is unconditionally not set, isn't it ?

-- 
Eric Botcazou



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