diff options
author | Simon Howard | 2011-02-12 15:38:08 +0000 |
---|---|---|
committer | Simon Howard | 2011-02-12 15:38:08 +0000 |
commit | a9996b41e954d85fde5ec5188bbf6a7f4df88011 (patch) | |
tree | 113669ff889c9184aaa28224317c8b04c2c5bfeb /src/doom/d_main.c | |
parent | 7d7b5087d2288fc6e2493448968f7d786043b389 (diff) | |
parent | a366f68b2959282b22ab6f08569a253f0540745c (diff) | |
download | chocolate-doom-a9996b41e954d85fde5ec5188bbf6a7f4df88011.tar.gz chocolate-doom-a9996b41e954d85fde5ec5188bbf6a7f4df88011.tar.bz2 chocolate-doom-a9996b41e954d85fde5ec5188bbf6a7f4df88011.zip |
Merge from trunk.
Subversion-branch: /branches/raven-branch
Subversion-revision: 2258
Diffstat (limited to 'src/doom/d_main.c')
-rw-r--r-- | src/doom/d_main.c | 104 |
1 files changed, 51 insertions, 53 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c index 69dd6e9f..2f116f1e 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -526,7 +526,13 @@ void D_DoAdvanceDemo (void) paused = false; gameaction = ga_nothing; - if (gamemode == retail && gameversion != exe_chex) + // The Ultimate Doom executable changed the demo sequence to add + // a DEMO4 demo. Final Doom was based on Ultimate, so also + // includes this change; however, the Final Doom IWADs do not + // include a DEMO4 lump, so the game bombs out with an error + // when it reaches this point in the demo sequence. + + if (gameversion == exe_ultimate || gameversion == exe_final) demosequence = (demosequence+1)%7; else demosequence = (demosequence+1)%6; @@ -927,9 +933,9 @@ static void InitGameVersion(void) // "ultimate" and "final". // - p = M_CheckParm("-gameversion"); + p = M_CheckParmWithArgs("-gameversion", 1); - if (p > 0) + if (p) { for (i=0; gameversions[i].description != NULL; ++i) { @@ -1142,9 +1148,9 @@ void D_DoomMain (void) // address. // - p = M_CheckParm("-query"); + p = M_CheckParmWithArgs("-query", 1); - if (p > 0) + if (p) { NET_QueryAddress(myargv[p+1]); exit(0); @@ -1312,40 +1318,32 @@ void D_DoomMain (void) D_AddFile(iwadfile); modifiedgame = W_ParseCommandLine(); - // add any files specified on the command line with -file wadfile - // to the wad list + //! + // @arg <files> + // @vanilla // - // convenience hack to allow -wart e m to add a wad file - // prepend a tilde to the filename so wadfile will be reloadable - p = M_CheckParm ("-wart"); + // Load the specified PWAD files. + // + + p = M_CheckParmWithArgs("-file", 1); if (p) { - myargv[p][4] = 'p'; // big hack, change to -warp + // the parms after p are wadfile/lump names, + // until end of parms or another - preceded parm + modifiedgame = true; // homebrew levels + while (++p != myargc && myargv[p][0] != '-') + { + char *filename; - // Map name handling. - switch (gamemode ) - { - case shareware: - case retail: - case registered: - sprintf (file,"~"DEVMAPS"E%cM%c.wad", - myargv[p+1][0], myargv[p+2][0]); - printf("Warping to Episode %s, Map %s.\n", - myargv[p+1],myargv[p+2]); - break; - - case commercial: - default: - p = atoi (myargv[p+1]); - if (p<10) - sprintf (file,"~"DEVMAPS"cdata/map0%i.wad", p); - else - sprintf (file,"~"DEVMAPS"cdata/map%i.wad", p); - break; - } - D_AddFile (file); + filename = D_TryFindWADByName(myargv[p]); + + D_AddFile(filename); + } } + // Debug: +// W_PrintDirectory(); + //! // @arg <demo> // @category demo @@ -1354,7 +1352,7 @@ void D_DoomMain (void) // Play back the demo named demo.lmp. // - p = M_CheckParm ("-playdemo"); + p = M_CheckParmWithArgs ("-playdemo", 1); if (!p) { @@ -1366,11 +1364,11 @@ void D_DoomMain (void) // Play back the demo named demo.lmp, determining the framerate // of the screen. // - p = M_CheckParm ("-timedemo"); + p = M_CheckParmWithArgs("-timedemo", 1); } - if (p && p < myargc-1) + if (p) { if (!strcasecmp(myargv[p+1] + strlen(myargv[p+1]) - 4, ".lmp")) { @@ -1452,9 +1450,9 @@ void D_DoomMain (void) // 0 disables all monsters. // - p = M_CheckParm ("-skill"); + p = M_CheckParmWithArgs("-skill", 1); - if (p && p < myargc-1) + if (p) { startskill = myargv[p+1][0]-'1'; autostart = true; @@ -1467,9 +1465,9 @@ void D_DoomMain (void) // Start playing on episode n (1-4) // - p = M_CheckParm ("-episode"); + p = M_CheckParmWithArgs("-episode", 1); - if (p && p < myargc-1) + if (p) { startepisode = myargv[p+1][0]-'0'; startmap = 1; @@ -1486,9 +1484,9 @@ void D_DoomMain (void) // For multiplayer games: exit each level after n minutes. // - p = M_CheckParm ("-timer"); + p = M_CheckParmWithArgs("-timer", 1); - if (p && p < myargc-1) + if (p) { timelimit = atoi(myargv[p+1]); } @@ -1502,7 +1500,7 @@ void D_DoomMain (void) p = M_CheckParm ("-avg"); - if (p && p < myargc-1) + if (p) { timelimit = 20; } @@ -1515,9 +1513,9 @@ void D_DoomMain (void) // (Doom 2) // - p = M_CheckParm ("-warp"); + p = M_CheckParmWithArgs("-warp", 1); - if (p && p < myargc-1) + if (p) { if (gamemode == commercial) startmap = atoi (myargv[p+1]); @@ -1561,9 +1559,9 @@ void D_DoomMain (void) // Load the game in slot s. // - p = M_CheckParm ("-loadgame"); + p = M_CheckParmWithArgs("-loadgame", 1); - if (p && p < myargc-1) + if (p) { startloadgame = atoi(myargv[p+1]); } @@ -1633,24 +1631,24 @@ void D_DoomMain (void) // Record a demo named x.lmp. // - p = M_CheckParm ("-record"); + p = M_CheckParmWithArgs("-record", 1); - if (p && p < myargc-1) + if (p) { G_RecordDemo (myargv[p+1]); autostart = true; } - p = M_CheckParm ("-playdemo"); - if (p && p < myargc-1) + p = M_CheckParmWithArgs("-playdemo", 1); + if (p) { singledemo = true; // quit after one demo G_DeferedPlayDemo (demolumpname); D_DoomLoop (); // never returns } - p = M_CheckParm ("-timedemo"); - if (p && p < myargc-1) + p = M_CheckParmWithArgs("-timedemo", 1); + if (p) { G_TimeDemo (demolumpname); D_DoomLoop (); // never returns |