Multiple dirs may be specified on cmdline now. -game dir1,dir2,...,dirN

Use commas, not spaces or quotes or anything---the function used to do the
parsing is ... unintelligent.  ;>  Something better than the current
method will appear when we migrate to a better cmdline parser.
This commit is contained in:
Joseph Carter 2000-01-22 09:16:19 +00:00
parent 1cc41775a7
commit fd5c61e51a
2 changed files with 30 additions and 4 deletions

10
NEWS
View file

@ -1,6 +1,16 @@
NEWS for the QuakeForge project
-------------------------------
22 Jan 2000 - changes to command line option -game
You may now specify multiple game directories with -game. If for
example you wanted to use the original registered game with MegaTF
on a new style binary you would use -game id1,megatf. It does work
with traditional style binaries and you may specify as many dirs as
you like seperated by commas.
One caveat: Most mods were designed to be the only one in use, it
may be a Bad Thing to mix certain mods with other mods.
19 Jan 2000 - changes to cvar r_fog
Fog color is once again white. The r_fog cvar is now a control for
the fog density rather than a simple toggle control. Eric Windisch

View file

@ -21,6 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// common.c -- misc functions used in client and server
#include "quakedef.h"
#include <string.h>
#define NUM_SAFE_ARGVS 7
@ -1651,9 +1652,11 @@ COM_InitFilesystem
*/
void COM_InitFilesystem (void)
{
int i, j;
char basedir[MAX_OSPATH];
searchpath_t *search;
int i, j, len;
char basedir[MAX_OSPATH];
searchpath_t *search;
char * p;
char * games;
//
// -basedir <path>
@ -1709,7 +1712,20 @@ void COM_InitFilesystem (void)
if (i && i < com_argc-1)
{
com_modified = true;
COM_AddGameDirectory (va("%s/%s", basedir, com_argv[i+1]));
len = strlen(com_argv[i+1]) + 1;
games = (char *)malloc(len);
strcpy(games, com_argv[i+1]);
for (p = strtok(games, ",");
p != NULL;
p = strtok(NULL, ",")) {
COM_AddGameDirectory (va("%s/%s", basedir, p));
}
free(games);
// COM_AddGameDirectory (va("%s/%s", basedir, com_argv[i+1]));
}
//