Re: [AD] search path?

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


On Thu April 16 2009, Thomas Fjellstrom wrote:
> On Thu April 16 2009, Peter Wang wrote:
> > On 2009-04-15, Thomas Fjellstrom <tfjellstrom@xxxxxxxxxx> wrote:
> > > On Wed April 15 2009, Elias Pschernig wrote:
> > > > Thomas Fjellstrom wrote:
> > > > > My original code had a couple functions to set and get individual
> > > > > vtable functions. The enum had items for each function.
> > > > >
> > > > > al_fs_set_hook(ALLEGRO_FSHOOK_FWRITE, _al_fs_stdio_fwrite); // blah
> > > >
> > > > Ah, that wouldn't work well in a multi-threaded environment. I want
> > > > to be able for something to spawn a thread, and that thread then
> > > > opens a zip file and loads the data in it. The main thread should not
> > > > be affected by it.
> > >
> > > Why would you change the fshooks for a single thread? Any zip
> > > supporting fshook addon will have to know about the normal filesystem.
> > > so setting it once at the beginning (init_zip_addon()) will do just
> > > fine.
> >
> > How would you do the following?  Assume a normal single-threaded program.
> >
> > - I want to load my game resources from .zip files.
> >
> > - I'm using a 3rd party GUI library which has skins in plain PNG files.
> >   It uses al_load_bitmap().
> >
> > - I want read/write config files in memory buffers, as I will be
> > transferring them to/from a game server over the network. (Allegro will
> > not be handling the networking part, just the config files.)
>
> Setup the zip file addon, and use as normal. You can also use the memfile
> addon (since it doesn't mess with the global vtable) at the same time for
> the memory buffers.
>
> Any given global fshook addon should almost never make normal file system
> access not work. Especially considering it'll need to access the file

Gah, sent that off by accident.. Oh well. You get the jist.

> > Peter
> >
> >
> > -------------------------------------------------------------------------
> >-- --- Stay on top of everything new and different, both inside and
> > around Java (TM) technology - register by April 22, and save
> > $200 on the JavaOne (SM) conference, June 2-5, 2009, San Francisco.
> > 300 plus technical and hands-on sessions. Register today.
> > Use priority code J9JMT32. http://p.sf.net/sfu/p


-- 
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx




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