<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>create_sub_bitmap</title>
		<link>http://www.allegro.cc/forums/view/561937</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 26 Jan 2006 08:40:47 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What exactly does this do?<br />Does it blit part of the parent to a newly created child?<br />Or does it set up like a pointer within the BITMAP* and a clip x y and a width and height?<br />It&#39;s just for efficiency reasons you see.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Miles Lombardi)</author>
		<pubDate>Thu, 26 Jan 2006 02:28:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>AFAIR it is closer to the second method - just faslty setup some pointers/integers (clipping) to access something insied other bitmap&#39;s data
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Raf256)</author>
		<pubDate>Thu, 26 Jan 2006 02:31:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>second point. but you still need to destroy it when finished, and of course destroy it before you destroy the master.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Neil Walker)</author>
		<pubDate>Thu, 26 Jan 2006 04:28:59 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Yeah I use it in situations like when I have a sprite sheet.
</p><div class="source-code snippet"><div class="inner"><pre><a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>sprite_sheet<span class="k3">=</span><a href="http://www.allegro.cc/manual/load_pcx" target="_blank"><span class="a">load_pcx</span></a><span class="k2">(</span><span class="s">"blah/blah.pcx"</span>,NULL<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/BITMAP" target="_blank"><span class="a">BITMAP</span></a> <span class="k3">*</span>frame<span class="k3">=</span><a href="http://www.allegro.cc/manual/create_sub_bitmap" target="_blank"><span class="a">create_sub_bitmap</span></a><span class="k2">(</span>sprite_sheet,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span>buffer,frame,x,y<span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/destroy_bitmap" target="_blank"><span class="a">destroy_bitmap</span></a><span class="k2">(</span>frame<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
Or<br /><span class="source-code"><a href="http://www.allegro.cc/manual/draw_sprite" target="_blank"><span class="a">draw_sprite</span></a><span class="k2">(</span>buffer,<a href="http://www.allegro.cc/manual/create_sub_bitmap" target="_blank"><span class="a">create_sub_bitmap</span></a><span class="k2">(</span>sprite_sheet,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span><span class="k2">)</span>,x,y<span class="k2">)</span><span class="k2">;</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ceagon Xylas)</author>
		<pubDate>Thu, 26 Jan 2006 05:24:48 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
draw_sprite(buffer,create_sub_bitmap(sprite_sheet,0,0,0,0),x,y);
</p></div></div><p>Except thats a horrible memory leak.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Thu, 26 Jan 2006 07:25:32 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Figures. My code usually winds up being terrible.<br />So stick to method 1? =]
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ceagon Xylas)</author>
		<pubDate>Thu, 26 Jan 2006 08:40:47 +0000</pubDate>
	</item>
</rss>
