summaryrefslogtreecommitdiff
path: root/src/doom
diff options
context:
space:
mode:
Diffstat (limited to 'src/doom')
-rw-r--r--src/doom/d_main.c104
-rw-r--r--src/doom/d_net.c6
-rw-r--r--src/doom/dstrings.h9
-rw-r--r--src/doom/g_game.c12
-rw-r--r--src/doom/m_menu.c8
-rw-r--r--src/doom/p_map.c2
-rw-r--r--src/doom/p_spec.c4
7 files changed, 67 insertions, 78 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
diff --git a/src/doom/d_net.c b/src/doom/d_net.c
index 73e7368f..dd1ec563 100644
--- a/src/doom/d_net.c
+++ b/src/doom/d_net.c
@@ -396,7 +396,7 @@ static void SaveGameSettings(net_gamesettings_t *settings,
// packets.
//
- i = M_CheckParm("-extratics");
+ i = M_CheckParmWithArgs("-extratics", 1);
if (i > 0)
settings->extratics = atoi(myargv[i+1]);
@@ -411,7 +411,7 @@ static void SaveGameSettings(net_gamesettings_t *settings,
// the amount of network bandwidth needed.
//
- i = M_CheckParm("-dup");
+ i = M_CheckParmWithArgs("-dup", 1);
if (i > 0)
settings->ticdup = atoi(myargv[i+1]);
@@ -513,7 +513,7 @@ boolean D_InitNetGame(net_connect_data_t *connect_data,
// address.
//
- i = M_CheckParm("-connect");
+ i = M_CheckParmWithArgs("-connect", 1);
if (i > 0)
{
diff --git a/src/doom/dstrings.h b/src/doom/dstrings.h
index bdc6b2ce..d47fc1af 100644
--- a/src/doom/dstrings.h
+++ b/src/doom/dstrings.h
@@ -38,15 +38,6 @@
#define SAVEGAMENAME "doomsav"
-//
-// File locations,
-// relative to current position.
-// Path names are OS-sensitive.
-//
-#define DEVMAPS "devmaps"
-#define DEVDATA "devdata"
-
-
// QuitDOOM messages
// 8 per each game type
#define NUM_QUITMESSAGES 8
diff --git a/src/doom/g_game.c b/src/doom/g_game.c
index 5d30899d..5662d3f2 100644
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -138,7 +138,7 @@ int gametic;
int levelstarttic; // gametic at level start
int totalkills, totalitems, totalsecret; // for intermission
-char demoname[32];
+char *demoname;
boolean demorecording;
boolean longtics; // cph's doom 1.91 longtics hack
boolean lowres_turn; // low resolution turning for longtics
@@ -1978,14 +1978,14 @@ void G_WriteDemoTiccmd (ticcmd_t* cmd)
//
// G_RecordDemo
//
-void G_RecordDemo (char* name)
+void G_RecordDemo (char *name)
{
int i;
int maxsize;
usergame = false;
- strcpy (demoname, name);
- strcat (demoname, ".lmp");
+ demoname = Z_Malloc(strlen(name) + 5, PU_STATIC, NULL);
+ sprintf(demoname, "%s.lmp", name);
maxsize = 0x20000;
//!
@@ -1996,8 +1996,8 @@ void G_RecordDemo (char* name)
// Specify the demo buffer size (KiB)
//
- i = M_CheckParm ("-maxdemo");
- if (i && i<myargc-1)
+ i = M_CheckParmWithArgs("-maxdemo", 1);
+ if (i)
maxsize = atoi(myargv[i+1])*1024;
demobuffer = Z_Malloc (maxsize,PU_STATIC,NULL);
demoend = demobuffer + maxsize;
diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c
index 3bb4baa3..478e7f66 100644
--- a/src/doom/m_menu.c
+++ b/src/doom/m_menu.c
@@ -1442,23 +1442,23 @@ boolean M_Responder (event_t* ev)
if (ev->type == ev_joystick && joywait < I_GetTime())
{
- if (ev->data3 == -1)
+ if (ev->data3 < 0)
{
key = key_menu_up;
joywait = I_GetTime() + 5;
}
- else if (ev->data3 == 1)
+ else if (ev->data3 > 0)
{
key = key_menu_down;
joywait = I_GetTime() + 5;
}
- if (ev->data2 == -1)
+ if (ev->data2 < 0)
{
key = key_menu_left;
joywait = I_GetTime() + 2;
}
- else if (ev->data2 == 1)
+ else if (ev->data2 > 0)
{
key = key_menu_right;
joywait = I_GetTime() + 2;
diff --git a/src/doom/p_map.c b/src/doom/p_map.c
index 925e4398..78102bdf 100644
--- a/src/doom/p_map.c
+++ b/src/doom/p_map.c
@@ -1426,7 +1426,7 @@ static void SpechitOverrun(line_t *ld)
// Use the specified magic value when emulating spechit overruns.
//
- p = M_CheckParm("-spechit");
+ p = M_CheckParmWithArgs("-spechit", 1);
if (p > 0)
{
diff --git a/src/doom/p_spec.c b/src/doom/p_spec.c
index fa3ec335..90d0bb7c 100644
--- a/src/doom/p_spec.c
+++ b/src/doom/p_spec.c
@@ -1213,9 +1213,9 @@ static void DonutOverrun(fixed_t *s3_floorheight, short *s3_floorpic,
// system. The default (if this option is not specified) is to
// emulate the behavior when running under Windows 98.
- p = M_CheckParm("-donut");
+ p = M_CheckParmWithArgs("-donut", 2);
- if (p > 0 && p < myargc - 2)
+ if (p > 0)
{
// Dump of needed memory: (fixed_t)0000:0000 and (short)0000:0008
//