Re: [AD] Custom packfiles

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


> t's not possible to use the Allegro's packfile compression with
> pack_fopen_vtable(), nor can you use pack_fopen_chunk() on
> vtable-packfiles.  That also explains why there is no load_datafile_pf().

Without looking at the code - what are the problems? I think support
for pack_fopen_chunk should be there - else we can drop the feature of
file chunks completely. At least, i would stop using them if it would
mean my custom file format using them can't be read from memory, for
example.

I'm not sure I understand the state-based issue completely, but I
think it should be like Chris said. A function like load_bitmap should
use load_bitmap_pf internally. And the built-in packfile-vtable should
take no precedence over other vtables. Just like I can change the
packfile password right now, I should be able to change to the .gz
file reader.

If I do e.g.:
PACKFILE *file = pack_fopen("bla");
pack_fwrite(buffer, size, file);
pack_fclose(file);

Then I think it should not prefer the "packfile" vtable over any other
vtables the user might provide. If I understand correctly, the patch
only adds the vtable packfiles additionally, on top of the old
packfiles, which are unmodified. But instead, I think the old packfile
routines should be moved into a vtable as well, and then all packfile
functions should use the current vtable (which by default would be the
one with the old functions). Seems to be much cleaner than to allow
new vtables, but fall back to the old non-vtable ones otherwise.




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