Re: [AD] load_font patch

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


On Sat, 2005-01-22 at 15:55 +0100, Evert Glebbeek wrote:

> I'm for colour and centre! ;)
> To be honest, I never really paid attention to this. I use British spelling 
> without thinking about it, but I'm not sure that I do that consistently 
> with different words. But I agree that we should pick one and be 
> consistent.

Hm, I'm for color and center. But consistent to itself, the Allegro API
as well as the current docs are very inconsistent here..

grep -i colour *._tx | wc -l
27
grep -i color *._tx | wc -l
882

British loses

grep -i behavior *._tx | wc -l
4
grep -i behaviour *._tx | wc -l
37

British wins

grep -i center *._tx | wc -l
34
grep -i centre *._tx | wc -l
34

draw!

Personally, I'm all for using US/international spelling, since it seems
to be what is used mostly in scientific papers, especially in CS related
ones, and that's where a programming library would fall. OTOH, Allegro
originated in GB - but well, that should be no reason.

In any case, color should be used instead of colour in the font
modifications, since all the API functions already use the former.

> > - load_dat_font
> > For maximum clarity, should add something like below, even if it can be
> > deduced from the example (that is, i'm not sure i deduced it right):
> > 
> > The first font (n = 0) must be named FONT_1_DATA, and its (optional)
> > palette must be named FONT_1_COLORS (please rename the COLOUR spelling
> > also here).
> 
> Not nescessarily. They can have either name, but the palette must be 
> *before* the font. FONT_1_COLORS and FONT_1_DATA where the easiest way I 
> could think of to make that so. Ideally, one could do something like FONT 
> and FONT_PALETTE, but then the palette gets sorted *after* the font. Maybe 
> I should just change the way the palette is searched to find it after the 
> FONT instead of before.

Hm, maybe instead of using a pointer to int as last param, use a pointer
to an array of two strings, which name the objects. Like this:

char const *names[] = {"myfont", "mypal"};
load_data_font("my.dat", pal, names);
The objects "myfont" and "mypal" simply are used as font and palette.

Looks simpler to me, than:

int n = 2;
load_data_font("my.dat", pal, &n);
Ok. We know, the 3rd font in the datafile is used as font, and the
palette is the first one before. But when the datafile is modified, then
it must always be checked that n=2 still is right and no other
font/palette went in between.

-- 
Elias Pschernig





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