Re: [AD] set_config_file jumping around on OS X bundles

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


On Sun, 2005-08-21 at 00:31 -0500, Matthew Leverton wrote:
> On OS X, it autodetects whether or not your application sits in an app
> bundle. If it does, then it (by default) looks inside the app bundle
> for data & config files.
> 
> I just noticed tonight that if you do this:
> 
> set_config_file('game.ini')
> allegro_init();
> 
> it doesn't detect that you are in an app bundle when loading the ini file.
> 
> The worst part is that when the application exits, then the files get
> saved *inside* the app bundle. So basically, it reads from an ini file
> that sits outside the app bundle, but writes to one inside.
> 
> Ideally, setting the config file name before allegro_init() should
> still be able to detect whether or not you are in an app bundle. If
> that cannot be done for some reason, then I don't think that by
> default Allegro should write the file to a different location than it
> read it from.
> 
> For my purposes, I just moved the set_config_file() option after the
> allegro_init() to work around it.

Yes, I think we should update the docs and disallow it before
allegro_init. At some point it was changed to allow it before, but from
my experience, that also is broken under linux:

   /* Special case when allegro_init has not been called yet. */
   if (!system_driver) {
      set_config(config, NULL, 0, savefile);
      return;
   }

The above was added to allow it before allegro_init - but I don't see
the purpose.. it completely ignores the filename you pass and sets an
empty config. So, it never does what you want. Or maybe I misunderstand?

-- 
Elias Pschernig





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