<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Bitmap loses data when transferred into Allegro datafile?</title>
		<link>http://www.allegro.cc/forums/view/589559</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 14 Jan 2007 17:03:00 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hello.</p><p>I was having some problems with a game I was making after I tried to implement Allegro datafiles instead of separate files for all the sprites and sounds. I then made a test program to test and see if everything was being transferred fine. The bitmaps with one single frame/sprite were transferred fine and retained all data. However, I have two bitmaps that have several frames of a tank in them and it seems that when they are transferred into the datafile, it just becomes all black and that is what is copied to the datafile. Can anybody help me?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (XcronZ3X)</author>
		<pubDate>Sun, 14 Jan 2007 05:00:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;m assuming those bitmaps were gifs and the datafile utility doesn&#39;t support gifs natively, though it will still import them as binary data.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Sun, 14 Jan 2007 05:30:00 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Actually, the bitmaps were really BMP files...that&#39;s why almost all of them worked. Allegro datafiles support the BMP filetype. But for some reason the two tank BMPs that have several frames right next to each other turned into just a black strip when transferred into the datafile. It&#39;s very strange. All the other bitmaps work, but these two don&#39;t...</p><p>I can also import them into the datafile through binary data? Maybe I should try that...to see if the tank bitmaps will retain the data..if that&#39;s an alternative method.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (XcronZ3X)</author>
		<pubDate>Sun, 14 Jan 2007 05:58:25 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I probably can&#39;t help you, but to those who are very familiar with your topic... you  might want to supply them with some source and the images.  But that is just a suggestion.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Matthew Dalrymple)</author>
		<pubDate>Sun, 14 Jan 2007 06:00:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What is the bit depth of the tank images?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Steve Terry)</author>
		<pubDate>Sun, 14 Jan 2007 06:10:50 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Good idea, I had actually not thought of that. I think this will be very helpful for any willing to help me out. Ok..so! Anything like explode.bmp (attached), where there is but a single frame of the object, is transferred fine and by using my test program..I can retrieve and save the exact same thing from the data file. Now, for something like tank1.bmp (attached), with multiple frames and such, it turns into tank1saved.bmp (attached) after I run my test program. This is the code that I basically use for the test program:</p><p>     allegro_init();     <br />     install_keyboard();<br />     set_color_depth(16);<br />     set_gfx_mode(MODE, WIDTH, HEIGHT, 0, 0);<br />     text_mode(-1);<br />     set_color_conversion(16);<br />     data = load_datafile(&quot;test.dat&quot;);<br />     sprite = (BITMAP *)data[TANK1_BMP].dat; <br />     //sprite = (BITMAP *) load_datafile_object(&quot;test.dat&quot;, &quot;EXPLODE_BMP&quot;);<br />     //sprite = load_bitmap(&quot;tank2.bmp&quot;, NULL);<br />     save_bitmap(&quot;tank1saved.bmp&quot;, sprite, NULL); <br />     //while (!key[KEY_ESC]) {}<br />     //unload_datafile_object(sprite);<br />     unload_datafile(data);<br />     allegro_exit();</p><p>Oh, and the color depth of the tanks and all the sprites/images that I use is 16-bit. Dunno..just a default thing I guess...I&#39;m only learning with a book so..heh..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (XcronZ3X)</author>
		<pubDate>Sun, 14 Jan 2007 06:13:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Can you also attach the smallest .dat file that the problem occurs with?</p><p>edit: I Just noticed that tank1.bmp is a 8bit image, but you have no palette information. The rest of the images you supplied are 24bit.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Sun, 14 Jan 2007 06:18:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Mmmmmmmm...8-bit....wonder when I did that..</p><p>Ahh..the datafile...ok I&#39;ve attached the only one I use..with compression, it&#39;s small enough.</p><p>Well if the others are 24-bit and they are transferred fine...then I...meh...I dunno..maybe the 8-bit just doesn&#39;t work with my 16-bit setting...probably should do a conversion to 8-bit at the beginning of the test program or something.....hmmmm...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (XcronZ3X)</author>
		<pubDate>Sun, 14 Jan 2007 06:24:05 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Ahh..the datafile...ok I&#39;ve attached the only one I use..with compression, it&#39;s small enough.
</p></div></div><p>

No, you haven&#39;t. But just try converting the 8bit images to 24bit (or even better 16bit, since it&#39;s the depth you set the screen to). That should fix the problem.</p><p>edit: hey, you cheated. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Sun, 14 Jan 2007 06:29:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Sheesh..well, I&#39;m not too sure how I can change the depth of those bitmaps..</p><p>you cheat more than I do =P, my computer takes 5 mins to load each of these pages..
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (XcronZ3X)</author>
		<pubDate>Sun, 14 Jan 2007 06:31:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Well, if you&#39;re using windows, just load the 8bit images into Paint and save them as 24bit bitmaps.</p><p>edit: I&#39;m not sure how you managed to do what you did, but I saved your 8bit image to my machine and made a new .dat file with the grabber. I then used the grabber to convert the image to 16bit, and it works fine.</p><p>I&#39;ve attached the .dat file with the single bitmap.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Sun, 14 Jan 2007 06:33:06 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
set_color_conversion(16);
</p></div></div><p>
Err... that&#39;s not how you do things.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sun, 14 Jan 2007 07:28:08 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>actually that call to the conversion was pointless...after trying a lot of different things, I thought I might throw that in..but it didn&#39;t change anything..=/
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (XcronZ3X)</author>
		<pubDate>Sun, 14 Jan 2007 07:54:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
actually that call to the conversion was pointless...
</p></div></div><p>
No, it&#39;s wrong. Check the manual entry for set_color_conversion().
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Sun, 14 Jan 2007 16:57:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Here&#39;s a link even:</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/set_color_conversion" target="_blank"><span class="a">set_color_conversion</span></a><span class="k2">(</span><span class="k2">)</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Sun, 14 Jan 2007 17:03:00 +0000</pubDate>
	</item>
</rss>
