Re: [AD] Allegro 4.3 file location API

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


On November 16, 2005 07:57 am, Elias Pschernig wrote:
> On Tue, 2005-11-15 at 22:03 -0700, Thomas Fjellstrom wrote:
> > I think thats an excelent idea, extend allegro's current "find resource"
> > crap to search a list of PATHs for various types of resources. I made a
> > simple setup for my Qt4 apps (attached).
>
> I agree, find_allegro_resource has too many parameters :)
>
> > Of course we'll have to have something that fits allegro, and in C, but
> > something allong the same lines would make sense. Except, maybe instead
> > of the ugly ifdefs, we just use a few entries in allegro's system vtable:
> >
> > add_resource_path(type, path)
> > find_resource(type, append)
> >
> > that should be all thats nesesary..
>
> I like it, except, do we need the type parameter? Without it, I would
> have:
>
> add_resource_path(getenv("MY_DATA"))
> add_resource_path(get_file_location(APP_RESOURCES))
> load_bitmap(find_resource("pics/my.png"))
>
> And with type:
>
> add_resource_path("png", getenv("MY_DATA") + "/png")
> add_resource_path("png", get_file_location(APP_RESOURCES) + "/png")
> load_bitmap(find_resource("my.png"))
>
> I prefer the former here.

Except in this case, I didn't explain my self here :) "type" isn't the 
extension, but the "category", sure a person could use it to sort by 
extension if they wanted, but I'd go with having categories for user data, 
system data, shared data, user config, system config, shared config, etc.

> --
> Elias Pschernig

-- 
Thomas Fjellstrom




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