load custom quakespasm.pak from <com_basedir> instead of id1/

git-svn-id: http://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@906 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
sezero 2014-04-28 05:40:28 +00:00
parent d2f537967f
commit ec5d6ba83d
3 changed files with 18 additions and 9 deletions

View file

@ -1,11 +1,12 @@
support for user directories, based on uhexen2 and tyrquake: initial experimental support for user directories, based on uhexen2
** against quakespasm svn revision 905. and tyrquake:
** against quakespasm svn revision 906.
** on-the-fly game directory switching not supported yet. ** on-the-fly game directory switching not supported yet.
** minimally tested, needs more work. ** minimally tested, needs more work.
Index: Quake/sys_sdl_unix.c Index: Quake/sys_sdl_unix.c
=================================================================== ===================================================================
--- Quake/sys_sdl_unix.c (revision 905) --- Quake/sys_sdl_unix.c (revision 906)
+++ Quake/sys_sdl_unix.c (working copy) +++ Quake/sys_sdl_unix.c (working copy)
@@ -20,6 +20,8 @@ @@ -20,6 +20,8 @@
@ -73,7 +74,7 @@ Index: Quake/sys_sdl_unix.c
void Sys_mkdir (const char *path) void Sys_mkdir (const char *path)
Index: Quake/common.c Index: Quake/common.c
=================================================================== ===================================================================
--- Quake/common.c (revision 905) --- Quake/common.c (revision 906)
+++ Quake/common.c (working copy) +++ Quake/common.c (working copy)
@@ -1919,6 +1919,7 @@ static void COM_AddGameDirectory (const @@ -1919,6 +1919,7 @@ static void COM_AddGameDirectory (const
searchpath_t *search; searchpath_t *search;
@ -91,7 +92,15 @@ Index: Quake/common.c
// add the directory to the search path // add the directory to the search path
search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t)); search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));
search->path_id = path_id; search->path_id = path_id;
@@ -1963,6 +1965,14 @@ static void COM_AddGameDirectory (const @@ -1943,6 +1945,7 @@ static void COM_AddGameDirectory (const
qspak = NULL;
else {
qboolean old = com_modified;
+ if (been_here) base = host_parms->basedir;
q_snprintf (pakfile, sizeof(pakfile), "%s/quakespasm.pak", base);
qspak = COM_LoadPackFile (pakfile);
com_modified = old;
@@ -1963,6 +1966,14 @@ static void COM_AddGameDirectory (const
} }
if (!pak) break; if (!pak) break;
} }

View file

@ -1943,9 +1943,9 @@ static void COM_AddGameDirectory (const char *base, const char *dir)
qspak = NULL; qspak = NULL;
else { else {
qboolean old = com_modified; qboolean old = com_modified;
q_snprintf (pakfile, sizeof(pakfile), "%s/quakespasm.pak", com_gamedir); q_snprintf (pakfile, sizeof(pakfile), "%s/quakespasm.pak", base);
qspak = COM_LoadPackFile (pakfile); qspak = COM_LoadPackFile (pakfile);
com_modified = old;/* make quakespasm customization pak to not set com_modified. */ com_modified = old;
} }
if (pak) { if (pak) {
search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t)); search = (searchpath_t *) Z_Malloc(sizeof(searchpath_t));