<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Pompi Pompi - A Gamers and Developers blog for indie games</title>
	<atom:link href="http://www.pompidev.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.pompidev.net</link>
	<description>A blog about indie game development for both gamers and developers</description>
	<lastBuildDate>Fri, 05 Mar 2010 18:27:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Keeping low profile</title>
		<link>http://www.pompidev.net/2010/03/05/keeping-low-profile/</link>
		<comments>http://www.pompidev.net/2010/03/05/keeping-low-profile/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 18:27:04 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Other blogs]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=506</guid>
		<description><![CDATA[Hello everyone reading my blog,
I just wanted to say that I am not sure how often I will update my blog. I have started to work on a new job which I enjoy a lot.
I am going to keep a low profile on game development. I believe I will be back to it sooner or [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone reading my blog,</p>
<p>I just wanted to say that I am not sure how often I will update my blog. I have started to work on a new job which I enjoy a lot.<br />
I am going to keep a low profile on game development. I believe I will be back to it sooner or later.</p>
<p>Thank you for reading. <img src='http://www.pompidev.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/03/05/keeping-low-profile/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crossstiches</title>
		<link>http://www.pompidev.net/2010/02/22/crossstiches/</link>
		<comments>http://www.pompidev.net/2010/02/22/crossstiches/#comments</comments>
		<pubDate>Mon, 22 Feb 2010 18:47:40 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Other blogs]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=501</guid>
		<description><![CDATA[Someone showed me her cross stitches today. She said there are millions of website where you can buy cross stitches images and samples.
Some of them are a representation of a photo or a realistic artwork. But some are also more schematic.
I am not sure about the legal issues here, but I would think that the cross [...]]]></description>
			<content:encoded><![CDATA[<p>Someone showed me her cross stitches today. She said there are millions of website where you can buy cross stitches images and samples.<br />
Some of them are a representation of a photo or a realistic artwork. But some are also more schematic.<br />
I am not sure about the legal issues here, but I would think that the cross stitches samples may be a really good source for pixel art.</p>
<p>What do you think?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/02/22/crossstiches/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ground Truth</title>
		<link>http://www.pompidev.net/2010/02/12/ground-truth/</link>
		<comments>http://www.pompidev.net/2010/02/12/ground-truth/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 16:37:32 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Other blogs]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=492</guid>
		<description><![CDATA[When you are in a position that you don&#8217;t know if your code is the faulty one or the bug is somewhere else. Sometimes you can just use another program that you know is working and use it to verify where the bug is at.
An example. Say you have written code to load a BMP [...]]]></description>
			<content:encoded><![CDATA[<p>When you are in a position that you don&#8217;t know if your code is the faulty one or the bug is somewhere else. Sometimes you can just use another program that you know is working and use it to verify where the bug is at.</p>
<p>An example. Say you have written code to load a BMP file format. You use your program, but the image has some weird artifacts. Is it a bug in your code? Or is it a corrupted BMP file?<br />
You can simply load the same BMP file with another program such as window&#8217;s paint, and see if it loads properly or if paint is having problems with this file as well. If paint loads the BMP file properly, the bug might be in your code.</p>
<p>I have given the BMP file format as an example, but this is true to many other fields where you have some tool you know is working right. It is kind of similar to the <a href="http://www.pompidev.net/2009/09/13/bug-negative-verification/">Bug negative verification</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/02/12/ground-truth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t make sense</title>
		<link>http://www.pompidev.net/2010/02/03/dont-make-sense/</link>
		<comments>http://www.pompidev.net/2010/02/03/dont-make-sense/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 17:46:12 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Other blogs]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=482</guid>
		<description><![CDATA[Making sense isn&#8217;t always good. I was debugging some code and printed some number on the screen. The number had weird initialized values, so I rationalized why these values are not 0 at the beginning.
Bottom line, I just forgot to initialize the debug variable so I had garbage values.
I think it&#8217;s a common trait of [...]]]></description>
			<content:encoded><![CDATA[<p>Making sense isn&#8217;t always good. I was debugging some code and printed some number on the screen. The number had weird initialized values, so I rationalized why these values are not 0 at the beginning.<br />
Bottom line, I just forgot to initialize the debug variable so I had garbage values.</p>
<p>I think it&#8217;s a common trait of humans to try rationalize everything. Sometimes they are so convinced at something and the logic behind it, even though it has no basis or it is even something that can&#8217;t make sense.</p>
<p>Does it happen to you too?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/02/03/dont-make-sense/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fun with dynamic casting</title>
		<link>http://www.pompidev.net/2010/01/29/fun-with-dynamic-casting/</link>
		<comments>http://www.pompidev.net/2010/01/29/fun-with-dynamic-casting/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 19:10:13 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=467</guid>
		<description><![CDATA[Polymorphism allows for different function implementations to be called, depending on values only known at run time. For instance:
class BaseA {
	public:
		virtual void foo(){cout&#60;&#60;"Base";};
};

class A: public BaseA {
	public:
		void foo(){cout&#60;&#60;"Child";};
};

A a;
BaseA &#38; base = a;
base.foo();
Will print &#8220;Child&#8221;.
&#8220;Pair polymorphism&#8221; is when you want a specific function implementation to be called based on the run time value of two [...]]]></description>
			<content:encoded><![CDATA[<p>Polymorphism allows for different function implementations to be called, depending on values only known at run time. For instance:</p>
<pre>class BaseA {
	public:
		virtual void foo(){cout&lt;&lt;"Base";};
};

class A: public BaseA {
	public:
		void foo(){cout&lt;&lt;"Child";};
};

A a;
BaseA &amp; base = a;
base.foo();</pre>
<p>Will print &#8220;Child&#8221;.</p>
<p>&#8220;Pair polymorphism&#8221; is when you want a specific function implementation to be called based on the run time value of two different instances of a class. For instance in the case of:</p>
<pre>class BaseA {
};

class BaseB {
	public:
		virtual void foo (BaseA &amp; a) = 0;
};

class A: public BaseA {
};

class B: public BaseB {
	public:
		void foo (A &amp; a);
};</pre>
<p>You would want that somehow &#8220;void B::foo (A &amp; a)&#8221; will be called. The code I posted does not do this.<br />
There is a way to do this, but it requires for a class to know about the implementation classes. It is not a problem in some cases. However, sometimes you want to have an abstraction layer.<br />
An abstraction layer is a set of classes or interfaces, that have no methods or &#8220;don&#8217;t know&#8221; anything about the classes that implement them. For instance you can have a graphics abstraction layer.<br />
You could implement this layer with DirectX. However, this layer will make it easier to afterwards add an implementation with OpenGL without having to make a lot of changes, even if the game is already completed.</p>
<p>How are we going to have a &#8220;pair polymorphism&#8221; in this case? One solution is using dynamic casting. You can cast a pointer of a parent class to it&#8217;s child class(in case the run time value really points to an instance of that class).<br />
Some code:</p>
<pre>class BaseA {
};

class BaseB {
	public:
		virtual void foo (BaseA &amp; a) = 0;
};

class A: public BaseA {
};

class B: public BaseB {
	public:
		void foo (BaseA &amp; a)
		{
			foo2 (dynamic_cast&lt;A &amp;&gt;(a));
		}
		void foo2 (A &amp; a);
};</pre>
<p>I was asked by someone how this can be done without dynamic casting, because he doesn&#8217;t like dynamic casting. I found a way, but it ain&#8217;t pretty, and I honestly can&#8217;t find any advantage of using this code instead of just using dynamic casting. But here it is:</p>
<pre>class BaseA {
	public:
		virtual void DynamicCast() = 0;
};

class BaseB {
	public:
		virtual void foo (BaseA &amp; base) = 0;
};

class A;

class Caster {
	public:
		A * a;
};

class A: public BaseA {
	public:
		Caster * c;
		void DynamicCast()
		{
			c-&gt;a = this;
		}
};

class B: public BaseB {
	public:
		Caster * c;
		void foo (BaseA &amp; base)
		{
			base.DynamicCast();
			foo2 (c-&gt;a);
		}
		void foo2 (A &amp; a);
};</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/01/29/fun-with-dynamic-casting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Out of the box(bug)</title>
		<link>http://www.pompidev.net/2010/01/20/out-of-the-boxbug/</link>
		<comments>http://www.pompidev.net/2010/01/20/out-of-the-boxbug/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 19:02:48 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Coding]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=458</guid>
		<description><![CDATA[When you draw sprites you are thinking in 2D. I was using DirectX&#8217;s ID3DXSprite interface to draw sprites. I had to scale up a sprite to cover the whole screen. The sprite can be in different resolutions. If the sprite is quarter the size of the screen, then it needs to scale up by 2.
When [...]]]></description>
			<content:encoded><![CDATA[<p>When you draw sprites you are thinking in 2D. I was using DirectX&#8217;s ID3DXSprite interface to draw sprites. I had to scale up a sprite to cover the whole screen. The sprite can be in different resolutions. If the sprite is quarter the size of the screen, then it needs to scale up by 2.<br />
When I scaled my sprite by 2 everything worked, but when I scaled it by 4 it was not visible. What was the problem?<br />
The sprite draw call gets a 3D position as a parameter, so I passed the x and y I needed and have put 0.5 for the z. I don&#8217;t remember why I did that.<br />
It turned out that when I scaled the sprite by 4, it scaled the z component of the position to the value of 2. It meant that the sprite, which is actually a quad, was outside of the viewing frustum.<br />
In the case of the sprites rendering, the viewing frustum is a box of the dimensions [0..Width]X[0..Height]X[0..1]. Anything with a z value greater than 1 will not be visible.</p>
<p>These kind of bugs might be difficult to figure for a beginner, and even for someone who is not a beginner it can waste time. Luckily, once you wrap the DirectX ID3DSprite with some abstraction and after you encounter this bug once, you can protect yourself from the same bug in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/01/20/out-of-the-boxbug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Base Code 2</title>
		<link>http://www.pompidev.net/2010/01/15/base-code-2/</link>
		<comments>http://www.pompidev.net/2010/01/15/base-code-2/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 13:58:39 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Labyrinthica]]></category>
		<category><![CDATA[The RPG Game]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=451</guid>
		<description><![CDATA[A full rebuild of Labyrinthica takes quite a while and some of my code goes way back. This has led me to the decision of trying to revisit my code of Labyrinthica, with a focus on my next project(TRG) as what will be the product. I plan on blogging on how this will go.
A few things [...]]]></description>
			<content:encoded><![CDATA[<p>A full rebuild of <a href="http://www.pompipompi.net">Labyrinthica</a> takes quite a while and some of my code goes way back. This has led me to the decision of trying to revisit my code of Labyrinthica, with a focus on my next project(TRG) as what will be the product. I plan on blogging on how this will go.<br />
A few things I have learned from my new workplace(Microsoft), is how to profile builds. For instance, the use of precompiled headers, and turnning on the build timing option in VS express 2008.<br />
Here is an <a href="http://www.cygnus-software.com/papers/precompiledheaders.html">article</a> talking about this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/01/15/base-code-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Who moved my monitor(cheese)?</title>
		<link>http://www.pompidev.net/2010/01/12/who-moved-my-monitorcheese/</link>
		<comments>http://www.pompidev.net/2010/01/12/who-moved-my-monitorcheese/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 19:15:32 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Other blogs]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=444</guid>
		<description><![CDATA[I was starting to work at a new workplace last week. They have set me up a temporary desktop computer.
It was placed on a &#8220;table corner&#8221;, where two perpendicular tables connect. The set up was inconvenient. The monitor was placed far into the corner, and the mouse and keyboard cord barely reach the table&#8217;s edge.
Since [...]]]></description>
			<content:encoded><![CDATA[<p>I was starting to work at a new workplace last week. They have set me up a temporary desktop computer.<br />
It was placed on a &#8220;table corner&#8221;, where two perpendicular tables connect. The set up was inconvenient. The monitor was placed far into the corner, and the mouse and keyboard cord barely reach the table&#8217;s edge.<br />
Since the monitor was far, it was making my eyes tired. I don&#8217;t know exactly what I was thinking, but I rationalized why I should not try to pull the monitor closer.<br />
At first I thought that because the mouse and keyboard cords can&#8217;t be pulled, there will be a problem with the monitor cord as well. Then I was told that I will get a new monitor today, so I said after I will get the new monitor this problem will be fixed.<br />
I then talked about it with my boss, and while talking to him I figured how silly it sound that I just didn&#8217;t check or try to pull the monitor closer. I tried to gently pull the monitor and found out there was a lot of loose cable.<br />
We some time rationalize things or find excuses to not try things because of <a href="http://www.pompidev.net/2009/12/31/happy-malloc-year/">a future event we are looking forward to</a>.<br />
It is a really important quality to be able to try things out even if you have no prior knowledge if it will work or how you are going to do it.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/01/12/who-moved-my-monitorcheese/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Accessing privates without &#8216;friend&#8217;(c++)</title>
		<link>http://www.pompidev.net/2010/01/05/accessing-privates-without-friendc/</link>
		<comments>http://www.pompidev.net/2010/01/05/accessing-privates-without-friendc/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 21:12:34 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Software Design]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=427</guid>
		<description><![CDATA[Here is a neat little way I found to make one class access the privates of another class, without using friend or direct inheritance. Take a look at this code:

class A {
    public:
        class Observer {
          [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a neat little way I found to make one class access the privates of another class, without using friend or direct inheritance. Take a look at this code:</p>
<p><code lang="cpp"></p>
<pre>class A {
    public:
        class Observer {
             protected:
                 int GetPrivate(A &amp; a) {return a.ValueA;};
        };
    private:
        int ValueA;
};

class B: public A::Observer {
    public:
        void Foo (A &amp; a) {
             cout&lt;&lt;GetPrivate(A);
        }
};</pre>
<p> </p>
<p></code>Class B cannot access the privates of class A directly, but it inherits a subclass of A that can access the privates of A given as a parameter. Since I have just tried this &#8220;pattern&#8221; recently, I am not sure what is the direct benefit of this.</p>
<p>I believe a benefit can be in the sense of making a programmer&#8217;s life easier. Programming languages play several parts. They provide us powerful functionality, but they also suppose to give us ease of use. You can program anything on assembly, but it would be really difficult to write a big game in assembly.<br />
If you do not expose privates via a getter, you give the programmer one less method to think about when he need to use the class&#8217;s instance for something.</p>
<p>Can you think how you would use this &#8220;pattern&#8221;? Do you think there is no use for it?<br />
Tell me what you think.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2010/01/05/accessing-privates-without-friendc/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Happy Malloc Year!</title>
		<link>http://www.pompidev.net/2009/12/31/happy-malloc-year/</link>
		<comments>http://www.pompidev.net/2009/12/31/happy-malloc-year/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 12:09:48 +0000</pubDate>
		<dc:creator>ofer</dc:creator>
				<category><![CDATA[Other blogs]]></category>

		<guid isPermaLink="false">http://www.pompidev.net/?p=416</guid>
		<description><![CDATA[Well, it&#8217;s not new year yet but I would like to talk about &#8220;special dates&#8221;. I think some people like events, they like to have anticipation to something. An event is sometimes an opportunity to change, to start fresh.
People think that after new year they will change, they will break an old habit, they will [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s not new year yet but I would like to talk about &#8220;special dates&#8221;. I think some people like events, they like to have anticipation to something. An event is sometimes an opportunity to change, to start fresh.<br />
People think that after new year they will change, they will break an old habit, they will do something new. Or people think that on the weekend they will have fun, while on working days they just count the days until weekend.<br />
This can be good, an event can be an opportunity to do something new. But isn&#8217;t it better to just change or do something new the moment you want to? Instead of procrastinate to some event?<br />
It is possible to get used to do new things, to learn new things, to change the moment you want to instead of waiting for some event to come.</p>
<p>It is also relevant to game development. Especially in terms of efficiency. You might procrastinate <span>doing things because you need to finish some boring task first. But you end up delaying that boring task because it&#8217;s boring.<br />
I think what tempt us to look to events is that we like linear advancement. We like to think we always walk </span>straight and every step we make we get closer to our goal. This might be a good thing sometimes, but sometimes it also hold us back.</p>
<p>I am not entirely sure about this subject and what I wrote. I just had a thought of why we like events, why we have anticipation to these events and why we promise ourselves to change only at a certain event. What do you think?</p>
<p>Happy New Year.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.pompidev.net/2009/12/31/happy-malloc-year/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
