Keep forgetting to update, so this is useless as a dev blog
Anyway, after seeing the nasty grams sent out about the Breakout clones on the App store, I’ve spent a few days putting together a Mac OS X build of the game, just in case.
The first day was a serious falling out between me and XCode. I just wanted to add another target to the project file and then build them all from the same project without having different windows open. Obviously there’d be some changes in what files were compiled, but there’s a target ownership flag that Gaz pointed me out which would do the job. Although, to be fair, he also said to just create a new project as it’s easier, but I figured it’d be nice to actually get all the targets working from the same project. More fool me
I must have spent 4 or 5 hours trying to get this to work, but despite the settings saying one thing, the actual build process seemed to do something different. Even going through the pbxproj files showed different things
In the end, the pre-compiled AppKit headers would get built twice (or more) and the nib wouldn’t reference properly either of which would result in a billion errors and no build. Not to mention all the resources getting copied to different places in the application bundle. Lots of stress, no fun and I never did suss it out, so instead I created a new project file with just the Mac Target in, which with the *exact* same settings, worked absolutely fine first time. I’ll take the advice in future
The actual port was cool. UIKit/AppKit and the UI*/NS* classes are largely the same when it comes down to it, the changes I found were for stuff that’s understandably iPhone specific. The only really gotcha I tripped up on was the lack of simple way to get a CGImageRef from an NSImage, something my texture code was doing in one line on the iPhone. Meant a couple of hours of nothing visible in my window, which was a let down, but once sussed, the game popped straight up.
Actually, that’s my biggest gripe about coding with Apple libs. There’re loads of built in types, many of which on the face of it look largely similar, so it’s always confusing to know which to use. I’ve found a few times that I’ve used the wrong type initially, so when, say, saving stuff out, I’ve either had to re-write a load of code to put everything to the right type, or do some voodoo conversion at the last minute. And ObjC just doesn’t look nice in the editor. It’s hard to format clearly…
Despite that, a lot of the Mac SDK is starting to make sense now, and tbh that’s been my only real frustration. The flip side has been a super speedy knocking up windows, text boxes, inputs or whatever and the docs have always provided really solid examples that I’ve been able to bend about. There’re some slight changes to the game for the Mac version: Slightly bigger ball (Rik’s advice :D), it’s locked in at 60fps (instead of 50) and you don’t get to touch the screen to enter your name, but other than that I’ve hardly had to do any specific tweaks or code changes which is awesome
I’m really really surprised at how quick and pleasant the whole experience has been, tbh. I was expecting a massive faff
I’ve just got the Mac XML-RPC stuff to do, then it’s decision time as to what to do with each version…

