<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Game Engine Tutorial Part III, Chapter 3 &#8211; Component Draw Order</title>
	<atom:link href="http://www.innovativegames.net/blog/blog/2009/10/20/game-engine-tutorial-part-iii-chapter-3-component-draw-order/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.innovativegames.net/blog/blog/2009/10/20/game-engine-tutorial-part-iii-chapter-3-component-draw-order/</link>
	<description>Independent game development blog by Sean James</description>
	<lastBuildDate>Mon, 06 Feb 2012 16:14:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
	<item>
		<title>By: Kevin</title>
		<link>http://www.innovativegames.net/blog/blog/2009/10/20/game-engine-tutorial-part-iii-chapter-3-component-draw-order/comment-page-1/#comment-12371</link>
		<dc:creator>Kevin</dc:creator>
		<pubDate>Mon, 01 Nov 2010 20:22:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.innovativegames.net/blog/?p=517#comment-12371</guid>
		<description>Hi Sean,

Correct me if I&#039;m wrong but wouldn&#039;t the fix be as simple as this:

        public void AddComponent(Component component) {
            if (!components_.Contains(component)) {
                PutComponentInOrder(component);
                component.Parent = this;
            }
        }

        public void PutComponentInOrder(Component component) {
            if (components_.Contains(component))
                components_.Remove(component);

            int i = 0;

            for (i = 0; i = component.DrawOrder)
                    break;

            components_.Insert(i, component);
        }

So, if the component is already in the list, you can remove it and insert it in its proper place. Otherwise, it must be a new element and just insert it wherever it needs to go.</description>
		<content:encoded><![CDATA[<p>Hi Sean,</p>
<p>Correct me if I&#8217;m wrong but wouldn&#8217;t the fix be as simple as this:</p>
<p>        public void AddComponent(Component component) {<br />
            if (!components_.Contains(component)) {<br />
                PutComponentInOrder(component);<br />
                component.Parent = this;<br />
            }<br />
        }</p>
<p>        public void PutComponentInOrder(Component component) {<br />
            if (components_.Contains(component))<br />
                components_.Remove(component);</p>
<p>            int i = 0;</p>
<p>            for (i = 0; i = component.DrawOrder)<br />
                    break;</p>
<p>            components_.Insert(i, component);<br />
        }</p>
<p>So, if the component is already in the list, you can remove it and insert it in its proper place. Otherwise, it must be a new element and just insert it wherever it needs to go.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jay</title>
		<link>http://www.innovativegames.net/blog/blog/2009/10/20/game-engine-tutorial-part-iii-chapter-3-component-draw-order/comment-page-1/#comment-10398</link>
		<dc:creator>jay</dc:creator>
		<pubDate>Mon, 26 Jul 2010 03:57:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.innovativegames.net/blog/?p=517#comment-10398</guid>
		<description>nice work sean, i&#039;m having fun working through these, but being basically a n00b to coding i think it would help me if i knew where exactly to paste in the little snipits as i&#039;m following along.  trying to wrap my mind around all of this and i&#039;d like to achieve a real, big picture understanding.  i took plenty of math and physics in college and a couple c++ classes but it&#039;s been a while.  i keep stumbling on where to paste stuff but usually figure my way through it (by luck mostly)

like between which set of braces or under which, uh, section or sub-section or whatever....i really should learn the names of these things....

anyway, thanks for putting this up here, it&#039;s been most helpful so far, i already worked through the stock tutorials and can&#039;t wait to finish working through yours.  i like your approach in basically writing your own engine, all the XNA stuff (obviously) is geared towards microsoft platforms.  i appreciate the flexibility and the extra understanding</description>
		<content:encoded><![CDATA[<p>nice work sean, i&#8217;m having fun working through these, but being basically a n00b to coding i think it would help me if i knew where exactly to paste in the little snipits as i&#8217;m following along.  trying to wrap my mind around all of this and i&#8217;d like to achieve a real, big picture understanding.  i took plenty of math and physics in college and a couple c++ classes but it&#8217;s been a while.  i keep stumbling on where to paste stuff but usually figure my way through it (by luck mostly)</p>
<p>like between which set of braces or under which, uh, section or sub-section or whatever&#8230;.i really should learn the names of these things&#8230;.</p>
<p>anyway, thanks for putting this up here, it&#8217;s been most helpful so far, i already worked through the stock tutorials and can&#8217;t wait to finish working through yours.  i like your approach in basically writing your own engine, all the XNA stuff (obviously) is geared towards microsoft platforms.  i appreciate the flexibility and the extra understanding</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: MrSoundless</title>
		<link>http://www.innovativegames.net/blog/blog/2009/10/20/game-engine-tutorial-part-iii-chapter-3-component-draw-order/comment-page-1/#comment-7425</link>
		<dc:creator>MrSoundless</dc:creator>
		<pubDate>Fri, 19 Feb 2010 21:10:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.innovativegames.net/blog/?p=517#comment-7425</guid>
		<description>Hi,
First, I want to thank you for doing something like this which helps a lot of people.

Second,
I agree with Greg. You would remove more code then you would add. I got this now:

public void AddComponent(Component component)
        {
            component.Parent = this;
            PutComponentInOrder(component);
        }

public void PutComponentInOrder(Component component)
        {
            if (_components.Contains(component))
                _components.Remove(component);

            var i = 0;

            for (i = 0; i = component.DrawOrder)
                    break;

            _components.Insert(i, component);
        }</description>
		<content:encoded><![CDATA[<p>Hi,<br />
First, I want to thank you for doing something like this which helps a lot of people.</p>
<p>Second,<br />
I agree with Greg. You would remove more code then you would add. I got this now:</p>
<p>public void AddComponent(Component component)<br />
        {<br />
            component.Parent = this;<br />
            PutComponentInOrder(component);<br />
        }</p>
<p>public void PutComponentInOrder(Component component)<br />
        {<br />
            if (_components.Contains(component))<br />
                _components.Remove(component);</p>
<p>            var i = 0;</p>
<p>            for (i = 0; i = component.DrawOrder)<br />
                    break;</p>
<p>            _components.Insert(i, component);<br />
        }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mhtregmr</title>
		<link>http://www.innovativegames.net/blog/blog/2009/10/20/game-engine-tutorial-part-iii-chapter-3-component-draw-order/comment-page-1/#comment-7129</link>
		<dc:creator>mhtregmr</dc:creator>
		<pubDate>Wed, 27 Jan 2010 19:50:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.innovativegames.net/blog/?p=517#comment-7129</guid>
		<description>9I4h53  &lt;a href=&quot;http://zqomyodrsfie.com/&quot; rel=&quot;nofollow&quot;&gt;zqomyodrsfie&lt;/a&gt;, [url=http://dtkhpghwvpxa.com/]dtkhpghwvpxa[/url], [link=http://yekwhbncgfyr.com/]yekwhbncgfyr[/link], http://rjquizvmriub.com/</description>
		<content:encoded><![CDATA[<p>9I4h53  <a href="http://zqomyodrsfie.com/" rel="nofollow">zqomyodrsfie</a>, [url=http://dtkhpghwvpxa.com/]dtkhpghwvpxa[/url], [link=http://yekwhbncgfyr.com/]yekwhbncgfyr[/link], <a href="http://rjquizvmriub.com/" rel="nofollow">http://rjquizvmriub.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://www.innovativegames.net/blog/blog/2009/10/20/game-engine-tutorial-part-iii-chapter-3-component-draw-order/comment-page-1/#comment-7013</link>
		<dc:creator>Sean</dc:creator>
		<pubDate>Fri, 22 Jan 2010 07:20:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.innovativegames.net/blog/?p=517#comment-7013</guid>
		<description>In this case it&#039;s not worth the time to write the extra code, which would make it messier anyway. We want to keep the sort function separate so that it can be used when components change their draw order. Duplicating the sort code here would just be messy and would make not make a worthwhile performance increase at all.</description>
		<content:encoded><![CDATA[<p>In this case it&#8217;s not worth the time to write the extra code, which would make it messier anyway. We want to keep the sort function separate so that it can be used when components change their draw order. Duplicating the sort code here would just be messy and would make not make a worthwhile performance increase at all.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

