<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>al_draw_tinted_bitmap() not working as expected</title>
		<link>http://www.allegro.cc/forums/view/606236</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Sun, 30 Jan 2011 06:22:03 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>The allecro manual for 5.0 RC4 says that using the following code will draw a bitmap that has 50% opacity:</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_tinted_bitmap"><span class="a">al_draw_tinted_bitmap</span></a><span class="k2">(</span>bitmap, <a href="http://www.allegro.cc/manual/al_map_rgba_f"><span class="a">al_map_rgba_f</span></a><span class="k2">(</span><span class="n">1</span>, <span class="n">1</span>, <span class="n">1</span>, <span class="n">0</span>.<span class="n">5</span><span class="k2">)</span>, x, y, <span class="n">0</span><span class="k2">)</span><span class="k2">;</span></span></p><p>I went ahead and tried the same thing in my project:</p><p><span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_tinted_bitmap"><span class="a">al_draw_tinted_bitmap</span></a><span class="k2">(</span>panelBG,<a href="http://www.allegro.cc/manual/al_map_rgba_f"><span class="a">al_map_rgba_f</span></a><span class="k2">(</span><span class="n">1</span>,<span class="n">1</span>,<span class="n">1</span>,alpha<span class="k2">)</span>,x,y,<span class="n">0</span><span class="k2">)</span><span class="k2">;</span></span></p><p>However, it does not draw the bitmap at 50% opacity when alpha=0.5. I also tried alpha = 0, but the bitmap is still drawing with distorted colors.</p><p>Here is what it renders when I draw when alpha = 0:</p><p><a href="http://imgur.com/Ynrsk.png">http://imgur.com/Ynrsk.png</a></p><p>This is what it looks like with no tinting (eg, all multipliers are 1)<br /><a href="http://imgur.com/26Hd0.png">http://imgur.com/26Hd0.png</a></p><p>Hopefully you can help me out or point me in the right direction <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (TrieBr)</author>
		<pubDate>Sun, 30 Jan 2011 06:06:29 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I think this is related to the new default of using pre-multiplied alpha, you can either change the default blender back to how it was (I can&#39;t remember what that was atm), or do: <span class="source-code"><a href="http://www.allegro.cc/manual/al_draw_tinted_bitmap"><span class="a">al_draw_tinted_bitmap</span></a><span class="k2">(</span>panelBG,<a href="http://www.allegro.cc/manual/al_map_rgba_f"><span class="a">al_map_rgba_f</span></a><span class="k2">(</span><span class="n">1</span><span class="k3">*</span>alpha,<span class="n">1</span><span class="k3">*</span>alpha,<span class="n">1</span><span class="k3">*</span>alpha,alpha<span class="k2">)</span>,x,y,<span class="n">0</span><span class="k2">)</span><span class="k2">;</span></span>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Thomas Fjellstrom)</author>
		<pubDate>Sun, 30 Jan 2011 06:15:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thanks! Worked perfectly. <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>Someone should probably update the manual with that information too <img src="http://www.allegro.cc/forums/smileys/rolleyes.gif" alt="::)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (TrieBr)</author>
		<pubDate>Sun, 30 Jan 2011 06:22:03 +0000</pubDate>
	</item>
</rss>
