[iortcw] 399/497: All: Don't add fs_steampath unless defined
Simon McVittie
smcv at debian.org
Fri Sep 8 10:37:36 UTC 2017
This is an automated email from the git hooks/post-receive script.
smcv pushed a commit to annotated tag 1.42d
in repository iortcw.
commit e4e979747569cb80a3bd6f250fb827cb9242e7c2
Author: MAN-AT-ARMS <M4N4T4RMS at gmail.com>
Date: Wed Sep 23 18:44:18 2015 -0400
All: Don't add fs_steampath unless defined
---
MP/code/qcommon/files.c | 7 +++++++
MP/code/qcommon/q_shared.h | 2 +-
MP/code/qcommon/qcommon.h | 3 +++
MP/code/sys/sys_unix.c | 4 ++++
MP/code/sys/sys_win32.c | 4 ++++
SP/code/qcommon/files.c | 7 +++++++
SP/code/qcommon/q_shared.h | 2 +-
SP/code/qcommon/qcommon.h | 3 +++
SP/code/sys/sys_unix.c | 4 ++++
SP/code/sys/sys_win32.c | 4 ++++
10 files changed, 38 insertions(+), 2 deletions(-)
diff --git a/MP/code/qcommon/files.c b/MP/code/qcommon/files.c
index 448cb51..a53944d 100644
--- a/MP/code/qcommon/files.c
+++ b/MP/code/qcommon/files.c
@@ -251,7 +251,10 @@ static cvar_t *fs_homepath;
// Also search the .app bundle for .pk3 files
static cvar_t *fs_apppath;
#endif
+
+#ifdef STEAMPATH_NAME
static cvar_t *fs_steampath;
+#endif
static cvar_t *fs_basepath;
static cvar_t *fs_basegame;
@@ -752,6 +755,7 @@ long FS_SV_FOpenFileRead( const char *filename, fileHandle_t *fp ) {
fsh[f].handleSync = qfalse;
}
+#ifdef STEAMPATH_NAME
// Check fs_steampath too
if (!fsh[f].handleFiles.file.o && fs_steampath->string[0])
{
@@ -766,6 +770,7 @@ long FS_SV_FOpenFileRead( const char *filename, fileHandle_t *fp ) {
fsh[f].handleFiles.file.o = Sys_FOpen( ospath, "rb" );
fsh[f].handleSync = qfalse;
}
+#endif
if ( !fsh[f].handleFiles.file.o )
@@ -3482,10 +3487,12 @@ static void FS_Startup( const char *gameName ) {
fs_gamedirvar = Cvar_Get( "fs_game", "", CVAR_INIT | CVAR_SYSTEMINFO );
// add search path elements in reverse priority order
+#ifdef STEAMPATH_NAME
fs_steampath = Cvar_Get ("fs_steampath", Sys_SteamPath(), CVAR_INIT|CVAR_PROTECTED );
if (fs_steampath->string[0]) {
FS_AddGameDirectory( fs_steampath->string, gameName, qtrue );
}
+#endif
if ( fs_basepath->string[0] ) {
FS_AddGameDirectory( fs_basepath->string, gameName, qtrue );
}
diff --git a/MP/code/qcommon/q_shared.h b/MP/code/qcommon/q_shared.h
index 0d800dd..ad3ebf2 100644
--- a/MP/code/qcommon/q_shared.h
+++ b/MP/code/qcommon/q_shared.h
@@ -49,7 +49,7 @@ If you have questions concerning this license or the applicable additional terms
#define CLIENT_WINDOW_MIN_TITLE "changeme2"
#define HOMEPATH_NAME_UNIX ".foo"
#define HOMEPATH_NAME_WIN "FooBar"
- #define STEAMPATH_NAME "Foo Bar"
+// #define STEAMPATH_NAME "Foo Bar"
#define HOMEPATH_NAME_MACOSX HOMEPATH_NAME_WIN
#define GAMENAME_FOR_MASTER "foobar" // must NOT contain whitespace
// #define LEGACY_PROTOCOL // You probably don't need this for your standalone game
diff --git a/MP/code/qcommon/qcommon.h b/MP/code/qcommon/qcommon.h
index 620cbe9..c6dee66 100644
--- a/MP/code/qcommon/qcommon.h
+++ b/MP/code/qcommon/qcommon.h
@@ -1229,7 +1229,10 @@ FILE *Sys_Mkfifo( const char *ospath );
char *Sys_Cwd( void );
char *Sys_DefaultBasePath( void );
char *Sys_DefaultInstallPath( void );
+
+#ifdef STEAMPATH_NAME
char *Sys_SteamPath(void);
+#endif
#ifdef MACOS_X
char *Sys_DefaultAppPath(void);
diff --git a/MP/code/sys/sys_unix.c b/MP/code/sys/sys_unix.c
index db2facc..35bafd2 100644
--- a/MP/code/sys/sys_unix.c
+++ b/MP/code/sys/sys_unix.c
@@ -44,8 +44,10 @@ qboolean stdinIsATTY;
// Used to determine where to store user-specific files
static char homePath[ MAX_OSPATH ] = { 0 };
+#ifdef STEAMPATH_NAME
// Used to store the Steam RTCW installation path
static char steamPath[ MAX_OSPATH ] = { 0 };
+#endif
/*
==================
@@ -81,6 +83,7 @@ char *Sys_DefaultHomePath(void)
return homePath;
}
+#ifdef STEAMPATH_NAME
/*
================
Sys_SteamPath
@@ -105,6 +108,7 @@ char *Sys_SteamPath( void )
return steamPath;
}
+#endif
/*
================
diff --git a/MP/code/sys/sys_win32.c b/MP/code/sys/sys_win32.c
index e1ab9eb..9150993 100644
--- a/MP/code/sys/sys_win32.c
+++ b/MP/code/sys/sys_win32.c
@@ -42,8 +42,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// Used to determine where to store user-specific files
static char homePath[ MAX_OSPATH ] = { 0 };
+#ifdef STEAMPATH_NAME
// Used to store the Steam RTCW installation path
static char steamPath[ MAX_OSPATH ] = { 0 };
+#endif
#ifndef DEDICATED
static UINT timerResolution = 0;
@@ -130,6 +132,7 @@ char *Sys_DefaultHomePath( void )
return homePath;
}
+#ifdef STEAMPATH_NAME
/*
================
Sys_SteamPath
@@ -160,6 +163,7 @@ char *Sys_SteamPath( void )
return steamPath;
}
+#endif
/*
================
diff --git a/SP/code/qcommon/files.c b/SP/code/qcommon/files.c
index f5e45db..65639e6 100644
--- a/SP/code/qcommon/files.c
+++ b/SP/code/qcommon/files.c
@@ -254,7 +254,10 @@ static cvar_t *fs_homepath;
// Also search the .app bundle for .pk3 files
static cvar_t *fs_apppath;
#endif
+
+#ifdef STEAMPATH_NAME
static cvar_t *fs_steampath;
+#endif
static cvar_t *fs_basepath;
static cvar_t *fs_basegame;
@@ -859,6 +862,7 @@ long FS_SV_FOpenFileRead(const char *filename, fileHandle_t *fp)
fsh[f].handleSync = qfalse;
}
+#ifdef STEAMPATH_NAME
// Check fs_steampath too
if (!fsh[f].handleFiles.file.o && fs_steampath->string[0])
{
@@ -873,6 +877,7 @@ long FS_SV_FOpenFileRead(const char *filename, fileHandle_t *fp)
fsh[f].handleFiles.file.o = Sys_FOpen( ospath, "rb" );
fsh[f].handleSync = qfalse;
}
+#endif
if ( !fsh[f].handleFiles.file.o )
{
@@ -3486,10 +3491,12 @@ static void FS_Startup( const char *gameName )
fs_gamedirvar = Cvar_Get( "fs_game", "", CVAR_INIT | CVAR_SYSTEMINFO );
// add search path elements in reverse priority order
+#ifdef STEAMPATH_NAME
fs_steampath = Cvar_Get ("fs_steampath", Sys_SteamPath(), CVAR_INIT|CVAR_PROTECTED );
if (fs_steampath->string[0]) {
FS_AddGameDirectory( fs_steampath->string, gameName );
}
+#endif
if ( fs_basepath->string[0] ) {
FS_AddGameDirectory( fs_basepath->string, gameName );
}
diff --git a/SP/code/qcommon/q_shared.h b/SP/code/qcommon/q_shared.h
index 94848d4..b7d2026 100644
--- a/SP/code/qcommon/q_shared.h
+++ b/SP/code/qcommon/q_shared.h
@@ -47,7 +47,7 @@ If you have questions concerning this license or the applicable additional terms
#define CLIENT_WINDOW_MIN_TITLE "changeme2"
#define HOMEPATH_NAME_UNIX ".foo"
#define HOMEPATH_NAME_WIN "FooBar"
- #define STEAMPATH_NAME "Foo Bar"
+// #define STEAMPATH_NAME "Foo Bar"
#define HOMEPATH_NAME_MACOSX HOMEPATH_NAME_WIN
#define GAMENAME_FOR_MASTER "foobar" // must NOT contain whitespace
// #define LEGACY_PROTOCOL // You probably don't need this for your standalone game
diff --git a/SP/code/qcommon/qcommon.h b/SP/code/qcommon/qcommon.h
index 487ba8e..508a420 100644
--- a/SP/code/qcommon/qcommon.h
+++ b/SP/code/qcommon/qcommon.h
@@ -1145,7 +1145,10 @@ FILE *Sys_Mkfifo( const char *ospath );
char *Sys_Cwd( void );
char *Sys_DefaultBasePath( void );
char *Sys_DefaultInstallPath( void );
+
+#ifdef STEAMPATH_NAME
char *Sys_SteamPath(void);
+#endif
#ifdef MACOS_X
char *Sys_DefaultAppPath(void);
diff --git a/SP/code/sys/sys_unix.c b/SP/code/sys/sys_unix.c
index d3f8a88..72aa1f6 100644
--- a/SP/code/sys/sys_unix.c
+++ b/SP/code/sys/sys_unix.c
@@ -44,8 +44,10 @@ qboolean stdinIsATTY;
// Used to determine where to store user-specific files
static char homePath[ MAX_OSPATH ] = { 0 };
+#ifdef STEAMPATH_NAME
// Used to store the Steam RTCW installation path
static char steamPath[ MAX_OSPATH ] = { 0 };
+#endif
/*
==================
@@ -81,6 +83,7 @@ char *Sys_DefaultHomePath(void)
return homePath;
}
+#ifdef STEAMPATH_NAME
/*
================
Sys_SteamPath
@@ -105,6 +108,7 @@ char *Sys_SteamPath( void )
return steamPath;
}
+#endif
/*
================
diff --git a/SP/code/sys/sys_win32.c b/SP/code/sys/sys_win32.c
index 8f644dc..8d8b192 100644
--- a/SP/code/sys/sys_win32.c
+++ b/SP/code/sys/sys_win32.c
@@ -42,8 +42,10 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
// Used to determine where to store user-specific files
static char homePath[ MAX_OSPATH ] = { 0 };
+#ifdef STEAMPATH_NAME
// Used to store the Steam RTCW installation path
static char steamPath[ MAX_OSPATH ] = { 0 };
+#endif
#ifndef DEDICATED
static UINT timerResolution = 0;
@@ -130,6 +132,7 @@ char *Sys_DefaultHomePath( void )
return homePath;
}
+#ifdef STEAMPATH_NAME
/*
================
Sys_SteamPath
@@ -160,6 +163,7 @@ char *Sys_SteamPath( void )
return steamPath;
}
+#endif
/*
================
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/iortcw.git
More information about the Pkg-games-commits
mailing list