From 23a468d956a2e4977630026b6ed81659243acb7d Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 22 Jan 2007 05:00:57 +0000 Subject: [PATCH] git-svn-id: https://svn.eduke32.com/eduke32@468 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/build/src/build.c | 17 +++++++-- polymer/eduke32/source/astub.c | 30 ++++++++++----- polymer/eduke32/source/config.c | 6 ++- polymer/eduke32/source/game.c | 65 +++++++++++++++++---------------- 4 files changed, 72 insertions(+), 46 deletions(-) diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index e5bb43031..09c83d87f 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -242,10 +242,19 @@ static int osdcmd_vidmode(const osdfuncparm_t *parm) extern int startwin_run(void); 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) { - char ch, quitflag, cmdsetup = 0, grpstoadd = 0; - char **grps = NULL; + char ch, quitflag, cmdsetup = 0; long i, j, k; 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; else if (!strcmp(argv[i], "-g") || !strcmp(argv[i], "-grp")) { i++; - grps = (char**)realloc(grps, sizeof(char*)*(grpstoadd+1)); - grps[grpstoadd++] = argv[i]; + buildaddgroup(argv[i]); } else if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "--help") || !strcmp(argv[i], "-?")) { char *s = @@ -320,6 +328,7 @@ int app_main(int argc, char **argv) for (i=0;i i+1) @@ -4402,10 +4410,6 @@ static void checkcommandline(int argc,char **argv) c++; switch (*c) { - case '?': - comlinehelp(); - exit(0); - break; case 'h': case 'H': c++; @@ -4421,6 +4425,12 @@ static void checkcommandline(int argc,char **argv) if (!*c) break; addgamepath(c); break; + case 'g': + case 'G': + c++; + if (!*c) break; + buildaddgroup(c); + break; } } i++; @@ -6017,7 +6027,7 @@ static void FuncMenu(void) for (j=0;j i+1) { @@ -8589,10 +8596,6 @@ static void checkcommandline(int argc,char **argv) c++; switch (*c) { - case '?': - comlinehelp(); - exit(0); - break; case 'a': case 'A': ud.playerai = 1;