Re: [AD] Allegro, config file routines addition

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


On Sat, Jun 24, 2000 at 06:56:30PM +0200, Grzegorz Adam Hankiewicz wrote:
> 3) I generally dislike boolean variables, they have always existed with 0
>    being false and any other value meaning true. Just look what the
>    function returns. This is just a personal opinion...
> 4) And the thing which most worries me is that there's a multilingual
>    problem with such a function, you have to stick to english texts, which
>    is bad now that Allegro supports UTF-8 easily and customizable
>    multilanguage text strings via config routines or custom ones.
...
> But, then there's a conflict itself in supporting multilanguage boolean
> texts, and that is, a game configured for english will write it's
> config/ini file, but if I change it to use spanish, the config file won't
> work at all, returning all variables as false given the last atoi.

This has become relevant for me, because I just finished
converting one of Michael Bukin's patches to use config
variables instead of environment variables.  In doing so, I
noticed another boolean-style config variable used by the DGA
code.  I think we need to standardise on how Allegro itself
stores booleans, at least.  I'd be happy with integers,
personally, but the existing variable (dga_mouse) was a string
with the first character checked against `n', `N' and `0'.
That's an OK system, but as you say, it's not very
international. :)

The `dga_mouse' variable is new since 3.9.32 anyway, so that can
easily be changed to use plain ints.  But Allegro does have
other config variables which are stored as strings -- the
`emulate_three' mouse option, for instance.  It also has
booleans stored as ints -- `flip_pan' and `sound_stereo'.

I think we shouldn't break backwards compatibility, so
`emulate_three' must continue to recognise "yes" and "no", but
the documentation should change to say it is actually an
integer.  It already recognises integer values, anyway, just not
in a particularly boolean way (1 is true, everything else is
false!).  All the other booleans I've found are either ints
already or are new enough that they can be changed.

Does anyone have any objections to this?

George

-- 
Random project update:
22/06/2000: AllegroGL documentation:  http://allegrogl.sourceforge.net/
        See under `Documentation' for the AllegroGL Reference Manual in
	various formats.



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