<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>4.2.0 datafiles</title>
		<link>http://www.allegro.cc/forums/view/588984</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sat, 09 Dec 2006 21:58:23 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I have stored allegro commpressed file into a datafile as a binary data:<br />dat game.bin -a 1.map -t BIN -k</p><p>when I call:
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/PACKFILE" target="_blank"><span class="a">PACKFILE</span></a> <span class="k3">*</span>f<span class="k3">=</span><a href="http://www.allegro.cc/manual/pack_fopen" target="_blank"><span class="a">pack_fopen</span></a><span class="k2">(</span>data.bin#<span class="n">1</span>.map,<span class="s">"rp"</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

I dont get the original data(before compression), but the compressed data from the 1.map. </p><p>If I only load 1.map, which is not in the datafile, this works nicely:
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/PACKFILE" target="_blank"><span class="a">PACKFILE</span></a> <span class="k3">*</span>f<span class="k3">=</span><a href="http://www.allegro.cc/manual/pack_fopen" target="_blank"><span class="a">pack_fopen</span></a><span class="k2">(</span><span class="n">1</span>.map,<span class="s">"rp"</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>

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?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (clovekx)</author>
		<pubDate>Sat, 09 Dec 2006 21:39:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What you describe looks odd and it might be a bug, I&#39;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).</p><p>Either way, it should work if you include the uncompressed data in a datafile and then compress the datafile.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sat, 09 Dec 2006 21:45:34 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s a bug then. It looks to me that pack_fopen() ignores the &quot;p&quot; flag in the second parameter when the file is in a datafile.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (clovekx)</author>
		<pubDate>Sat, 09 Dec 2006 21:58:23 +0000</pubDate>
	</item>
</rss>
