<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Grabber and png</title>
		<link>http://www.allegro.cc/forums/view/609490</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Wed, 15 Feb 2012 15:59:19 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi, is there a way to grab png images to a datafile or do I have to convert all of my images to targa first?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (APrince)</author>
		<pubDate>Tue, 07 Feb 2012 16:48:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You can add files of any type, even if they&#39;re not one that Allegro supports natively (such as PNG).</p><p>Just select &quot;Other&quot; as the type of object you want, and then grab as you would normally.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Tue, 07 Feb 2012 17:53:44 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yes. You won&#39;t see the image in Grabber, but that&#39;s not important, is it? And if it is, I guess you can rebuild Grabber and add png as a known image format. Grabber won&#39;t convert it to a BITMAP* object. It comes as a png chunk into your program&#39;s DATAFILE* object. And you use load_memory_png() to create the BITMAP* object.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Johan Halmén)</author>
		<pubDate>Tue, 07 Feb 2012 18:35:43 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank&#39;s - I&#39;ll try that.</p><p>//edit: This load_memory_png is a function from loadpng and I have to download that separately, i take it... Right?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (APrince)</author>
		<pubDate>Wed, 08 Feb 2012 19:41:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If you&#39;re using loadpng, look at the exdata.c example for the recommended way of loading a PNG from a datafile.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Wed, 08 Feb 2012 20:59:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>loadpng comes with Allegro 4.4, you just have to include its headers and link to it like any other library.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Edgar Reynaldo)</author>
		<pubDate>Thu, 09 Feb 2012 00:22:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>&quot;loadpng comes with Allegro 4.4, you just have to include its headers and link to it like any other library.&quot;</p><p>It seemed strange to me, because I didn&#39;t have to do anything extra to use png images (AL 5.0.1).</p><p>Thank&#39;s very much, I&#39;m going to try that.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (APrince)</author>
		<pubDate>Thu, 09 Feb 2012 15:27:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/609490/946961#target">APrince</a> said:</div><div class="quote"><p>It seemed strange to me, because I didn&#39;t have to do anything extra to use png images (AL 5.0.1).</p></div></div><p>Yeah, allegro 5 is a new API and library. It&#39;s image loader addon includes PNG support.</p><p>Allegro 4.4 has a png loader addon included, 4.2 and before do not include a png loader addon, but there is an older version of loadpng available for them.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 09 Feb 2012 15:50:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank&#39;s.</p><p>I have two more questions...</p><p>1) I cannot find loadpng in Allegro 5. In Allegro 4.4 it is in Allegro/addons but I really don&#39;t know, where to find it in A5.</p><p>2) I need to grab about 100 png images... Is there a way to select them somehow all at once, or do I have to do that manually? The problems is I don&#39;t really understand the grabber and documentation doesn&#39;t help much. What I do, is that I select Object-&gt;new-&gt;other then fill in type as PNG and whatever name and then Object-&gt;grab and select the corresponding file. I can&#39;t imagine doing this for a hundred files...</p><p>Thank&#39;s a lot.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (APrince)</author>
		<pubDate>Fri, 10 Feb 2012 17:50:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title"><a href="http://www.allegro.cc/forums/thread/609490/947052#target">APrince</a> said:</div><div class="quote"><p> 1) I cannot find loadpng in Allegro 5. In Allegro 4.4 it is in Allegro/addons but I really don&#39;t know, where to find it in A5.</p></div></div><p>A5 does not use loadpng. Instead, you use the <a href="http://www.allegro.cc/manual/5/image.html">image IO addon routines</a> in conjunction with <span class="source-code"><a href="http://www.allegro.cc/manual/al_load_bitmap"><span class="a">al_load_bitmap</span></a></span> or <span class="source-code"><a href="http://www.allegro.cc/manual/al_load_bitmap_f"><span class="a">al_load_bitmap_f</span></a></span></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p> 2) I need to grab about 100 png images... Is there a way to select them somehow all at once, or do I have to do that manually? The problems is I don&#39;t really understand the grabber and documentation doesn&#39;t help much. What I do, is that I select Object-&gt;new-&gt;other then fill in type as PNG and whatever name and then Object-&gt;grab and select the corresponding file. I can&#39;t imagine doing this for a hundred files...</p></div></div><p>The datafile format (and therefore the grabber tool) are not supported by A5.  If you want to use the grabber, you will need to write your own routines for extracting the data from them.</p><p>But to answer the question anyway, to add multiple files like that, don&#39;t use the grabber, use the command line dat utility instead.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Fri, 10 Feb 2012 19:03:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Does anybody actually want to use Allegro 4 DATAFILEs with Allegro 5, or is everyone comfortable with PhysicsFS&#39;s archive formats? (Personally I like a PAK/ZIP mixture.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Luiji99)</author>
		<pubDate>Sat, 11 Feb 2012 10:41:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well now I&#39;m really confused... If I get this right, I suppose that everything to this point was irrelevant, because somehow everyone assumed I use Allegro 4. Now that there&#39;s the knowledge I use Allegro 5, everyrhing changes... Right? I don&#39;t really want to bother you, if there is any tutorial on how to solve this thing I would really appreciate it...</p><p>Where can I get the tool you mentioned (command line dat utility)? I cannot find it amongst the Allegro utilities.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (APrince)</author>
		<pubDate>Mon, 13 Feb 2012 15:57:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s the word &quot;datafile&quot; that everybody understands as the specific file format that was supported in Allegro 4.<br />Allegro 5 cannot read this format (and even the structs stored inside: BITMAP, RLE_SPRITE etc. are different from Allegro 5&#39;s AL_BITMAP)<br />so you shouldn&#39;t bother anymore with the grabber.exe and dat.exe, they are all for Allegro 4.</p><p>In Allegro 5, if you want to store all resources in a single file, the handy way is to make a zip archive (using any standard tools, the zip can even use sub-directories) and in your program, use the <a href="http://www.allegro.cc/manual/5/physfs.html">PhysicsFS</a> addon to access the individual items.<br />The idea is that you call:
</p><div class="source-code snippet"><div class="inner"><pre>PHYSFS_init<span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
PHYSFS_addToSearchPath<span class="k2">(</span><span class="s">"mydata.zip"</span>, <span class="n">1</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/al_set_physfs_file_interface"><span class="a">al_set_physfs_file_interface</span></a><span class="k2">(</span><span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
and then any call to <span class="source-code"><a href="http://www.allegro.cc/manual/al_load_bitmap"><span class="a">al_load_bitmap</span></a><span class="k2">(</span><span class="k2">)</span></span> will read items in the zip.</p><p>See the complete example ex_physfs.c in the distribution.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Audric)</author>
		<pubDate>Mon, 13 Feb 2012 16:38:12 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>It&#39;s not really about storing everything in one file. The point is to prevent a &quot;common user&quot; from overriding those images with something else and thus defacing the program... Common zip will not solve this (niether datafile would, I suppose, but it would surely make it much more difficult). Maybe if the zip archive was password protected...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (APrince)</author>
		<pubDate>Mon, 13 Feb 2012 18:41:46 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Or just don&#39;t use the .zip file ending. call it .dat or something. Most people would be confused. A lot of games do that.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Mon, 13 Feb 2012 22:49:36 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank&#39;s a lot, that may work... :-)</p><p>//edit: Thank&#39;s to all of you, it works perfectly...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (APrince)</author>
		<pubDate>Wed, 15 Feb 2012 15:59:19 +0000</pubDate>
	</item>
</rss>
