Re: [AD] Custom packfiles

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


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>




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