Re: [AD] Memfile support

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


Lennart Steinke wrote:
I'm currently working on a patch that will allow the packfile functions to work on a normal memory chunk by calling:

PACKFILE* pack_open_mem(void *data, int size);

Sounds interesting to me. though you may want to change that to:

PACKFILE* pack_open_mem(void *data, char *mode, int size);
so that you can specifiy reading/writing, packed/non-packed, binary/ascii, etc. Though it means you'd have to take extra caution. Not sure how the writing would work out, either. Could always disable that. Though being able to open and read a packed packfile in memory sounds pretty cool.

PACKFILE *f = pack_fopen("foo.dat", "rb");
pack_fseek(f, 1024);
bmp = pack_load_bitmap(f, NULL);

That sounds pretty intriguing, actually. Compressed packfile with .bmps stored in it, along with other things. A tileset, background music, and tilemap all in one (packed) file:
PACKFILE *f = pack_fopen("foo.dat", "rb");
bmp = pack_load_bitmap(f, NULL);
mid = pack_load_midi(f);
load_area_tilemap(f);

Sorta like a globally compressed datafile, but without the datafile overhead. Useful for custom file formats.

- Kitty Cat




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