Re: [AD] [patch] new configuration variable: resource_path

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


Grzegorz Adam Hankiewicz:
> Hardcoding the allegro.cfg string would not work if you use
> set_config_file. Maybe grabbing the name from the config system, but
> then you could as well be using several different .cfg files pushing
> and popping. Maybe pushing and popping wouldn't affect you though.

> It would be better if you added something like
> set_allegro_resource_path(int num, const char *path) to Allegro. This
> function would receive the path to look files for and the priority
> as a number from 0 to 7 inclusive.  Setting the same number to NULL
> would remove the path.

> Then find_allegro_resource could loop internally over the non null
> entries of that array somewhere before giving up in addition to
> the ones it already does. Instead of using a static char array,
> use in your implementation a static global 8 position array of
> pointers to strings.  set_allegro_resource_path would then return
> 0 if the internal ustrdup call to store the path didn't have enough
> memory. Return 1 if the string duplication is successful.

> Ok. Maybe 8 custom paths aren't enough. Make that 16.

Ok. I figured my patch was a lousy solution, but then other stuff got in the
way and I forgot about the whole thing. Your solution is much better, of
course. I'll try to implement it and submit a new patch.

--
Daniel Schlyder
http://bitblaze.com/





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