XCode, App and Data files

Apprentice
Posts: 7
Joined: 2009.08
Post: #1
So, I have been building my game on the Mac using XCode, SDL and OpenGL for a while now and I am actually in danger of completing one. It suddenly occurs to me that I don't actually know how to package one up. By that I mean how do I get the final App package to contain the data and get the App to read from it. Up till now I have set the absolute path. Any help/tips on this will be helpful!
Quote this message in a reply
⌘-R in Chief
Posts: 1,237
Joined: 2002.05
Post: #2
Dump your assets folder into your Xcode project. Use "Create Folder References...". Xcode will copy that folder into the Resources directory of the application package (YourGame.app/Contents/Resources/YourAssetsFolder). Then you could reference it relative to the current working directory (or change the directory) which can be done with plain C, or you could use a Cocoa method to get at the Resources folder path and use that, or SDL might have something to get at the Resources path as well (I'm not sure).
Quote this message in a reply
Apprentice
Posts: 7
Joined: 2009.08
Post: #3
I have a copy of XCode 3 unleashed that I have been working through in order to solve this little issue and your one little post cut through all that like a hot knife through butter. Thanks!
Quote this message in a reply
Member
Posts: 245
Joined: 2005.11
Post: #4
I don't trust XCode to include my resources on its own - it tends not to notice when they change. For that reason I use a custom build phase to run rsync to copy my resources into the bundle for me.
Code:
rsync -r [i]ProjectFolder/Resources AppBundlePath/Contents/Resources[/i]
Quote this message in a reply
Moderator
Posts: 370
Joined: 2006.08
Post: #5
Are you using any .dylibs? If so, there may be some special requirements.

Worlds at War (Current Project) - http://www.awkward-games.com/forum/
Quote this message in a reply
Apprentice
Posts: 7
Joined: 2009.08
Post: #6
I am using one dylib and have setup the DYLD_LIBRARY_PATH variable to point at the library concerned. Took a bit of digging to find that one too.
Quote this message in a reply
Post Reply