aboutsummaryrefslogtreecommitdiffstats
path: root/code/qcommon/files.c
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-12-14 21:53:57 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-12-14 21:53:57 +0000
commitdfa688010700e8d1dadbe2bd6919e73d499b27ca (patch)
tree7573f20264932c532df99ec75395a485cfdef794 /code/qcommon/files.c
parent7fda2bcce8db155720ec8bfe16b7ea17667aaf89 (diff)
downloadioquake3-aero-dfa688010700e8d1dadbe2bd6919e73d499b27ca.tar.gz
ioquake3-aero-dfa688010700e8d1dadbe2bd6919e73d499b27ca.zip
Add gamedirectory in .app to searchpath on MacOSX
git-svn-id: svn://svn.icculus.org/quake3/trunk@1239 edf5b092-35ff-0310-97b2-ce42778d08ea
Diffstat (limited to 'code/qcommon/files.c')
-rw-r--r--code/qcommon/files.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/code/qcommon/files.c b/code/qcommon/files.c
index cf989c4..5d19916 100644
--- a/code/qcommon/files.c
+++ b/code/qcommon/files.c
@@ -234,6 +234,12 @@ typedef struct searchpath_s {
static char fs_gamedir[MAX_OSPATH]; // this will be a single file name with no separators
static cvar_t *fs_debug;
static cvar_t *fs_homepath;
+
+#ifdef MACOS_X
+// Also search the .app bundle for .pk3 files
+static cvar_t *fs_apppath;
+#endif
+
static cvar_t *fs_basepath;
static cvar_t *fs_basegame;
static cvar_t *fs_gamedirvar;
@@ -2392,7 +2398,7 @@ Sets fs_gamedir, adds the directory to the head of the path,
then loads the zip headers
================
*/
-static void FS_AddGameDirectory( const char *path, const char *dir ) {
+void FS_AddGameDirectory( const char *path, const char *dir ) {
searchpath_t *sp;
int i;
searchpath_t *search;
@@ -2723,6 +2729,14 @@ static void FS_Startup( const char *gameName )
FS_AddGameDirectory( fs_basepath->string, gameName );
}
// fs_homepath is somewhat particular to *nix systems, only add if relevant
+
+ #ifdef MACOS_X
+ fs_apppath = Cvar_Get ("fs_apppath", Sys_DefaultAppPath(), CVAR_INIT );
+ // Make MacOSX also include the base path included with the .app bundle
+ if (fs_apppath->string[0])
+ FS_AddGameDirectory(fs_apppath->string, gameName);
+ #endif
+
// NOTE: same filtering below for mods and basegame
if (fs_homepath->string[0] && Q_stricmp(fs_homepath->string,fs_basepath->string)) {
FS_AddGameDirectory ( fs_homepath->string, gameName );