<?xml version="1.0"?>
<rss version="2.0">
	<channel>
		<title>clean to color</title>
		<link>http://www.allegro.cc/forums/view/589649</link>
		<description>Allegro.cc Forum Thread</description>
		<webMaster>matthew@allegro.cc (Matthew Leverton)</webMaster>
		<lastBuildDate>Thu, 25 Jan 2007 03:46:18 +0000</lastBuildDate>
	</channel>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>For example in this code should be or shouldn&#39;t be: <span class="source-code"><a href="http://www.allegro.cc/manual/clear_to_color" target="_blank"><span class="a">clear_to_color</span></a><span class="k2">(</span>buffer,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">255</span>,<span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span></span> <img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /><img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /><img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" /><img src="http://www.allegro.cc/forums/smileys/huh.gif" alt="???" />??</p><div class="source-code snippet"><div class="inner"><pre><span class="k1">while</span><span class="k2">(</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_470.html" target="_blank">index</a><span class="k3">!</span><span class="k3">=</span><span class="n">10</span><span class="k2">)</span>
<span class="k2">{</span>
<a href="http://www.delorie.com/djgpp/doc/libc/libc_470.html" target="_blank">index</a><span class="k3">+</span><span class="k3">+</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/clear_to_color" target="_blank"><span class="a">clear_to_color</span></a><span class="k2">(</span>buffer,<a href="http://www.allegro.cc/manual/makecol" target="_blank"><span class="a">makecol</span></a><span class="k2">(</span><span class="n">255</span>,<span class="n">255</span>,<span class="n">255</span><span class="k2">)</span><span class="k2">)</span><span class="k2">;</span>
<a href="http://www.allegro.cc/manual/blit" target="_blank"><span class="a">blit</span></a><span class="k2">(</span>board,buffer,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,<span class="n">0</span>,board-&gt;w,board-&gt;h<span class="k2">)</span><span class="k2">;</span> 
<a href="http://www.allegro.cc/manual/masked_blit" target="_blank"><span class="a">masked_blit</span></a><span class="k2">(</span>pawn,buffer,<span class="n">0</span>,<span class="n">0</span>,tab<span class="k2">[</span><span class="n">0</span><span class="k2">]</span><span class="k2">[</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_470.html" target="_blank">index</a><span class="k2">]</span>,tab<span class="k2">[</span><span class="n">1</span><span class="k2">]</span><span class="k2">[</span><a href="http://www.delorie.com/djgpp/doc/libc/libc_470.html" target="_blank">index</a><span class="k2">]</span>,pawn-&gt;w,pawn-&gt;h<span class="k2">)</span><span class="k2">;</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>,<a href="http://www.allegro.cc/manual/SCREEN_W" target="_blank"><span class="a">SCREEN_W</span></a>,<a href="http://www.allegro.cc/manual/SCREEN_H" target="_blank"><span class="a">SCREEN_H</span></a><span class="k2">)</span><span class="k2">;</span>
<span class="k2">}</span>
</pre></div></div><p>
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (a b)</author>
		<pubDate>Sun, 21 Jan 2007 00:50:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>What the hell do we know?</p><p>If &quot;board&quot; covers the entirety of &quot;buffer&quot;, then no, you don&#39;t need to clear the buffer. Otherwise, you probably do.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sun, 21 Jan 2007 00:53:19 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>yes it covers everything but is it good that all overlaps on yourself ?? without clear_to_color(buffer,makecol(255,255,255));  everything looks good but is it pretty that this overlaps without clear?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (a b)</author>
		<pubDate>Sun, 21 Jan 2007 00:58:26 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Don&#39;t do it, gnolam! Run while you still can!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (X-G)</author>
		<pubDate>Sun, 21 Jan 2007 01:03:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>X-G please go away if you don&#39;t want write somothing helpful.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (a b)</author>
		<pubDate>Sun, 21 Jan 2007 01:04:15 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Oh Bog. I forgot who I was replying to! <img src="http://www.allegro.cc/forums/smileys/lipsrsealed.gif" alt=":-X" /></p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
yes it covers everything but is it good that all overlaps on yourself ?? without clear_to_color(buffer,makecol(255,255,255)); everything looks good but is it pretty that this overlaps without clear?
</p></div></div><p>
If everything gets overdrawn every frame there is no reason to clear the buffer.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (gnolam)</author>
		<pubDate>Sun, 21 Jan 2007 01:15:14 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>If it looks the same without the line, remove it. It&#39;s that simple. I know it&#39;ll probably take another 180 posts to get the point through to you, but here&#39;s hoping it won&#39;t.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kauhiz)</author>
		<pubDate>Sun, 21 Jan 2007 01:18:03 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>ok - simply english is very important for me !! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (a b)</author>
		<pubDate>Sun, 21 Jan 2007 01:30:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>That&#39;s what we give you though! It&#39;s like saying you want peanuts when we give you a bag of them! <img src="http://www.allegro.cc/forums/smileys/angry.gif" alt="&gt;:(" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kikaru)</author>
		<pubDate>Sun, 21 Jan 2007 06:22:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>what ? I don&#39;t understand.........
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (a b)</author>
		<pubDate>Sun, 21 Jan 2007 21:13:30 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Was your question answered already?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kauhiz)</author>
		<pubDate>Sun, 21 Jan 2007 23:17:16 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Kikaru wrote something:<br />&quot;That&#39;s what we give you though! It&#39;s like saying you want peanuts when we give you a bag of them! &quot;<br />and I don&#39;t understand <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (a b)</author>
		<pubDate>Mon, 22 Jan 2007 00:31:41 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>No, but was the original question answered? Do you still need help?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kauhiz)</author>
		<pubDate>Mon, 22 Jan 2007 00:35:35 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I got good answer and I needn&#39;t help <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (a b)</author>
		<pubDate>Mon, 22 Jan 2007 01:11:04 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>You said you wanted &quot;simply English&quot; - and that&#39;s what we already give you! We aren&#39;t speaking French or anything! <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" /></p><p>(P.S. sorry if I come across as rude, I am just rather irked with lots of incoherent new people.)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kikaru)</author>
		<pubDate>Mon, 22 Jan 2007 01:11:17 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
P.S. sorry if I come across as rude, I am just rather irked with lots of incoherent new people.
</p></div></div><p>

And I seem to remember you having an irksome habit of not using google or reading the replies to your questions when you first started posting here. <img src="http://www.allegro.cc/forums/smileys/tongue.gif" alt=":P" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (LennyLen)</author>
		<pubDate>Mon, 22 Jan 2007 01:24:27 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
You said you wanted &quot;simply English&quot;
</p></div></div><p>
It&#39;s quite clear that he meant &quot;simple English&quot;, or &quot;elementary English&quot;. As I&#39;m sure you&#39;ve noticed, it&#39;s not his first language.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Mon, 22 Jan 2007 01:33:09 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
but is it good that all overlaps on yourself
</p></div></div><p>You don&#39;t understand what is happening. blit actually <b>copies</b> the data, so &quot;overlaps&quot; isn&#39;t an issue at all. Now, if blit actually <i>moved</i> the data, this would be a concern.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Mon, 22 Jan 2007 01:57:24 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p><tt>blit()</tt> uses <tt>memcpy()</tt> on each line, doesn&#39;t it? To move the data, you would be using <tt>memmove()</tt>. Anyway, cool stuff! <img src="http://www.allegro.cc/forums/smileys/smiley.gif" alt=":)" /></p><p>(P.S. My frustration is also on another forum, and the fact that I have had only 20 min. of free time over the last week (mon-fri). <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />)
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kikaru)</author>
		<pubDate>Mon, 22 Jan 2007 03:53:22 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
blit() uses memcpy() on each line, doesn&#39;t it? To move the data, you would be using memmove().
</p></div></div><p>
blit() actually uses memmove().</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
My frustration is also on another forum, and the fact that I have had only 20 min. of free time over the last week (mon-fri). <img src="http://www.allegro.cc/forums/smileys/undecided.gif" alt=":-/" />
</p></div></div><p>
Is ok. As long as it isn&#39;t personal we don&#39;t mind you taking it out on us. <img src="http://www.allegro.cc/forums/smileys/wink.gif" alt=";)" />
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Mon, 22 Jan 2007 04:25:42 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
To move the data, you would be using <tt>memmove()</tt>.
</p></div></div><p>The difference between memcpy and memmove is that with memmove, the memory areas may overlap. memmove copies the data.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (CGamesPlay)</author>
		<pubDate>Mon, 22 Jan 2007 04:31:58 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I thought it cleared the first area too... hmmm...
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Kikaru)</author>
		<pubDate>Mon, 22 Jan 2007 06:51:39 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>I&#39;ve never understood what kind of useful result you would get, when blitting a bitmap on (part of) itself.<br />Does anybody know why blit() is implemented this way? (memmove vs memcpy)<br />Is it implemented this way because the overhead of checking is tiny, and the consequences would be severe (hang?) if the memory areas were overlapping ?
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Audric)</author>
		<pubDate>Mon, 22 Jan 2007 16:42:52 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
I&#39;ve never understood what kind of useful result you would get, when blitting a bitmap on (part of) itself.
</p></div></div><p>
You can use it for implementing scrolling maps where you only redraw the strip that is &quot;new&quot;. Essentially, blit the back buffer to itself with some off-set and then fill in the blank spot. I&#39;ve used it for this in the past (1999-ish), and it was a lot faster than redrawing the entire tilemap. It probably doesn&#39;t matter too much these days.</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Does anybody know why blit() is implemented this way? (memmove vs memcpy)
</p></div></div><p>
I do, because I&#39;m the one who made it use memmove instead of the older code that was in place before. Historically, blit() has always allowed for overlapping regions, which does work with memmove and not with memcpy (more specifically, the behavior is undefined).</p><div class="quote_container"><div class="title">Quote:</div><div class="quote"><p>
Is it implemented this way because the overhead of checking is tiny, and the consequences would be severe (hang?) if the memory areas were overlapping ?
</p></div></div><p>
I found no measurable speed difference between memmove and memcpy.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Evert)</author>
		<pubDate>Mon, 22 Jan 2007 16:57:47 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>Thank you Evert
</p><div class="quote_container"><div class="title">Evert said:</div><div class="quote"><p>
I found no measurable speed difference between memmove and memcpy.
</p></div></div><p>
Good reason!
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Audric)</author>
		<pubDate>Mon, 22 Jan 2007 19:03:20 +0000</pubDate>
	</item>
	<item>
		<description><![CDATA[<div class="mockup v2"><p>IIRC, one of the mem* routines simply checked if areas overlapped and, and started copying from the high end in memory if the source was the &quot;high&quot; chunk.
</p></div>]]>
		</description>
		<author>no-reply@allegro.cc (Arthur Kalliokoski)</author>
		<pubDate>Thu, 25 Jan 2007 03:46:18 +0000</pubDate>
	</item>
</rss>
