OpenSource game need a MacOs porter...
Malarkey Wrote:Yeah, I had already done that and it still couldn't find the image files. Then I figured out that double-clicking on them from the Finder apparently changes where the current directory is but running them from the command line works.
while technically, you should probably move the media into the Resources part of the Application bundle and search it using bundle functions, you could tuck something like this into the application somewhere early (like in the init code) as a quick and dirty workaround.
CFBundleRef appMainBundle = CFBundleGetMainBundle();
CFURLRef urlRef = CFBundleCopyBundleURL(appMainBundle);
CFStringRef ref = CFURLCopyFileSystemPath(urlRef, kCFURLPOSIXPathStyle);
chdir (CFStringGetCStringPtr(ref, kCFStringEncodingMacRoman));
It's not pretty, but it works. I often use that during the initial stages of porting an app
Possibly Related Threads...
|Xcode 4 SDL/OpenGL MacOS -> iOS Recompilation||SparkyNZ||4||8,290||
Apr 4, 2011 01:33 PM
Last Post: SparkyNZ
|JEDI-SDL, MacOS X and XCode Tutorial||savage||5||10,284||
Jun 7, 2007 04:01 AM
Last Post: savage