Re: [AD] Allegro 4.3 file location API

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


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.

-- 
Elias Pschernig





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