mirror of
https://github.com/DrBeef/Raze.git
synced 2025-04-25 00:40:54 +00:00
Allow -g, -x, -h, -j, and for the game, -d, to take their file name after a space. This allows quotes to be used with them properly.
I updated the help windows to prefer these variants because they are superior to the -xSquished versions. Also, factor out the command-line processing code for the above, plus con/def modules and clipmaps. git-svn-id: https://svn.eduke32.com/eduke32@4128 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
837c5c6b84
commit
ccf7d2d470
6 changed files with 194 additions and 98 deletions
|
@ -51,6 +51,11 @@ extern struct strllist *CommandPaths, *CommandGrps;
|
||||||
//// FUNCTIONS
|
//// FUNCTIONS
|
||||||
void G_AddGroup(const char *buffer);
|
void G_AddGroup(const char *buffer);
|
||||||
void G_AddPath(const char *buffer);
|
void G_AddPath(const char *buffer);
|
||||||
|
void G_AddDef(const char *buffer);
|
||||||
|
void G_AddDefModule(const char *buffer);
|
||||||
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
|
void G_AddClipMap(const char *buffer);
|
||||||
|
#endif
|
||||||
|
|
||||||
int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens);
|
int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens);
|
||||||
|
|
||||||
|
|
|
@ -90,16 +90,6 @@ static int32_t spnoclip=1;
|
||||||
static char *default_tiles_cfg = "tiles.cfg";
|
static char *default_tiles_cfg = "tiles.cfg";
|
||||||
static int32_t pathsearchmode_oninit;
|
static int32_t pathsearchmode_oninit;
|
||||||
|
|
||||||
char **g_scriptModules = NULL;
|
|
||||||
int32_t g_scriptModulesNum = 0;
|
|
||||||
char **g_defModules = NULL;
|
|
||||||
int32_t g_defModulesNum = 0;
|
|
||||||
|
|
||||||
#ifdef HAVE_CLIPSHAPE_FEATURE
|
|
||||||
char **g_clipMapFiles = NULL;
|
|
||||||
int32_t g_clipMapFilesNum = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LUNATIC
|
#ifdef LUNATIC
|
||||||
static L_State g_EmState;
|
static L_State g_EmState;
|
||||||
#endif
|
#endif
|
||||||
|
@ -8449,12 +8439,12 @@ int32_t ExtPreSaveMap(void)
|
||||||
static void G_ShowParameterHelp(void)
|
static void G_ShowParameterHelp(void)
|
||||||
{
|
{
|
||||||
const char *s = "Usage: mapster32 [files] [options]\n\n"
|
const char *s = "Usage: mapster32 [files] [options]\n\n"
|
||||||
"-g[file.grp], -grp [file.grp]\tLoad extra group file\n"
|
"-g [file.grp], -grp [file.grp]\tLoad extra group file\n"
|
||||||
"-h[file.def]\t\tLoad an alternate definitions file\n"
|
"-h [file.def]\t\tLoad an alternate definitions file\n"
|
||||||
"-x[game.con]\t\tLoad a custom CON script for getting sound definitions\n"
|
"-x [game.con]\t\tLoad a custom CON script for getting sound definitions\n"
|
||||||
"-mh [file.def]\t\tInclude additional definitions module\n"
|
"-mh [file.def]\t\tInclude additional definitions module\n"
|
||||||
"-mx [file.con]\t\tInclude additional CON module for getting sound definitions\n"
|
"-mx [file.con]\t\tInclude additional CON module for getting sound definitions\n"
|
||||||
"-j[dir], -game_dir [dir]\n"
|
"-j [dir], -game_dir [dir]\n"
|
||||||
"\t\t\tAdds a directory to the file path stack\n"
|
"\t\t\tAdds a directory to the file path stack\n"
|
||||||
"-cachesize #\t\tSets cache size, in Kb\n"
|
"-cachesize #\t\tSets cache size, in Kb\n"
|
||||||
"-check\t\t\tEnables map pointer checking when saving\n"
|
"-check\t\t\tEnables map pointer checking when saving\n"
|
||||||
|
@ -8622,13 +8612,37 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"x"))
|
||||||
|
{
|
||||||
|
if (argc > i+1)
|
||||||
|
{
|
||||||
|
G_AddCon(argv[i+1]);
|
||||||
|
COPYARG(i);
|
||||||
|
COPYARG(i+1);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!Bstrcasecmp(c+1,"mx"))
|
if (!Bstrcasecmp(c+1,"mx"))
|
||||||
{
|
{
|
||||||
if (argc > i+1)
|
if (argc > i+1)
|
||||||
{
|
{
|
||||||
g_scriptModules = (char **) Brealloc (g_scriptModules, (g_scriptModulesNum+1) * sizeof(char *));
|
G_AddConModule(argv[i+1]);
|
||||||
g_scriptModules[g_scriptModulesNum] = Bstrdup(argv[i+1]);
|
COPYARG(i);
|
||||||
++g_scriptModulesNum;
|
COPYARG(i+1);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"h"))
|
||||||
|
{
|
||||||
|
if (argc > i+1)
|
||||||
|
{
|
||||||
|
G_AddDef(argv[i+1]);
|
||||||
|
COPYARG(i);
|
||||||
|
COPYARG(i+1);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -8638,9 +8652,21 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc > i+1)
|
if (argc > i+1)
|
||||||
{
|
{
|
||||||
g_defModules = (char **) Brealloc (g_defModules, (g_defModulesNum+1) * sizeof(char *));
|
G_AddDefModule(argv[i+1]);
|
||||||
g_defModules[g_defModulesNum] = Bstrdup(argv[i+1]);
|
COPYARG(i);
|
||||||
++g_defModulesNum;
|
COPYARG(i+1);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"j"))
|
||||||
|
{
|
||||||
|
if (argc > i+1)
|
||||||
|
{
|
||||||
|
G_AddPath(argv[i+1]);
|
||||||
|
COPYARG(i);
|
||||||
|
COPYARG(i+1);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -8651,9 +8677,9 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc > i+1)
|
if (argc > i+1)
|
||||||
{
|
{
|
||||||
g_clipMapFiles = (char **) Brealloc (g_clipMapFiles, (g_clipMapFilesNum+1) * sizeof(char *));
|
G_AddClipMap(argv[i+1]);
|
||||||
g_clipMapFiles[g_clipMapFilesNum] = Bstrdup(argv[i+1]);
|
COPYARG(i);
|
||||||
++g_clipMapFilesNum;
|
COPYARG(i+1);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -8743,10 +8769,8 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
c++;
|
c++;
|
||||||
if (*c)
|
if (*c)
|
||||||
{
|
{
|
||||||
clearDefNamePtr();
|
G_AddDef(c);
|
||||||
g_defNamePtr = dup_filename(c);
|
|
||||||
COPYARG(i);
|
COPYARG(i);
|
||||||
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'j':
|
case 'j':
|
||||||
|
@ -8768,9 +8792,8 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
c++;
|
c++;
|
||||||
if (*c)
|
if (*c)
|
||||||
{
|
{
|
||||||
clearScriptNamePtr();
|
G_AddCon(c);
|
||||||
g_scriptNamePtr = dup_filename(c);
|
COPYARG(i);
|
||||||
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -8794,17 +8817,13 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
else if (!Bstrcasecmp(k,".def"))
|
else if (!Bstrcasecmp(k,".def"))
|
||||||
{
|
{
|
||||||
COPYARG(i);
|
COPYARG(i);
|
||||||
clearDefNamePtr();
|
G_AddDef(argv[i++]);
|
||||||
g_defNamePtr = dup_filename(argv[i++]);
|
|
||||||
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
else if (!Bstrcasecmp(k,".con"))
|
else if (!Bstrcasecmp(k,".con"))
|
||||||
{
|
{
|
||||||
COPYARG(i);
|
COPYARG(i);
|
||||||
clearScriptNamePtr();
|
G_AddCon(argv[i++]);
|
||||||
g_scriptNamePtr = dup_filename(argv[i++]);
|
|
||||||
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -359,6 +359,16 @@ void G_CleanupSearchPaths(void)
|
||||||
|
|
||||||
struct strllist *CommandPaths, *CommandGrps;
|
struct strllist *CommandPaths, *CommandGrps;
|
||||||
|
|
||||||
|
char **g_scriptModules = NULL;
|
||||||
|
int32_t g_scriptModulesNum = 0;
|
||||||
|
char **g_defModules = NULL;
|
||||||
|
int32_t g_defModulesNum = 0;
|
||||||
|
|
||||||
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
|
char **g_clipMapFiles = NULL;
|
||||||
|
int32_t g_clipMapFilesNum = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
void G_AddGroup(const char *buffer)
|
void G_AddGroup(const char *buffer)
|
||||||
{
|
{
|
||||||
char buf[BMAX_PATH];
|
char buf[BMAX_PATH];
|
||||||
|
@ -397,6 +407,43 @@ void G_AddPath(const char *buffer)
|
||||||
CommandPaths = s;
|
CommandPaths = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void G_AddDef(const char *buffer)
|
||||||
|
{
|
||||||
|
clearDefNamePtr();
|
||||||
|
g_defNamePtr = dup_filename(buffer);
|
||||||
|
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void G_AddDefModule(const char *buffer)
|
||||||
|
{
|
||||||
|
g_defModules = (char **) Brealloc (g_defModules, (g_defModulesNum+1) * sizeof(char *));
|
||||||
|
g_defModules[g_defModulesNum] = Bstrdup(buffer);
|
||||||
|
++g_defModulesNum;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef HAVE_CLIPSHAPE_FEATURE
|
||||||
|
void G_AddClipMap(const char *buffer)
|
||||||
|
{
|
||||||
|
g_clipMapFiles = (char **) Brealloc (g_clipMapFiles, (g_clipMapFilesNum+1) * sizeof(char *));
|
||||||
|
g_clipMapFiles[g_clipMapFilesNum] = Bstrdup(buffer);
|
||||||
|
++g_clipMapFilesNum;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void G_AddCon(const char *buffer)
|
||||||
|
{
|
||||||
|
clearScriptNamePtr();
|
||||||
|
g_scriptNamePtr = dup_filename(buffer);
|
||||||
|
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
||||||
|
}
|
||||||
|
|
||||||
|
void G_AddConModule(const char *buffer)
|
||||||
|
{
|
||||||
|
g_scriptModules = (char **) Brealloc (g_scriptModules, (g_scriptModulesNum+1) * sizeof(char *));
|
||||||
|
g_scriptModules[g_scriptModulesNum] = Bstrdup(buffer);
|
||||||
|
++g_scriptModulesNum;
|
||||||
|
}
|
||||||
|
|
||||||
//////////
|
//////////
|
||||||
|
|
||||||
int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens)
|
int32_t getatoken(scriptfile *sf, const tokenlist *tl, int32_t ntokens)
|
||||||
|
|
|
@ -52,6 +52,12 @@ extern const char *G_GrpFile(void);
|
||||||
extern const char *G_DefaultConFile(void);
|
extern const char *G_DefaultConFile(void);
|
||||||
extern const char *G_ConFile(void);
|
extern const char *G_ConFile(void);
|
||||||
|
|
||||||
|
extern char **g_scriptModules;
|
||||||
|
extern int32_t g_scriptModulesNum;
|
||||||
|
|
||||||
|
extern void G_AddCon(const char *buffer);
|
||||||
|
extern void G_AddConModule(const char *buffer);
|
||||||
|
|
||||||
extern void clearGrpNamePtr(void);
|
extern void clearGrpNamePtr(void);
|
||||||
extern void clearDefNamePtr(void);
|
extern void clearDefNamePtr(void);
|
||||||
extern void clearScriptNamePtr(void);
|
extern void clearScriptNamePtr(void);
|
||||||
|
|
|
@ -138,18 +138,9 @@ const char *g_gameNamePtr = NULL;
|
||||||
// g_rtsNamePtr can point to an argv[] element
|
// g_rtsNamePtr can point to an argv[] element
|
||||||
const char *g_rtsNamePtr = NULL;
|
const char *g_rtsNamePtr = NULL;
|
||||||
|
|
||||||
char **g_scriptModules = NULL;
|
|
||||||
int32_t g_scriptModulesNum = 0;
|
|
||||||
char **g_defModules = NULL;
|
|
||||||
int32_t g_defModulesNum = 0;
|
|
||||||
int32_t g_dependencyCRC = 0;
|
int32_t g_dependencyCRC = 0;
|
||||||
int32_t g_usingAddon = 0;
|
int32_t g_usingAddon = 0;
|
||||||
|
|
||||||
#ifdef HAVE_CLIPSHAPE_FEATURE
|
|
||||||
char **g_clipMapFiles = NULL;
|
|
||||||
int32_t g_clipMapFilesNum = 0;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int32_t g_Shareware = 0;
|
int32_t g_Shareware = 0;
|
||||||
|
|
||||||
#define MAXUSERQUOTES 6
|
#define MAXUSERQUOTES 6
|
||||||
|
@ -9009,10 +9000,10 @@ static void G_ShowParameterHelp(void)
|
||||||
#endif
|
#endif
|
||||||
"-connect [host]\tConnect to a multiplayer game\n"
|
"-connect [host]\tConnect to a multiplayer game\n"
|
||||||
"-c#\t\tUse MP mode #, 1 = Dukematch, 2 = Coop, 3 = Dukematch(no spawn)\n"
|
"-c#\t\tUse MP mode #, 1 = Dukematch, 2 = Coop, 3 = Dukematch(no spawn)\n"
|
||||||
"-d[file.edm or demonum]\tPlay a demo\n"
|
"-d [file.edm or demonum]\tPlay a demo\n"
|
||||||
"-g[file.grp]\tLoad additional game data\n"
|
"-g [file.grp]\tLoad additional game data\n"
|
||||||
"-h[file.def]\tLoad an alternate definitions file\n"
|
"-h [file.def]\tLoad an alternate definitions file\n"
|
||||||
"-j[dir]\t\tAdds a directory to EDuke32's search list\n"
|
"-j [dir]\t\tAdds a directory to EDuke32's search list\n"
|
||||||
"-l#\t\tWarp to level #, see -v\n"
|
"-l#\t\tWarp to level #, see -v\n"
|
||||||
"-map [file.map]\tLoads a map\n"
|
"-map [file.map]\tLoads a map\n"
|
||||||
"-mh [file.def]\tInclude an additional definitions module\n"
|
"-mh [file.def]\tInclude an additional definitions module\n"
|
||||||
|
@ -9032,7 +9023,7 @@ static void G_ShowParameterHelp(void)
|
||||||
"-u#########\tUser's favorite weapon order (default: 3425689071)\n"
|
"-u#########\tUser's favorite weapon order (default: 3425689071)\n"
|
||||||
"-v#\t\tWarp to volume #, see -l\n"
|
"-v#\t\tWarp to volume #, see -l\n"
|
||||||
"-ww2gi\t\tRun in WWII GI compatibility mode\n"
|
"-ww2gi\t\tRun in WWII GI compatibility mode\n"
|
||||||
"-x[game.con]\tLoad custom CON script\n"
|
"-x [game.con]\tLoad custom CON script\n"
|
||||||
"-#\t\tLoad and run a game from slot # (0-9)\n"
|
"-#\t\tLoad and run a game from slot # (0-9)\n"
|
||||||
// "\n-?/--help\tDisplay this help message and exit\n"
|
// "\n-?/--help\tDisplay this help message and exit\n"
|
||||||
"\nSee eduke32 -debughelp for debug parameters"
|
"\nSee eduke32 -debughelp for debug parameters"
|
||||||
|
@ -9531,6 +9522,36 @@ static int32_t G_CheckCmdSwitch(int32_t argc, const char **argv, const char *str
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void G_AddDemo(const char* param)
|
||||||
|
{
|
||||||
|
char * colon = (char *)Bstrchr(param, ':');
|
||||||
|
int32_t framespertic=-1, numrepeats=1;
|
||||||
|
|
||||||
|
if (colon && colon != param)
|
||||||
|
{
|
||||||
|
// -d<filename>:<num>[,<num>]
|
||||||
|
// profiling options
|
||||||
|
*(colon++) = 0;
|
||||||
|
Bsscanf(colon, "%u,%u", &framespertic, &numrepeats);
|
||||||
|
}
|
||||||
|
|
||||||
|
Demo_SetFirst(param);
|
||||||
|
|
||||||
|
if (framespertic < 0)
|
||||||
|
{
|
||||||
|
initprintf("Play demo %s.\n", g_firstDemoFile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
framespertic = clamp(framespertic, 0, 8)+1;
|
||||||
|
// TODO: repeat count and gathering statistics.
|
||||||
|
initprintf("Profile demo %s, %d frames/gametic, repeated 1x.\n", g_firstDemoFile,
|
||||||
|
framespertic-1);
|
||||||
|
Demo_PlayFirst(framespertic, 1);
|
||||||
|
g_noLogo = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void G_CheckCommandLine(int32_t argc, const char **argv)
|
static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
int16_t i = 1, j;
|
int16_t i = 1, j;
|
||||||
|
@ -9799,13 +9820,31 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"x"))
|
||||||
|
{
|
||||||
|
if (argc > i+1)
|
||||||
|
{
|
||||||
|
G_AddCon(argv[i+1]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if (!Bstrcasecmp(c+1,"mx"))
|
if (!Bstrcasecmp(c+1,"mx"))
|
||||||
{
|
{
|
||||||
if (argc > i+1)
|
if (argc > i+1)
|
||||||
{
|
{
|
||||||
g_scriptModules = (char **) Brealloc (g_scriptModules, (g_scriptModulesNum+1) * sizeof(char *));
|
G_AddConModule(argv[i+1]);
|
||||||
g_scriptModules[g_scriptModulesNum] = Bstrdup(argv[i+1]);
|
i++;
|
||||||
++g_scriptModulesNum;
|
}
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"h"))
|
||||||
|
{
|
||||||
|
if (argc > i+1)
|
||||||
|
{
|
||||||
|
G_AddDef(argv[i+1]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -9815,9 +9854,27 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc > i+1)
|
if (argc > i+1)
|
||||||
{
|
{
|
||||||
g_defModules = (char **) Brealloc (g_defModules, (g_defModulesNum+1) * sizeof(char *));
|
G_AddDefModule(argv[i+1]);
|
||||||
g_defModules[g_defModulesNum] = Bstrdup(argv[i+1]);
|
i++;
|
||||||
++g_defModulesNum;
|
}
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"j"))
|
||||||
|
{
|
||||||
|
if (argc > i+1)
|
||||||
|
{
|
||||||
|
G_AddPath(argv[i+1]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
i++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!Bstrcasecmp(c+1,"d"))
|
||||||
|
{
|
||||||
|
if (argc > i+1)
|
||||||
|
{
|
||||||
|
G_AddDemo(argv[i+1]);
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -9828,9 +9885,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
{
|
{
|
||||||
if (argc > i+1)
|
if (argc > i+1)
|
||||||
{
|
{
|
||||||
g_clipMapFiles = (char **) Brealloc (g_clipMapFiles, (g_clipMapFilesNum+1) * sizeof(char *));
|
G_AddClipMap(argv[i+1]);
|
||||||
g_clipMapFiles[g_clipMapFilesNum] = Bstrdup(argv[i+1]);
|
|
||||||
++g_clipMapFilesNum;
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
|
@ -9933,34 +9988,9 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
break;
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
{
|
{
|
||||||
char * colon = (char *)Bstrchr(c, ':');
|
|
||||||
int32_t framespertic=-1, numrepeats=1;
|
|
||||||
|
|
||||||
c++;
|
c++;
|
||||||
|
if (*c)
|
||||||
if (colon && colon != c)
|
G_AddDemo(c);
|
||||||
{
|
|
||||||
// -d<filename>:<num>[,<num>]
|
|
||||||
// profiling options
|
|
||||||
*(colon++) = 0;
|
|
||||||
Bsscanf(colon, "%u,%u", &framespertic, &numrepeats);
|
|
||||||
}
|
|
||||||
|
|
||||||
Demo_SetFirst(c);
|
|
||||||
|
|
||||||
if (framespertic < 0)
|
|
||||||
{
|
|
||||||
initprintf("Play demo %s.\n", g_firstDemoFile);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
framespertic = clamp(framespertic, 0, 8)+1;
|
|
||||||
// TODO: repeat count and gathering statistics.
|
|
||||||
initprintf("Profile demo %s, %d frames/gametic, repeated 1x.\n", g_firstDemoFile,
|
|
||||||
framespertic-1);
|
|
||||||
Demo_PlayFirst(framespertic, 1);
|
|
||||||
g_noLogo = 1;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#ifdef LUNATIC
|
#ifdef LUNATIC
|
||||||
|
@ -9975,11 +10005,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
case 'h':
|
case 'h':
|
||||||
c++;
|
c++;
|
||||||
if (*c)
|
if (*c)
|
||||||
{
|
G_AddDef(c);
|
||||||
clearDefNamePtr();
|
|
||||||
g_defNamePtr = dup_filename(c);
|
|
||||||
initprintf("Using DEF file \"%s\".\n",g_defNamePtr);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'j':
|
case 'j':
|
||||||
c++;
|
c++;
|
||||||
|
@ -10127,11 +10153,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
|
||||||
case 'x':
|
case 'x':
|
||||||
c++;
|
c++;
|
||||||
if (*c)
|
if (*c)
|
||||||
{
|
G_AddCon(c);
|
||||||
clearScriptNamePtr();
|
|
||||||
g_scriptNamePtr = dup_filename(c);
|
|
||||||
initprintf("Using CON file \"%s\".\n",g_scriptNamePtr);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case '0':
|
case '0':
|
||||||
case '1':
|
case '1':
|
||||||
|
|
|
@ -245,9 +245,6 @@ extern const char *s_buildDate;
|
||||||
extern const char *g_gameNamePtr;
|
extern const char *g_gameNamePtr;
|
||||||
extern const char *g_rtsNamePtr;
|
extern const char *g_rtsNamePtr;
|
||||||
|
|
||||||
extern char **g_scriptModules;
|
|
||||||
extern int32_t g_scriptModulesNum;
|
|
||||||
|
|
||||||
extern char CheatStrings[][MAXCHEATLEN];
|
extern char CheatStrings[][MAXCHEATLEN];
|
||||||
extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH];
|
extern char boardfilename[BMAX_PATH], currentboardfilename[BMAX_PATH];
|
||||||
extern char boardfilename[BMAX_PATH];
|
extern char boardfilename[BMAX_PATH];
|
||||||
|
|
Loading…
Reference in a new issue