Archives

Developer Blog

 

Memory Management – Part 2

March 24, 2012 by Rew

In part one, we looked at some simple memory management in C, and why we need to be careful with what we do with our memory. Now, we’ll take a look at some more advanced topics, including garbage collectors, reference counting and automatic memory management.

(more…)

 

Memory Management – Part 1

January 25, 2012 by Rew

I was originally going to post a piece on iOS memory management, but it turned into a much larger piece on memory manangement in general. So, here’s the first part – other parts will follow later…

(more…)

 

XNA Skinned Model Animations

May 30, 2011 by Rew

The Skinned Model sample from the App Hub education catalogue is great for getting animated characters into your game, but there’s a bit of a flaw with the export process. The problem is, when you export your character from 3DS Max (and possibly other modelling programs), all you get is one animation, named ‘Take 001′. Wouldn’t it be nice if we could define different animations for different parts of the animation timeline? Well, we’re going to do just that :) . As an added bonus, we’ll also be adding in events, so you can be notified when certain parts of your animation are hit.

(more…)

 

Texture Atlas (Sprite Sheet) Generator

March 20, 2010 by Rew

A texture atlas, or sprite sheet, is a single image containing a number of smaller textures or sprites. This is useful as it is more efficient for the graphics card to process (it doesn’t have to keep switching textures when drawing different textures, as it can just use the single texture and sample from different parts of it). It is also faster to load into RAM, as you are only loading in one image, as opposed to several smaller ones, so the loading can be done in one stage.

(more…)

 

Windows Phone 7 Flashlight (With SOS)

March 19, 2010 by Rew

I tried posting this as a comment in reply to this post, but the code got mangled, so I’m posting it here :)

            graphics.GraphicsDevice.Clear(
                /* Check for touch panel being pressed */
            TouchPanel.GetState().Count == 0 ?
                /* Touch panel released, so reset the timer. This is stored in the target elapsed time, so we don't have to create any variables :) We also turn off IsFixedTimeStep, so that TargetElapsedTime isn't used. */
                ((((this.IsFixedTimeStep = false) == false) && ((this.TargetElapsedTime = TimeSpan.FromMilliseconds(Math.Max(1.0f, gameTime.TotalGameTime.TotalMilliseconds))) == TimeSpan.Zero)) ? Color.Gray : Color.Gray) :
                /* Touch panel pressed, so do SOS */
                (gameTime.TotalGameTime - this.TargetElapsedTime).Seconds < 1 ? Color.White :
                (((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds >= 2) && ((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds < 3)) ? Color.White :
                (((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds >= 4) && ((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds < 5)) ? Color.White :
                (((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds >= 7) && ((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds < 9)) ? Color.White :
                (((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds >= 10) && ((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds < 12)) ? Color.White :
                (((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds >= 13) && ((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds < 15)) ? Color.White :
                (((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds >= 17) && ((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds < 18)) ? Color.White :
                (((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds >= 19) && ((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds < 20)) ? Color.White :
                (((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds >= 21) && ((gameTime.TotalGameTime - this.TargetElapsedTime).Seconds < 22)) ? Color.White :
                Color.Black);

 

Converting a tile map into geometry

February 1, 2010 by Rew

I recently needed to convert a tile map consisting of squares and triangles into chunks of geometry and after trying a couple of different approaches, I eventually settled on one which seems to work. I didn’t come across it anywhere else, so I thought I’d post it here in case anyone else is wanting to do something similar.

(more…)

 

Facebook Connect Dialog on iPhone

January 10, 2010 by Rew

A problem I keep having when adding Facebook Connect to iPhone applications is that sometimes the dialogs appear briefly then disappear. I keep forgetting why it is for a while, so I thought I’d post this to help anyone who is having a similar problem, and to remind myself about it so that maybe next time I won’t forget :)

(more…)

 

The App Store Release Date

October 5, 2009 by Rew

So I think I’ve finally figured out how you should handle the release date when you’re submitting your app. From what I can see, when your app gets approved, it gets the release date you set when you submitted, even if the date it gets approved is AFTER the release date. Consequently, when your app appears on the App Store, it’s already a few pages down when sorted by release date. Not good :(

(more…)

Posted in: Developer Blog
Tags:
 

Two awkward things about iPhone development

June 7, 2009 by Rew

I’m currently in the process of porting The Galactic Aquarium to the iPhone now that the 360 version is done. While doing this, I’ve come across a couple of awkward points to do with UIKit on the iPhone, so I thought I’d share how I got around them.

(more…)