Port early, port often

Published May 14, 2007
Advertisement
After a lot of frustration I've got my unit test and SDL test projects running in Xcode under MacOS. It's good to know that the only problem with my code was not including SDL.h in my SDL main C++ file and using **argv instead of *argv[]. Oh, and stupidly inserting the SDL header files in my third party library directory; that causes some nasty clashes.

All the other problems stemmed from my lack of experience with using Xcode. It took me ages to realise that if I wanted to link to a library such as Boost test all I had to do was insert it into the project; I was hunting for a build option in the menu for a linker option and scouring through the help documents for how to link libraries, but there wasn't a help page that simply states "just add it into the Xcode project, stupid". There were also a whole bunch of frameworks I had to drag in for some reason which involved having my PC open to Google and hunting for which linker error corresponded to which framework.

Still, it works now. The unit tests all pass, and the SDL test runs without errors. My SDL test doesn't actually do anything except make a log file and write settings to a file, but that works too. It's nice to know that the file system works just as well on Windows as it does in Mac OS X.

At the moment PhysicsFS writes to the default directory of (Your Home Directory)/.Diagonal/(AppName), where the terms in brackets are replaced with the obvious replacements. Without an uninstall facility this will leave junk on your system if you delete one of my apps, which is a particular problem in Unix flavoured systems as directories that begin with a dot are hidden.

Possible solutions to this problem are:
  1. Make my applications so awesome that no one would ever want to delete them
  2. Add uninstall capabilities for each platform
  3. Put the directories in a more obvious place so people can delete them if they wish
Option 2 should wait until much later. I'd like to release a few downloadable demos that just might possibly violate option 1 (unthinkable as it is). So that leaves me with Option 3. But where exactly is the best place to store these directories on Windows (any flavour) and Mac OS X?
Previous Entry Diagonal Updates
Next Entry Graphics Design
0 likes 4 comments

Comments

Ravuya
Fuck yeah. Wait until you see how easy it is to build a universal binary. [grin]

Also, don't forget to move your Frameworks into the "Copy Files" phase of the target; this copies the libraries inside the application bundle so your end-user doesn't have to install SDL, etc themselves.

With some modification of the SDLmain.m file, you can also put your game data inside the application bundle, which keeps it from being tampered with.

I can walk you through it if you're having trouble.
May 15, 2007 12:14 AM
Trapper Zoid
Quote:Original post by Ravuya
Fuck yeah. Wait until you see how easy it is to build a universal binary. [grin]

Also, don't forget to move your Frameworks into the "Copy Files" phase of the target; this copies the libraries inside the application bundle so your end-user doesn't have to install SDL, etc themselves.

Neat; I was wondering how to package the SDL libraries up for distribution. That's pretty simple to do.

By a stroke of luck my brother has a PowerBook, so I can send him demos to test out universal binaries.

Quote:With some modification of the SDLmain.m file, you can also put your game data inside the application bundle, which keeps it from being tampered with.

Could be useful, although I don't really mind people tampering with my game data.

Quote:I can walk you through it if you're having trouble.

It's good to know there's some good Mac developers on the forums [grin].

May 15, 2007 02:26 AM
Ravuya
Hah.

I notice now I forgot to answer your original post! Jeez, I'm a clown. Traditionally, Apple wants you to put per-user files for an application in ~/Library/Application Support... the PropaneFS code has some Carbon code for getting that Unicode path for the current user (you can't hardcode it since it's called something different in Japan).

However, this method isn't quite working for uninstallation -- I don't know how AppZapper works, but it isn't picking up my Glow save files when I try to zap Glow with it.

On Windows, the PropaneFS code shoves it in My Documents\My Games.. but the Japanese thing applies there too so I have a piece of code to get the CSIDL_PERSONAL path out of the OS.
May 15, 2007 08:38 AM
Trapper Zoid
That's simple enough then; I can look at PropaneFS to glean the system functions I need. Thanks again!
May 15, 2007 04:10 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement
Advertisement