Re: [AD] Custom packfiles |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: alleg-developers@xxxxxxxxxx
- Subject: Re: [AD] Custom packfiles
- From: Chris <chris.kcat@xxxxxxxxxx>
- Date: Fri, 31 Dec 2004 06:04:16 -0800
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=YUkVoKph83StPV3zMWDYHkP01JjHVPb/9PgpIFNec1ECnQ2TMnEgmwhMsJizRUoaHM3waa8inn74b8wCSY80dRn7oFUZx3x1dp9sn/rRnSQ0xmNoSVFyIZZ11KxL7kUs8l3lt3qegZy/dCPVHTzicnw+tAJMshkaB8GaLXh2dBY=
Evert Glebbeek wrote:
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.
Perhaps. Or maybe I just don't fully understand Peter's method. Looking
back at it, I think I see where he's going, now.. Basically he'd split
up, say, load_wav into load_wav and load_wav_pf. load_wav would open up
the file as a PACKFILE, pass it to load_wav_pf, amd then close the
PACKFILE, right? If so, I think I'm alright with that.. except I'm not
sure I like the naming convention of the vtable methods or functions.
Since the vtable is in a stuct, I don't see any reason to prepend them
with pf_, and I'd think normal Allegro convention for the functions
would be to put the pf_ first, so it'd be pf_load_wav, pf_load_bmp, etc.
Now, as I understand it, the packfile handles would each contain a
pointer to their vtable, right? So functions such as pack_fread,
pack_fseek, etc, would actually run functions from the vtable?
This does bring up one question for me, though.. what would we do about
seeking? pack_fseek doesn't have a 'whence' parameter, and we can't add
one. I think the best thing to do would be to allow negative seeking (at
least pass on negativee values to the vtable function, and let that
worry about failing ot succeeding). Either that, or create a new
function, but I'm not too sure that'd be worth it for this.
</night-time ramblings>