Re: [AD] Custom packfiles |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On December 31, 2004 12:22 am, Evert Glebbeek wrote:
> On Friday 31 December 2004 06:19, Chris wrote:
> > Mm.. I'm not sure, honestly. I think if we're going to do something like
> > this, it should be as integrated as possible. The PACKFILE_VTABLE is a
> > good idea, but I think it'd be better if the user could supply callbacks
> > that'd effect the normal pack_* routines.
>
> You mean like
> PACKFILE *pack_fopen(const char *filename, const char *mode)
> {
> if (pack_fopen_callback) {
> return pack_fopen_callback(filename, mode);
> }
> ...
> }
> ?
>
> I'm not entirely sure about this. While I like the idea of being able to
> just do something like
>
> > SAMPLE *smp = load_sample((const char*)memptr);
>
> I agree with Peter that I don't really like the idea of a new `state' in
> Allegro. Maybe I'm just not yet used to the idea though.
> One advantage I think this method could have is that it wouldn't be too
> hard to read normal datafiles, and we don't need the load_bmp_pf &al
> functions.
>
The VFS I've been "wroking" on has none. each file is attached to a VFS which
has its own VTABLE in adition to the one it gives to VSTREAMs.
like so:
VFS *stdio = vfs_create_stdio("/start/path");
VSTREAM *foo = vfs_open(stdio, "file.ext", VFS_FLAGS_RO); // or something, you
get the point
the code I have is about half done.. I started working on my TFS filesystem
thing in the middle, then the allegro docs.. too much stuff to work on :o
If allegro can see its way to doing something like the above, that'd probably
be for the best.
--
Thomas Fjellstrom
tfjellstrom@xxxxxxxxxx
http://strangesoft.net