<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>Width of a bitmap</title>
		<link>http://www.allegro.cc/forums/view/591555</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 24 May 2007 15:55:46 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>How do i get the width of a bitmap?</p><p>is there a handy function for this in allegro or do i have to make one myself?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Thu, 24 May 2007 15:41:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>... BITMAP *b; b-&gt;w
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Thu, 24 May 2007 15:41:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><span class="source-code"><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a></span>Click it.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Thu, 24 May 2007 15:43:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks <img src="http://www.allegro.cc/forums/smileys/grin.gif" alt=";D" />,<br />oh, missed that part of the manual.. will look harder next time.</p><p>but what should i do if the bitmap is in a datafile?<br />(BITMAP*)datafiles::sprites_enemies[1].dat-&gt;w<br />doesn&#39;t work :/
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Thu, 24 May 2007 15:49:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Needs more brackets on that one IIRC.<br /><span class="source-code"><span class="k2">(</span><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a><span class="k3">*</span><span class="k2">)</span><span class="k2">(</span>sprites_enemies<span class="k2">[</span><span class="n">1</span><span class="k2">]</span>.dat<span class="k2">)</span><span class="k3">-</span><span class="k3">&gt;</span>w</span><br />Something like that; I forget exactly.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (23yrold3yrold)</author>
		<pubDate>Thu, 24 May 2007 15:51:02 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The dat member is a void*, so it doesn&#39;t have a w member. However, the void* is really a BITMAP, so we cast it: (BITMAP*) datafiles::sprites_enemies[1].dat. From there, we take the w member: ((BITMAP*) datafiles::sprites_enemies[1].dat)-&gt;w. This is the order of operations, and it is said that the -&gt; binds &quot;tighter&quot; than the (BITMAP*), so we have to use parentheses to switch the order.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Thu, 24 May 2007 15:52:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><s>still doesn&#39;t work :(

&quot;`void*&#39; is not a pointer-to-object type &quot;</s>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Thu, 24 May 2007 15:54:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>My post has the right way to do it...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Thu, 24 May 2007 15:54:33 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>totally sweet <img src="http://www.allegro.cc/forums/smileys/cool.gif" alt="8-)" />. thanks!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Albin Engström)</author>
		<pubDate>Thu, 24 May 2007 15:55:46 +0000</pubDate>
	</item>
</rss>
