Last Ray of Hope Home of Kaluriel Hargrove

31Mar/11Off

Syntax Highlighting

The syntax highlight I've been using for a while now, SyntaxHighlighter Evolved, destroyed my post earlier. So I did a bit of research and got a much better one called WP-SynHighlight.

Although I haven't figured out how to reedit pasted code yet, its much faster for inserting code since it adds a button to the visual toolbar. However it does mean all my old code snippets need update with the new one... maybe there is a plugin to do that too.

Tagged as: No Comments
31Mar/11Off

iOS Vector and Matrix Math

LEGO HazmatContinued on post iOS Vector and Matrix Math: Part 2.

For the past week or two I've been trying to reproduce the water effect of PixelJunk Shooter on the iPhone, however I seem to have reached a bottleneck with the collision detection used for repulsion when compressing.

I tried changing from Length to Length Squared, to Manhattan Distance, but it still grinded my framerate to 1FPS.

I decided to see if the Accelerate Framework in the iOS SDK had the vector math added to it yet, and to my surprise it had. It may have been added a while ago and I missed it. So I began to replace my math functions with the vector ones.

The strides are for the single precision functions are the number of floats. So for a stride of 8 bytes, you need to use 2.

float vec[2];
 
vDSP_vclr( &vec[0], 1, 2 );

This function sets the contents of a vector to zero. The equivalent function would be this

void vDSP_vclr( float * inVec, const int inStride, const unsigned int inCount )
{
	for( unsigned int idx = 0; idx < inCount; ++idx )
	{
		*inVec = 0.0f;
		inVec += inStride;
	}
}

I haven't used the double precision version of the vector library yet so I don't know if the stride is the count of doubles, or of floats.

I have managed to go from 17 FPS for 650 particles to 30 FPS (I originally had it at 300 particles at 30FPS but it turned out I was profiling in debug). A definite improvement from using the Accelerate library functions for 2d vector math. One of my main issues for getting 1FPS originally was I was island producer was hit testing each particle with itself so it always had the maximum number of particles on each island.

The next couple of pages on this post cover some of the functions (vector and matrix) and their equivalent C++ function.

26Mar/11Off

Xcode4: Issue Navigator

Xcode 4.0.1 seems to partially fix the issue with the Issue Navigator not jumping to code in a header that has an error.

However only the header that is wrong shows up as not red and may have duplicate entries in the list, so keep scrolling to find it.

EDIT: Warnings do not seem to work still however when they are in headers.

Tagged as: No Comments
25Mar/11Off

Xcode4: Adding Local Git Repository to a Xcode3 project

Shooter 2 Secret Area

With the new version of xcode4 it comes with the option to version control source code locally.

However when opening old Xcode3 projects, it does not ask you if you want to add a local repository.

To add one is simple, open up Terminal and navigate to your xcode project folder.

Now enter the following without quotes:

"git init"

"git add ."

Depending on the size of your project folder, it may take a little time before it finishes. Once done, reboot xcode and your project should now be detected by xcode4 as under source control.

I had to recommit all my files before it showed up properly the organiser.

  • File Menu
  • Source Control > Commit...
  • Click Commit
Tagged as: , No Comments
25Mar/11Off

Nintendo 3DS

Blue Nintendo 3DSAs a rule of thumb I don't usually goto midnight launches, but there is one thing I really hate and that is lines, more specifically being stuck in crowds of people.

So I took my chances and head to the Game store nearby to trade in my old DSi XL and buy a game or two. There wasn't long to wait, and I got my hands on a copy of Deadly Premonition for the XBox 360 which I heard was good.

For the 3DS I only got the Splinter Cell 3D (Zoe Mode's Crush3D will be coming out in a few months).

Pokemon White doesn't look any different, maybe a little washed out on the top screen. Though I have noticed that the 3DS finally supports WPA and not just WEP which means I can upgrade my router.

The augmented reality games that come with the 3DS are pretty fun, and I can't play the Street Pass RPG yet, I might head around Churchill Square for a while and see if I can pick up some players to rescue my Mii.

Tagged as: , No Comments
24Mar/11Off

Xcode4: Building without running and the Issue Navigator

In Xcode3 I liked how you could customise your icon toolbar, so I could build a project without running it. Although you can do live builds in Xcode4 sometimes its nice just to clean and rebuild when it doesn't detect the change that breaks it.

You cannot add icons, so instead keyboard shortcuts are needed to build without running, hold shift while clicking Run, or alternatively press the combination of command + b.

Also in Xcode3, I liked how I could quickly moved back and forth between code and the build errors window

Something which by default doesn't happen in Xcode4, being replaced with the Issue Navigator.

However it can be opened up in a tab.

  • Open up the Xcode menu, and select Preferences...
  • Select Behaviours, and then select Build generates new issues.
  • Simply check the Show Tab option, and fill in a tab name, I called mine 'Build Errors'.

Now when you build, if you have any build errors a new tab will open up showing the issue navigator.

I seem to be having trouble getting some header files to work in the issue navigator, there are a few posts about it on the developer forums, so I will have to submit a bug report.

There is a new Xcode4 update, 4.0.1 which requires yet another 4gb download.

Tagged as: No Comments