From 186bec3342f31313f5c5423dc140b502ca380a0e Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 19 Jan 2001 03:36:08 +0000 Subject: [PATCH] remove the hardcoding of qw from all but the default server gamedir. This should take care of skin downloads when using --with-newstyle --- acconfig.h | 3 +++ configure.in | 2 ++ include/quakefs.h | 1 + source/cl_parse.c | 12 ++++++------ source/quakefs.c | 11 ++++++----- 5 files changed, 18 insertions(+), 11 deletions(-) diff --git a/acconfig.h b/acconfig.h index 62ebc4c..13aa439 100644 --- a/acconfig.h +++ b/acconfig.h @@ -28,6 +28,9 @@ /* Define this to the base game for the engine to load */ #undef BASEGAME +/* Define this to the base directory for the client to download skins to */ +#undef SKINBASE + /* Define this to use experimental code */ #undef _EXPERIMENTAL_ diff --git a/configure.in b/configure.in index bd77759..3948bf8 100644 --- a/configure.in +++ b/configure.in @@ -937,6 +937,7 @@ if test "x$newstyle" = xyes -o "x$newstyle" = "x"; then AC_MSG_RESULT([new style]) AC_DEFINE(NEWSTYLE) AC_DEFINE(BASEGAME, "base") + AC_DEFINE(SKINBASE, "base") default_globalconf="/etc/$PACKAGE.conf" eval foo="$datadir" default_sharepath="$foo/games/$PACKAGE" @@ -944,6 +945,7 @@ if test "x$newstyle" = xyes -o "x$newstyle" = "x"; then else AC_MSG_RESULT([old style (id Software defaults)]) AC_DEFINE(BASEGAME, "id1") + AC_DEFINE(SKINBASE, "qw") if test "x$SYSTYPE" = xWIN32; then default_globalconf="%WINDIR%/$PACKAGE.conf" else diff --git a/include/quakefs.h b/include/quakefs.h index 120e223..1b85737 100644 --- a/include/quakefs.h +++ b/include/quakefs.h @@ -41,6 +41,7 @@ extern cvar_t *fs_userpath; extern cvar_t *fs_sharepath; +extern cvar_t *fs_skinbase; extern int com_filesize; struct cache_user_s; diff --git a/source/cl_parse.c b/source/cl_parse.c index 8b832bd..0c2a367 100644 --- a/source/cl_parse.c +++ b/source/cl_parse.c @@ -448,8 +448,8 @@ CL_ParseDownload (void) snprintf (name, sizeof (name), "%s/%s", com_gamedir, cls.downloadtempname); else - snprintf (name, sizeof (name), "%s/qw/%s", fs_userpath->string, - cls.downloadtempname); + snprintf (name, sizeof (name), "%s/%s/%s", fs_userpath->string, + fs_skinbase->string, cls.downloadtempname); COM_CreatePath (name); @@ -501,10 +501,10 @@ CL_ParseDownload (void) snprintf (newn, sizeof (newn), "%s/%s", com_gamedir, cls.downloadname); } else { - snprintf (oldn, sizeof (oldn), "%s/qw/%s", fs_userpath->string, - cls.downloadtempname); - snprintf (newn, sizeof (newn), "%s/qw/%s", fs_userpath->string, - cls.downloadname); + snprintf (oldn, sizeof (oldn), "%s/%s/%s", fs_userpath->string, + fs_skinbase->string, cls.downloadtempname); + snprintf (newn, sizeof (newn), "%s/%s/%s", fs_userpath->string, + fs_skinbase->string, cls.downloadname); } r = Qrename (oldn, newn); if (r) diff --git a/source/quakefs.c b/source/quakefs.c index f4f7746..d307ec4 100644 --- a/source/quakefs.c +++ b/source/quakefs.c @@ -121,6 +121,7 @@ char gamedirfile[MAX_OSPATH]; cvar_t *fs_userpath; cvar_t *fs_sharepath; cvar_t *fs_basegame; +cvar_t *fs_skinbase; int com_filesize; @@ -984,9 +985,7 @@ COM_Gamedir (char *dir) // Cache_Flush (); - if (strcmp (dir, fs_basegame->string) == 0) - return; - if (strcmp (dir, "qw") == 0 && strcmp (fs_basegame->string, "id1") == 0) + if (strcmp (dir, fs_skinbase->string) == 0) return; COM_AddGameDirectory (dir); @@ -1056,8 +1055,8 @@ COM_Filesystem_Init (void) COM_CreateGameDirectory (fs_basegame->string); // If we're dealing with id1, use qw too - if (stricmp (fs_basegame->string, "id1") == 0) { - COM_CreateGameDirectory ("qw"); + if (!strequal (fs_basegame->string, fs_skinbase->string) == 0) { + COM_CreateGameDirectory (fs_skinbase->string); } if ((i = COM_CheckParm ("-game")) && i < com_argc - 1) { @@ -1085,6 +1084,8 @@ COM_Filesystem_Init_Cvars (void) "location of your game directories"); fs_basegame = Cvar_Get ("fs_basegame", BASEGAME, CVAR_ROM, "game to use by default"); + fs_skinbase= Cvar_Get ("fs_skinbase", SKINBASE, CVAR_ROM, + "location of skins dir for downloads"); } /*