Changeset View
Changeset View
Standalone View
Standalone View
head/games/ioquake3/files/patch-code-sys-sys_main.c
--- code/sys/sys_main.c.orig 2009-03-02 23:26:36.000000000 +0100 | --- code/sys/sys_main.c.orig 2009-03-02 22:26:36 UTC | ||||
+++ code/sys/sys_main.c 2009-12-08 11:31:12.000000000 +0100 | +++ code/sys/sys_main.c | ||||
@@ -49,6 +49,7 @@ | @@ -49,6 +49,7 @@ Foundation, Inc., 51 Franklin St, Fifth | ||||
static char binaryPath[ MAX_OSPATH ] = { 0 }; | static char binaryPath[ MAX_OSPATH ] = { 0 }; | ||||
static char installPath[ MAX_OSPATH ] = { 0 }; | static char installPath[ MAX_OSPATH ] = { 0 }; | ||||
+static char libPath[ MAX_OSPATH ] = { 0 }; | +static char libPath[ MAX_OSPATH ] = { 0 }; | ||||
/* | /* | ||||
================= | ================= | ||||
@@ -95,6 +96,30 @@ | @@ -95,6 +96,30 @@ char *Sys_DefaultInstallPath(void) | ||||
/* | /* | ||||
================= | ================= | ||||
+Sys_SetDefaultLibPath | +Sys_SetDefaultLibPath | ||||
+================= | +================= | ||||
+*/ | +*/ | ||||
+void Sys_SetDefaultLibPath(const char *path) | +void Sys_SetDefaultLibPath(const char *path) | ||||
+{ | +{ | ||||
Show All 14 Lines | |||||
+} | +} | ||||
+ | + | ||||
+ | + | ||||
+/* | +/* | ||||
+================= | +================= | ||||
Sys_DefaultAppPath | Sys_DefaultAppPath | ||||
================= | ================= | ||||
*/ | */ | ||||
@@ -384,6 +409,7 @@ | @@ -384,6 +409,7 @@ Used to load a development dll instead o | ||||
#1 look down current path | #1 look down current path | ||||
#2 look in fs_homepath | #2 look in fs_homepath | ||||
#3 look in fs_basepath | #3 look in fs_basepath | ||||
+#4 look in fs_libpath | +#4 look in fs_libpath | ||||
================= | ================= | ||||
*/ | */ | ||||
void *Sys_LoadDll( const char *name, char *fqpath , | void *Sys_LoadDll( const char *name, char *fqpath , | ||||
@@ -394,6 +420,7 @@ | @@ -394,6 +420,7 @@ void *Sys_LoadDll( const char *name, cha | ||||
void (*dllEntry)( intptr_t (*syscallptr)(intptr_t, ...) ); | void (*dllEntry)( intptr_t (*syscallptr)(intptr_t, ...) ); | ||||
char fname[MAX_OSPATH]; | char fname[MAX_OSPATH]; | ||||
char *basepath; | char *basepath; | ||||
+ char *libpath; | + char *libpath; | ||||
char *homepath; | char *homepath; | ||||
char *pwdpath; | char *pwdpath; | ||||
char *gamedir; | char *gamedir; | ||||
@@ -405,6 +432,7 @@ | @@ -405,6 +432,7 @@ void *Sys_LoadDll( const char *name, cha | ||||
// TODO: use fs_searchpaths from files.c | // TODO: use fs_searchpaths from files.c | ||||
pwdpath = Sys_Cwd(); | pwdpath = Sys_Cwd(); | ||||
basepath = Cvar_VariableString( "fs_basepath" ); | basepath = Cvar_VariableString( "fs_basepath" ); | ||||
+ libpath = Cvar_VariableString( "fs_libpath" ); | + libpath = Cvar_VariableString( "fs_libpath" ); | ||||
homepath = Cvar_VariableString( "fs_homepath" ); | homepath = Cvar_VariableString( "fs_homepath" ); | ||||
gamedir = Cvar_VariableString( "fs_game" ); | gamedir = Cvar_VariableString( "fs_game" ); | ||||
@@ -413,6 +441,9 @@ | @@ -413,6 +441,9 @@ void *Sys_LoadDll( const char *name, cha | ||||
if(!libHandle && homepath) | if(!libHandle && homepath) | ||||
libHandle = Sys_TryLibraryLoad(homepath, gamedir, fname, fqpath); | libHandle = Sys_TryLibraryLoad(homepath, gamedir, fname, fqpath); | ||||
+ if(!libHandle && libpath) | + if(!libHandle && libpath) | ||||
+ libHandle = Sys_TryLibraryLoad(libpath, gamedir, fname, fqpath); | + libHandle = Sys_TryLibraryLoad(libpath, gamedir, fname, fqpath); | ||||
+ | + | ||||
if(!libHandle && basepath) | if(!libHandle && basepath) | ||||
libHandle = Sys_TryLibraryLoad(basepath, gamedir, fname, fqpath); | libHandle = Sys_TryLibraryLoad(basepath, gamedir, fname, fqpath); | ||||
@@ -469,6 +500,10 @@ | @@ -469,6 +500,10 @@ void Sys_ParseArgs( int argc, char **arg | ||||
# endif | # endif | ||||
#endif | #endif | ||||
+#ifndef DEFAULT_LIBDIR | +#ifndef DEFAULT_LIBDIR | ||||
+# define DEFAULT_LIBDIR DEFAULT_BASEDIR | +# define DEFAULT_LIBDIR DEFAULT_BASEDIR | ||||
+#endif | +#endif | ||||
+ | + | ||||
/* | /* | ||||
================= | ================= | ||||
Sys_SigHandler | Sys_SigHandler | ||||
@@ -540,6 +575,7 @@ | @@ -540,6 +575,7 @@ int main( int argc, char **argv ) | ||||
Sys_ParseArgs( argc, argv ); | Sys_ParseArgs( argc, argv ); | ||||
Sys_SetBinaryPath( Sys_Dirname( argv[ 0 ] ) ); | Sys_SetBinaryPath( Sys_Dirname( argv[ 0 ] ) ); | ||||
Sys_SetDefaultInstallPath( DEFAULT_BASEDIR ); | Sys_SetDefaultInstallPath( DEFAULT_BASEDIR ); | ||||
+ Sys_SetDefaultLibPath( DEFAULT_LIBDIR ); | + Sys_SetDefaultLibPath( DEFAULT_LIBDIR ); | ||||
// Concatenate the command line for passing to Com_Init | // Concatenate the command line for passing to Com_Init | ||||
for( i = 1; i < argc; i++ ) | for( i = 1; i < argc; i++ ) |