Re: [AD] image loading flags

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


On 2011-06-17, Peter Wang <novalazy@xxxxxxxxxx> wrote:
> On 2011-06-16, Elias Pschernig <elias.pschernig@xxxxxxxxxx> wrote:
> > On Thu, 2011-06-16 at 22:31 +1000, Peter Wang wrote:
> > > On 2011-06-16, allefant <info@xxxxxxxxxx> wrote:
> > > > 
> > > > I'd probably just add a flags parameter to all the existing bitmap load
> > > > functions (and yes, it would mean when upgrading your sources from 5.0 to
> > > > 5.2 you'd have to spend 10 minutes going through all the missing parameter
> > > > errors and add the flag).
> > > 
> > > Yes, I forgot about all the format-specific functions.  I don't care
> > > about breaking those.  For al_load_bitmap we could provide a macro:
> > > 
> > >     #define al_load_bitmap(fn)	al_load_bitmap((fn), 0)
> > > 
> > 
> > And as Matthew pointed out, there actually are no such functions - I
> > only was looking at git grep output and counted everything I saw but
> > those are internal so adding flags is not an issue anyway.
> > 
> > Not sure if that macro can actually work... how would you use the
> > al_load_bitmap with 2 parameters then?
> 
> My mistake.  You would need to write (al_load_bitmap)(fn).
> open() uses varargs but I don't know if we really want to do that.

I went ahead with my original plan of adding *flags functions.
Backwards compatibility is detailed in the commit message.

al_load_bitmap is NOT deprecated.  Nobody has to go around adding
trivial "0" parameters to all their al_load_bitmap calls.
More importantly, no #ifdefs are required to support both 5.0 and 5.1
branches (unless, of course, you actually use 5.1-only features).

Peter




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