Re: [AD] to prefix or not to prefix (part 2)

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


> > and since we are doing such a great change,
> > it could also be a good moment to take a look at all the api as a whole
> > and rename the functions to have coherent naming.
> >
> > If you don't get what I am talking about, please open the Allegro
> > documentation section Text Output and look at the function names: some
> > use underscores to separate words (text_mode), some don't (textout),
> > some do but only at specific places (textprintf_centre). The ordering
> > of parameters is also a nice idea too.
> 
> I think the text output functions should collapse into:
> 
> #define AL_TEXT_ALIGN_LEFT 0
> #define AL_TEXT_ALIGN_CENTRE 1
> #define AL_TEXT_ALIGN_RIGHT 2
> 
> void al_text_print(BITMAP *bmp, const FONT *fnt, int x, int y,
> int align, int color, int bgcolor, const char *string);
> 
> void al_text_printf(BITMAP *bmp, const FONT *fnt, int x, int y,
> int align, int color, int bgcolor, const char *format, ...);
> 
> void al_text_print_justify(..., int x1, int x2, ...);
> 
> void al_text_printf_justify(..., int x1, int x2, ...);

That idea isn't that bad

> Or, if I was evil:
> 
> #define AL_TEXT_ALIGN_LEFT -1
> #define AL_TEXT_ALIGN_CENTRE -2
> #define AL_TEXT_ALIGN_RIGHT -3
> 
> Then we can get rid of the justify functions.  If `align' is >= 0,
> then consider it as x2, otherwise consider it as alignment.

But this one is really evil and obfuscated =)




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