Improved MacOS X port to be better at finding its working directory and

not require a startup script. (It can now be debugged from within Xcode.)


git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1539 4a71c877-e1ca-e34f-864e-861f7616d084
master
Ari Johnson 2007-04-26 17:11:57 +00:00
parent 185060e303
commit ae3e4927c7
3 changed files with 18 additions and 18 deletions

View File

@ -5,7 +5,9 @@
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>warzone.sh</string>
<string>Warzone</string>
<key>CFBundleIconFile</key>
<string>Warzone.icns</string>
<key>CFBundleIdentifier</key>
<string>net.wz2100.Warzone</string>
<key>CFBundleInfoDictionaryVersion</key>
@ -16,7 +18,5 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleIconFile</key>
<string>Warzone.icns</string>
</dict>
</plist>

View File

@ -2839,7 +2839,6 @@
02356D730BD3BB3400E9A019 /* Frameworks */,
02581C7D0BD5ACEE00957CBC /* Copy frameworks */,
02581CC40BD5AD5300957CBC /* Copy game data */,
02581D680BD5BD6B00957CBC /* Create startup script */,
);
buildRules = (
0246AA730BD3E47F004D1C70 /* PBXBuildRule */,
@ -3156,20 +3155,6 @@
shellPath = /bin/sh;
shellScript = "mkdir -p ${TARGET_BUILD_DIR}/Warzone.app/Contents/Resources\nrm -rf ${TARGET_BUILD_DIR}/Warzone.app/Contents/Resources/data\ntar -cC .. --exclude .svn --exclude 'Makefile*' data | tar -xC ${TARGET_BUILD_DIR}/Warzone.app/Contents/Resources\n";
};
02581D680BD5BD6B00957CBC /* Create startup script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Create startup script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "cd ${TARGET_BUILD_DIR}/Warzone.app/Contents/MacOS\ncat <<EOF > warzone.sh\n#!/bin/sh\n\nMYDIR=\\`dirname \"\\$0\"\\`\ncd \"\\$MYDIR\"\nexec ./Warzone --datadir ../Resources/data\nEOF\nchmod 755 warzone.sh\n";
};
02FD38210BD3FE9A00776FD3 /* Fetch source */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;

View File

@ -332,6 +332,21 @@ static void scanDataDirs( void )
}
}
#ifdef WZ_OS_MAC
if( !PHYSFS_exists("gamedesc.lev") ) {
CFURLRef resourceURL = CFBundleCopyResourcesDirectoryURL(CFBundleGetMainBundle());
char resourcePath[PATH_MAX];
if( CFURLGetFileSystemRepresentation( resourceURL, true,
(UInt8 *) resourcePath,
PATH_MAX) ) {
chdir( resourcePath );
registerSearchPath( "data", 7 );
rebuildSearchPath( mod_multiplay, TRUE );
} else {
debug( LOG_ERROR, "Could not change to resources directory." );
}
}
#endif
/** Debugging and sanity checks **/