foxygit / doom Log in
commit 9c76e770d6104b0d23a28d228715dc4cd9f84722
Author:     Thomas A. Birkel <capnclever@gmail.com>
AuthorDate: Wed Oct 19 00:27:12 2016 -0400
Commit:     Thomas A. Birkel <capnclever@gmail.com>
CommitDate: Wed Oct 19 00:27:12 2016 -0400

    Update branch with requested changes

    Improve indentation and comments, use M_ParmExists() instead of
    M_CheckParam().
---
 src/heretic/d_main.c |  4 ++--
 src/heretic/d_net.c  |  6 +++---
 src/heretic/g_game.c |  7 +++++--
 src/hexen/d_net.c    |  6 +++---
 src/hexen/g_game.c   | 15 ++++++++++-----
 src/hexen/h2_main.c  |  4 ++--
 6 files changed, 25 insertions(+), 17 deletions(-)

diff --git a/src/heretic/d_main.c b/src/heretic/d_main.c
index f261dc5d..31e46842 100644
--- a/src/heretic/d_main.c
+++ b/src/heretic/d_main.c
@@ -1037,7 +1037,7 @@ void D_DoomMain(void)
     // Record a high turning resolution demo.
     //

-    longtics = M_CheckParm("-longtics") != 0;
+    longtics = M_ParmExists("-longtics");

     //!
     // @category demo
@@ -1046,7 +1046,7 @@ void D_DoomMain(void)
     // after level exit.
     //

-    demoextend = M_CheckParm("-demoextend");
+    demoextend = M_ParmExists("-demoextend");

     if (W_CheckNumForName(DEH_String("E2M1")) == -1)
     {
diff --git a/src/heretic/d_net.c b/src/heretic/d_net.c
index 28e7afaf..91e53a49 100644
--- a/src/heretic/d_net.c
+++ b/src/heretic/d_net.c
@@ -123,7 +123,7 @@ static void LoadGameSettings(net_gamesettings_t *settings)
     if (lowres_turn)
     {
         printf("NOTE: Turning resolution is reduced; this is probably "
-            "because there is a client recording a Vanilla demo.\n");
+               "because there is a client recording a Vanilla demo.\n");
     }

     for (i = 0; i < MAXPLAYERS; ++i)
@@ -150,8 +150,8 @@ static void SaveGameSettings(net_gamesettings_t *settings)
     settings->respawn_monsters = respawnparm;
     settings->timelimit = 0;

-    settings->lowres_turn = M_CheckParm("-record") > 0
-                         && M_CheckParm("-longtics") == 0;
+    settings->lowres_turn = M_ParmExists("-record")
+                        && !M_ParmExists("-longtics");
 }

 static void InitConnectData(net_connect_data_t *connect_data)
diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c
index f61ec0a1..e27c458e 100644
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -1322,7 +1322,8 @@ void G_DoReborn(int playernum)
 {
     int i;

-    if (!demoextend && G_CheckDemoStatus()) // quit demo unless -demoextend
+    // quit demo unless -demoextend
+    if (!demoextend && G_CheckDemoStatus())
         return;
     if (!netgame)
         gameaction = ga_loadlevel;      // reload the level from scratch
@@ -1391,7 +1392,9 @@ void G_DoCompleted(void)
     static int afterSecret[5] = { 7, 5, 5, 5, 4 };

     gameaction = ga_nothing;
-    if (!demoextend && G_CheckDemoStatus()) // quit demo unless -demoextend
+
+    // quit demo unless -demoextend
+    if (!demoextend && G_CheckDemoStatus())
     {
         return;
     }
diff --git a/src/hexen/d_net.c b/src/hexen/d_net.c
index 0c292cc8..3810eab1 100644
--- a/src/hexen/d_net.c
+++ b/src/hexen/d_net.c
@@ -124,7 +124,7 @@ static void LoadGameSettings(net_gamesettings_t *settings)
     if (lowres_turn)
     {
         printf("NOTE: Turning resolution is reduced; this is probably "
-            "because there is a client recording a Vanilla demo.\n");
+               "because there is a client recording a Vanilla demo.\n");
     }

     for (i=0; i<maxplayers; ++i)
@@ -162,8 +162,8 @@ static void SaveGameSettings(net_gamesettings_t *settings)
     settings->respawn_monsters = respawnparm;
     settings->timelimit = 0;

-    settings->lowres_turn = M_CheckParm("-record") > 0
-                         && M_CheckParm("-longtics") == 0;
+    settings->lowres_turn = M_ParmExists("-record")
+                        && !M_ParmExists("-longtics");
 }

 static void InitConnectData(net_connect_data_t *connect_data)
diff --git a/src/hexen/g_game.c b/src/hexen/g_game.c
index 7acfe485..434cea55 100644
--- a/src/hexen/g_game.c
+++ b/src/hexen/g_game.c
@@ -1325,7 +1325,8 @@ void G_DoReborn(int playernum)
     boolean foundSpot;
     int bestWeapon;

-    if (!demoextend && G_CheckDemoStatus()) // quit demo unless -demoextend
+    // quit demo unless -demoextend
+    if (!demoextend && G_CheckDemoStatus())
     {
         return;
     }
@@ -1520,7 +1521,9 @@ void G_DoCompleted(void)
     int i;

     gameaction = ga_nothing;
-    if (!demoextend && G_CheckDemoStatus()) // quit demo unless -demoextend
+
+    // quit demo unless -demoextend
+    if (!demoextend && G_CheckDemoStatus())
     {
         return;
     }
@@ -1771,9 +1774,11 @@ void G_InitNew(skill_t skill, int episode, int map)
     }

     // Set up a bunch of globals
-    if (!demoextend) // this prevents map-loading from stopping the demo
-    {                // demoextend is set back to false only if starting a
-                     //  new game or loading a saved one during playback
+    if (!demoextend)
+    {
+        // This prevents map-loading from interrupting a demo.
+        // demoextend is set back to false only if starting a new game or
+        // loading a saved one from the menu, and only during playback.
         demorecording = false;
         demoplayback = false;
         usergame = true;            // will be set false if a demo
diff --git a/src/hexen/h2_main.c b/src/hexen/h2_main.c
index 98361158..ae3230cb 100644
--- a/src/hexen/h2_main.c
+++ b/src/hexen/h2_main.c
@@ -682,7 +682,7 @@ static void HandleArgs(void)
     // Record a high turning resolution demo.
     //

-    longtics = M_CheckParm("-longtics") != 0;
+    longtics = M_ParmExists("-longtics");

     //!
     // @category demo
@@ -691,7 +691,7 @@ static void HandleArgs(void)
     // after level exit.
     //

-    demoextend = M_CheckParm("-demoextend");
+    demoextend = M_ParmExists("-demoextend");

     if (M_ParmExists("-testcontrols"))
     {