Re: [AD] Clarifying and revising filesystem API

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


On Thu April 16 2009, Elias Pschernig wrote:
> Peter Hull wrote:
> > I thought the intent was that each add-in provided a function that
> > returned a directory-style AL_FS_ENTRY and then other entries
> > contained within could opened using that as the root.
> > e.g AL_FS_ENTRY* open_zipfile(const char* filename);
> >
> > Regarding chdir, on osx we had a 'magic chdir' which started us off in
> > the resource dir of the application bundle. That was quite useful I
> > thought.
>
> I like that. We will need a function like this then:
>
> AL_FS_ENTRY *al_create_fs_entry_from_archive(AL_FS_ENTRY *archive, char
> const *path)
>
> so e.g.
>
> zip = al_open_zipfile("my.zip")
> picture_file = al_create_fs_entry_from_archive(zip, "mysha.png")
> picture = al_load_bitmap_entry(picture)

That is one possible way to implement zip file reading. Or you can also do a 
mount() or add_search_path() style interface.

> I think I could live with that. However, it means al_load_bitmap() would
> never be able to use anything but the stdio filesystem - which is very
> different from the original intent.

Just use al_load_bitmap_entry instead ;)

-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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