Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » 4.2.0 datafiles

This thread is locked; no one can reply to it. rss feed Print
4.2.0 datafiles
clovekx
Member #3,479
April 2003
avatar

I have stored allegro commpressed file into a datafile as a binary data:
dat game.bin -a 1.map -t BIN -k

when I call:

PACKFILE *f=pack_fopen(data.bin#1.map,"rp");

I dont get the original data(before compression), but the compressed data from the 1.map.

If I only load 1.map, which is not in the datafile, this works nicely:

PACKFILE *f=pack_fopen(1.map,"rp");

Am I doing something bad? How to store the compressed binary data into datafile to be able to read them the same way as they are not in datafile?

Evert
Member #794
November 2000
avatar

What you describe looks odd and it might be a bug, I'm not sure. I have a feeling it probably is (Allegro seems not to pick up the compressed flag for the embedded object, but take it from the parent datafile - I think one could argue that this is the expected behavior, but I think one could also argue that it is a bug).

Either way, it should work if you include the uncompressed data in a datafile and then compress the datafile.

clovekx
Member #3,479
April 2003
avatar

It's a bug then. It looks to me that pack_fopen() ignores the "p" flag in the second parameter when the file is in a datafile.

Go to: