git-svn-id: https://svn.eduke32.com/eduke32@468 1a8010ca-5511-0410-912e-c29ae57300e0

This commit is contained in:
terminx 2007-01-22 05:00:57 +00:00
parent 8ca2a3f33b
commit 23a468d956
4 changed files with 72 additions and 46 deletions

View file

@ -242,10 +242,19 @@ static int osdcmd_vidmode(const osdfuncparm_t *parm)
extern int startwin_run(void); extern int startwin_run(void);
extern char *defsfilename; // set in bstub.c extern char *defsfilename; // set in bstub.c
char **grps = NULL;
char grpstoadd = 0;
void buildaddgroup(const char *buffer)
{
grps = (char**)realloc(grps, sizeof(char*)*(grpstoadd+1));
grps[grpstoadd++] = strdup(buffer);
}
int app_main(int argc, char **argv) int app_main(int argc, char **argv)
{ {
char ch, quitflag, cmdsetup = 0, grpstoadd = 0; char ch, quitflag, cmdsetup = 0;
char **grps = NULL;
long i, j, k; long i, j, k;
pathsearchmode = 1; // unrestrict findfrompath so that full access to the filesystem can be had pathsearchmode = 1; // unrestrict findfrompath so that full access to the filesystem can be had
@ -270,8 +279,7 @@ int app_main(int argc, char **argv)
if (!strcmp(argv[i], "-setup")) cmdsetup = 1; if (!strcmp(argv[i], "-setup")) cmdsetup = 1;
else if (!strcmp(argv[i], "-g") || !strcmp(argv[i], "-grp")) { else if (!strcmp(argv[i], "-g") || !strcmp(argv[i], "-grp")) {
i++; i++;
grps = (char**)realloc(grps, sizeof(char*)*(grpstoadd+1)); buildaddgroup(argv[i]);
grps[grpstoadd++] = argv[i];
} }
else if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "--help") || !strcmp(argv[i], "-?")) { else if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "--help") || !strcmp(argv[i], "-?")) {
char *s = char *s =
@ -320,6 +328,7 @@ int app_main(int argc, char **argv)
for (i=0;i<grpstoadd;i++) { for (i=0;i<grpstoadd;i++) {
initprintf("Adding %s\n",grps[i]); initprintf("Adding %s\n",grps[i]);
initgroupfile(grps[i]); initgroupfile(grps[i]);
free(grps[i]);
} }
free(grps); free(grps);
} }

View file

@ -4312,17 +4312,17 @@ void ExtPreLoadMap(void)
static void comlinehelp(void) static void comlinehelp(void)
{ {
char *s = "Syntax: mapster32 [options]\n\n" char *s = "Usage: mapster32 [OPTIONS] [FILE]\n\n"
"-?\t\tThis help message\n" "-gFILE, -grp FILE\t\tUse extra group file FILE\n"
"-gFILE\t\tUse multiple group files\n" "-hFILE\t\tUse definitions file FILE\n"
"-jDIRECTORY\tAdd a directory to the file path stack\n" "-jDIR, -game_dir DIR\n\t\tAdds DIR to the file path stack\n"
"-hFILE\t\tUse FILE instead of DUKE3D.DEF\n"
#if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2) #if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2)
"-setup\t\tDisplays the configuration dialog\n" "-setup\t\tDisplays the configuration dialog\n"
#endif #endif
#if !defined(_WIN32) #if !defined(_WIN32)
"-usecwd\t\tRead game data and configuration file from working directory\n" "-usecwd\t\tRead game data and configuration file from working directory\n"
#endif #endif
"\n-?, -help, --help\tDisplay this help message and exit"
; ;
wm_msgbox("Mapster32 Command Line Help",s); wm_msgbox("Mapster32 Command Line Help",s);
} }
@ -4343,6 +4343,8 @@ static void addgamepath(const char *buffer)
CommandPaths = s; CommandPaths = s;
} }
extern void buildaddgroup(const char *buffer);
static void checkcommandline(int argc,char **argv) static void checkcommandline(int argc,char **argv)
{ {
int i = 1; int i = 1;
@ -4355,6 +4357,12 @@ static void checkcommandline(int argc,char **argv)
c = argv[i]; c = argv[i];
if (((*c == '/') || (*c == '-'))) if (((*c == '/') || (*c == '-')))
{ {
if (!Bstrcasecmp(c+1,"?") || !Bstrcasecmp(c+1,"help") || !Bstrcasecmp(c+1,"-help"))
{
comlinehelp();
exit(0);
}
if (!Bstrcasecmp(c+1,"game_dir")) if (!Bstrcasecmp(c+1,"game_dir"))
{ {
if (argc > i+1) if (argc > i+1)
@ -4402,10 +4410,6 @@ static void checkcommandline(int argc,char **argv)
c++; c++;
switch (*c) switch (*c)
{ {
case '?':
comlinehelp();
exit(0);
break;
case 'h': case 'h':
case 'H': case 'H':
c++; c++;
@ -4421,6 +4425,12 @@ static void checkcommandline(int argc,char **argv)
if (!*c) break; if (!*c) break;
addgamepath(c); addgamepath(c);
break; break;
case 'g':
case 'G':
c++;
if (!*c) break;
buildaddgroup(c);
break;
} }
} }
i++; i++;
@ -6017,7 +6027,7 @@ static void FuncMenu(void)
for (j=0;j<MAXSPRITES-1;j++) for (j=0;j<MAXSPRITES-1;j++)
if (sprite[j].picnum == i) if (sprite[j].picnum == i)
deletesprite(j), k++; deletesprite(j), k++;
Bsprintf(tempbuf,"%d sprite\(s\) deleted",k); Bsprintf(tempbuf,"%d sprite(s) deleted",k);
printmessage16(tempbuf); printmessage16(tempbuf);
} }
else printmessage16("Aborted"); else printmessage16("Aborted");

View file

@ -604,7 +604,11 @@ int32 CONFIG_ReadSetup(void)
SCRIPT_GetString(scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]); SCRIPT_GetString(scripthandle, "Comm Setup","RTSName",&ud.rtsname[0]);
SCRIPT_GetString(scripthandle, "Misc","SelectedGRP",&duke3dgrp[0]); {
extern char defaultduke3dgrp[BMAX_PATH];
if (!Bstrcmp(defaultduke3dgrp,"duke3d.grp"))
SCRIPT_GetString(scripthandle, "Misc","SelectedGRP",&duke3dgrp[0]);
}
SCRIPT_GetNumber(scripthandle, "Screen Setup", "Shadows",&ud.shadows); SCRIPT_GetNumber(scripthandle, "Screen Setup", "Shadows",&ud.shadows);

View file

@ -8103,39 +8103,40 @@ FAKE_F3:
static void comlinehelp(void) static void comlinehelp(void)
{ {
char *s = "Syntax: eduke32 [options]\n\n" char *s = "Usage: eduke32 [OPTIONS]\n"
"-?\t\tThis help message\n" "Example: eduke32 -q4 -a -m -tx -map nukeland.map\n\n"
"-l##\t\tLevel (1-11)\n" "-NUM\t\tLoad and run a game from slot NUM (0-9)\n"
"-v#\t\tVolume (1-4)\n" "-a\t\tUse fake player AI (fake multiplayer only)\n"
"-s#\t\tSkill (1-4)\n" "-cNUM\t\tUse MP mode NUM, 1 = DukeMatch(spawn), 2 = Coop, 3 = Dukematch(no spawn)\n"
"-r\t\tRecord demo\n"
"-dFILE\t\tStart to play demo FILE\n" "-dFILE\t\tStart to play demo FILE\n"
"-m\t\tNo monsters\n" /* "-fNUM\t\tSend fewer packets in multiplayer (1, 2, 4) (deprecated)\n" */
"-ns\t\tNo sound\n" "-gFILE, -grp FILE\t\tUse extra group file FILE\n"
"-nm\t\tNo music\n" "-hFILE\t\tUse definitions file FILE\n"
"-t#\t\tRespawn, 1 = Monsters, 2 = Items, 3 = Inventory, x = All\n" "-iNUM\t\tUse networking mode NUM (1/0) (multiplayer only) (default == 1)\n"
"-c#\t\tMP mode, 1 = DukeMatch(spawn), 2 = Coop, 3 = Dukematch(no spawn)\n" "-jDIR\n-game_dir DIR\t\tAdds DIR to the file path stack\n"
"-q#\t\tFake multiplayer (2-8 players)\n" "-lNUM\t\tWarp to level NUM (1-11), see -v\n"
"-a\t\tUse player AI (fake multiplayer only)\n" "-m\t\tDisable monsters\n"
"-i#\t\tNetwork mode (1/0) (multiplayer only) (default == 1)\n" "-map FILE\tUse user map FILE\n"
"-f#\t\tSend fewer packets (1, 2, 4) (multiplayer only)\n" "-name NAME\tUse NAME as multiplayer name\n"
"-gFILE\t\tUse multiple group files (must be last on command line)\n" "-nD\t\tDump default gamevars to gamevars.txt\n"
"-jDIRECTORY\tAdd a directory to the file path stack\n" "-net\t\tNetwork play; see documentation\n"
"-hFILE\t\tUse FILE instead of DUKE3D.DEF\n" "-nm\t\tDisable music\n"
"-xFILE\t\tUse specified CON file (default EDUKE.CON/GAME.CON)\n" "-ns\t\tDisable sound\n"
"-u#########\tUser's favorite weapon order (default: 3425689071)\n" "-qNUM\t\tUse NUM players for fake multiplayer (2-8)\n"
"-#\t\tLoad and run a game (slot 0-9)\n" "-r\t\tRecord demo\n"
"-map FILE\tUse a map FILE\n" "-sNUM\t\tUse skill level NUM (1-4)\n"
"-name NAME\tFoward NAME\n"
"-net\t\tNet mode game\n"
#if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2) #if defined RENDERTYPEWIN || (defined RENDERTYPESDL && !defined __APPLE__ && defined HAVE_GTK2)
"-setup\t\tDisplays the configuration dialog\n" "-setup\t\tDisplays the configuration dialog\n"
#endif #endif
"-nD\t\tDump game definitions to gamevars.txt\n" "-tNUM\t\tUse respawn mode NUM, 1 = Monsters, 2 = Items, 3 = Inventory, x = All\n"
"-u#########\tUser's favorite weapon order (default: 3425689071)\n"
#if !defined(_WIN32) #if !defined(_WIN32)
"-usecwd\t\tRead game data and configuration file from working directory\n" "-usecwd\t\tRead game data and configuration file from working directory\n"
#endif #endif
"-condebug, -z#\tLine-by-line CON compilation debugging" "-vNUM\t\tWarp to volume NUM (1-4), see -l\n"
"-xFILE\t\tLoad CON script FILE (default EDUKE.CON/GAME.CON)\n"
"-zNUM, -condebug\tLine-by-line CON compilation debugging, NUM is verbosity\n"
"\n-?, -help, --help\tDisplay this help message and exit"
; ;
wm_msgbox("EDuke32 Command Line Help",s); wm_msgbox("EDuke32 Command Line Help",s);
} }
@ -8438,7 +8439,13 @@ static void checkcommandline(int argc,char **argv)
c = argv[i]; c = argv[i];
if (((*c == '/') || (*c == '-')) && (!firstnet)) if (((*c == '/') || (*c == '-')) && (!firstnet))
{ {
if (!Bstrcasecmp(c+1,"grp")) if (!Bstrcasecmp(c+1,"?") || !Bstrcasecmp(c+1,"help") || !Bstrcasecmp(c+1,"-help"))
{
comlinehelp();
exit(0);
}
if (!Bstrcasecmp(c+1,"grp") || !Bstrcasecmp(c+1,"g"))
{ {
if (argc > i+1) if (argc > i+1)
{ {
@ -8589,10 +8596,6 @@ static void checkcommandline(int argc,char **argv)
c++; c++;
switch (*c) switch (*c)
{ {
case '?':
comlinehelp();
exit(0);
break;
case 'a': case 'a':
case 'A': case 'A':
ud.playerai = 1; ud.playerai = 1;