Re: [AD] Clarifying and revising filesystem API |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: "Coordination of admins/developers of the game programming library Allegro" <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] Clarifying and revising filesystem API
- From: Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx>
- Date: Thu, 16 Apr 2009 13:44:08 -0600
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