<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>I can&#39;t draw_sprite</title>
		<link>http://www.allegro.cc/forums/view/587876</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 05 Oct 2006 02:33:11 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Hi there!</p><p>I&#39;ve been trying to make a draw_lit_sprite effect, but i don&#39;t quite get how to work with truecolor images <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" /></p><p>I don&#39;t even can draw a sprite.. when i use draw_sprite nothing happens but with a normal bit i can see the image. What&#39;s missing?</p><p>Thanks!</p><div class="source-code snippet"><div class="inner"><pre>   <a href="http://www.allegro.cc/manual/set_color_conversion" target="_blank"><span class="a">set_color_conversion</span></a><span class="k2">(</span>COLORCONV_KEEP_TRANS<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>test <span class="k3">=</span> <a href="http://www.allegro.cc/manual/load_bitmap" target="_blank"><span class="a">load_bitmap</span></a><span class="k2">(</span><span class="s">"table.pcx"</span>, pal<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>buffer <span class="k3">=</span> <a href="http://www.allegro.cc/manual/create_bitmap" target="_blank"><span class="a">create_bitmap</span></a><span class="k2">(</span>screen-&gt;w, screen-&gt;h<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>test, buffer, <span class="n">0</span>, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span> <span class="c">// it works if i do a blit</span>
   <a href="http://www.allegro.cc/manual/blit" target="_blank"><span class="a">blit</span></a><span class="k2">(</span>buffer, <a href="http://www.allegro.cc/manual/screen" target="_blank"><span class="a">screen</span></a>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, <span class="n">0</span>, buffer-&gt;w, buffer-&gt;h<span class="k2">)</span><span class="k2">;</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ricardo Santos)</author>
		<pubDate>Wed, 04 Oct 2006 23:24:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Someone needs to <a href="http://www.allegro.cc/manual/api/blitting-and-sprites/draw_sprite">RTFM</a> more closely. In particular, actually look at what each argument is.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Wed, 04 Oct 2006 23:30:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oops, you&#39;re right. I was playing with blit and draw_sprite and forgot to switch the args. But still I can&#39;t get anything good.</p><p>The sprite looks like EGA and zoomed with scanlines. Is it colordepth problem? I tried to force colordepth to 8,16 and 32 and won&#39;t help anyway.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ricardo Santos)</author>
		<pubDate>Wed, 04 Oct 2006 23:39:56 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Is it colordepth problem?
</p></div></div><p>

Sounds like it. Make sure you set the color depth before setting the graphics mode.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Todd Cope)</author>
		<pubDate>Wed, 04 Oct 2006 23:46:38 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>
Probably, yes. Make sure the bitmap is of the same color depth as what you&#39;re actually running. Draw_sprite won&#39;t work well with mixed color depths.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Wed, 04 Oct 2006 23:52:31 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh i got it!</p><p>It was the set_color_conversion(COLORCONV_KEEP_TRANS);</p><p>Without conversion all goes well. Thanks
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Ricardo Santos)</author>
		<pubDate>Wed, 04 Oct 2006 23:59:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
It was the set_color_conversion(COLORCONV_KEEP_TRANS);</p><p>Without conversion all goes well. Thanks
</p></div></div><p>
Eh?<br />What colour depth is your program and what colour depth are your bitmaps?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Thu, 05 Oct 2006 01:11:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Before calling set_gfx_mode, use set_color_depth(n), where n is an int that is the colour depth you require.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (James Stanley)</author>
		<pubDate>Thu, 05 Oct 2006 01:37:11 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Before calling set_gfx_mode, use set_color_depth(n), where n is an int that is the colour depth you require.
</p></div></div><p>

Read before you post! It&#39;s already been established that the problem lay elsewhere.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Thu, 05 Oct 2006 02:33:11 +0000</pubDate>
	</item>
</rss>
