Re: [AD] Custom packfiles

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


On Sun, 2005-01-02 at 09:35 +0100, Evert Glebbeek wrote:
> I like the idea behind this, but I don't like the idea of the user having 
> to pass a pointer to a vtable. As far as I'm concerned, the user should 
> have no reason to even be aware that Allegro uses vtables... this is also 
> consistent with the current API.
> I'd prefer something like (don't pay too much attention at the *_ex name 
> I'm using here, it's just for illustrative purposes):
> PACKFILE *pf_tcp = pack_fopen_ex(PF_TCP, "192.168.0.1:1234");
> PACKFILE *pf_gz = pack_fopen_ex(PF_GZ, "blah.txt.gz");

Yes. The problem is just, the vtable entry: pf_fopen(char const *name)
wouldn't be filled in for e.g. memory files. That's why Peter didn't add
one at all. I think, if addons just provide a function to return a
PACKFILE pointer which then can be used with Allegro functions, it is
good enough (until we have a proper virtual filesystem - then VFS addons
would have a way to register with Allegro, and pack_fopen_vfs would
choose the right addon function to use to open the file).

-- 
Elias Pschernig





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