Re: [AD] COLORCONV_KEEP_TRANS in datafiles + cleanup

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


> > The attached patch makes bitmaps loaded through datafiles
> > respect the COLORCONV_KEEP_TRANS flag, and also makes
> > datafile.c a few pages shorter :)
> 
> So we have been lying to the user for about one year...
> "void set_color_conversion(int mode);
> Specifies how to convert images between the various color depths when
> reading graphics from external bitmap files or datafiles."

Yes.. I remember, when I sent my preliminary COLORCONV_KEEP_TRANS patch
back then, I planned to rewrite the datafile loader as well, but then
when my program was working nicely with COLORCONV_NONE during loading,
and then manual blit() conversion, I forgot about it :)

> But we have a big excuse: this code is a plain duplicate of that in blit.c !
> Moreover, can anyone explain the need for the following lines to me ?
> 
> datafile.c: 132
>        prev_drawmode = _drawing_mode;
>    _drawing_mode = DRAW_MODE_SOLID;
> 
>     [...]
> 
>    _drawing_mode = prev_drawmode;
> 

Heh, I just copied it without thinking, with the patch it's not needed
anymore of course. The old code used a putpixel, which would have been
affected by the current drawing mode (i think).

--
Elias Pschernig



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