shithub: choc

Download patch

ref: e1f113aec7399f5625d8dc9bfa1a8e9816695c19
parent: 48e19c69bf470517353101a445b8d824d1b3f7bb
author: Thomas A. Birkel <[email protected]>
date: Sun Nov 20 08:30:16 EST 2016

Emulate Doom2 map33 behavior

On automap: TNT names are blank on map33-map35; Doom2 names are blank when
not running via Final Doom
On intermission: map name patch is ignored, partime value is blank. Partime
value is set to zero to simulate intermission's timing, similar to Doom1
E4's invisible counting of partimes from Doom2 spillage.

Fix for #157

--- a/NEWS.md
+++ b/NEWS.md
@@ -48,6 +48,8 @@
     temporary directory and reporting an error instead.  (thanks
     terrorcide)
   * Versions 1.666, 1.7, and 1.8 are emulated. (thanks Nuke.YKT)
+  * Map33 intermission screen and map33-map35 automap names are
+    emulated. (thanks CapnClever)
 
 ### Heretic
   * Added map names for Episode 6, fixing a crash after completing a
--- a/src/doom/g_game.c
+++ b/src/doom/g_game.c
@@ -1455,15 +1455,30 @@
     wminfo.maxsecret = totalsecret; 
     wminfo.maxfrags = 0; 
 
-    // Set par time. Doom episode 4 doesn't have a par time, so this
-    // overflows into the cpars array. It's necessary to emulate this
-    // for statcheck regression testing.
+    // Set par time. Exceptions are added for purposes of
+    // statcheck regression testing.
     if (gamemode == commercial)
-	wminfo.partime = TICRATE*cpars[gamemap-1];
+    {
+        // map33 has no official time: initialize to zero
+        if (gamemap == 33)
+        {
+            wminfo.partime = 0;
+        }
+        else
+        {
+            wminfo.partime = TICRATE*cpars[gamemap-1];
+        }
+    }
+    // Doom episode 4 doesn't have a par time, so this
+    // overflows into the cpars array.
     else if (gameepisode < 4)
-	wminfo.partime = TICRATE*pars[gameepisode][gamemap];
+    {
+        wminfo.partime = TICRATE*pars[gameepisode][gamemap];
+    }
     else
+    {
         wminfo.partime = TICRATE*cpars[gamemap];
+    }
 
     wminfo.pnum = consoleplayer; 
  
--- a/src/doom/hu_stuff.c
+++ b/src/doom/hu_stuff.c
@@ -335,6 +335,12 @@
     THUSTR_30,
     THUSTR_31,
     THUSTR_32
+
+    // Emulation: TNT maps 33-35 can be warped to and played if they exist
+    // so include blank names instead of spilling over
+    "",
+    "",
+    ""
 };
 
 void HU_Init(void)
@@ -393,6 +399,11 @@
 	break;
       case doom2:
 	 s = HU_TITLE2;
+         // Pre-Final Doom compatibility: map33-map35 names don't spill over
+         if (gameversion <= exe_doom_1_9 && gamemap >= 33)
+         {
+             s = "";
+         }
 	 break;
       case pack_plut:
 	s = HU_TITLEP;
--- a/src/doom/wi_stuff.c
+++ b/src/doom/wi_stuff.c
@@ -430,7 +430,8 @@
     }
     else if (wbs->last == NUMCMAPS)
     {
-        // MAP33 - nothing is displayed!
+        // MAP33 - draw "Finished!" only
+        V_DrawPatch((SCREENWIDTH - SHORT(finished->width)) / 2, y, finished);
     }
     else if (wbs->last > NUMCMAPS)
     {
@@ -1472,8 +1473,13 @@
 
     if (wbs->epsd < 3)
     {
-	V_DrawPatch(SCREENWIDTH/2 + SP_TIMEX, SP_TIMEY, par);
-	WI_drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cnt_par);
+        V_DrawPatch(SCREENWIDTH/2 + SP_TIMEX, SP_TIMEY, par);
+
+        // Emulation: don't draw partime value if map33
+        if (gamemode != commercial || wbs->last != NUMCMAPS)
+        {
+            WI_drawTime(SCREENWIDTH - SP_TIMEX, SP_TIMEY, cnt_par);
+        }
     }
 
 }