shithub: choc

Download patch

ref: b00b65538a1f7a04fdd46d7c193a7c59733fde9b
parent: ca3844dc5b138b19259e8dc9daaa397867834a5f
author: Simon Howard <fraggle@gmail.com>
date: Tue Dec 9 18:32:19 EST 2008

Make intermission screen work on MAP33, to be consistent with Vanilla
Doom. Also, make levels after MAP33 trigger a V_DrawPatch error.

Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1414

--- a/src/wi_stuff.c
+++ b/src/wi_stuff.c
@@ -427,13 +427,32 @@
 {
     int y = WI_TITLEY;
 
-    // draw <LevelName> 
-    V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2,
-		y, FB, lnames[wbs->last]);
+    if (wbs->last < NUMCMAPS)
+    {
+        // draw <LevelName> 
+        V_DrawPatch((SCREENWIDTH - SHORT(lnames[wbs->last]->width))/2,
+                    y, FB, lnames[wbs->last]);
 
-    // draw "Finished!"
-    y += (5*SHORT(lnames[wbs->last]->height))/4;
-    
+        // draw "Finished!"
+        y += (5*SHORT(lnames[wbs->last]->height))/4;
+    }
+    else if (wbs->last == NUMCMAPS)
+    {
+        // MAP33 - nothing is displayed!
+    }
+    else if (wbs->last > NUMCMAPS)
+    {
+        // > MAP33.  Doom bombs out here with a Bad V_DrawPatch error.
+        // I'm pretty sure that doom2.exe is just reading into random
+        // bits of memory at this point, but let's try to be accurate
+        // anyway.  This deliberately triggers a V_DrawPatch error.
+
+        patch_t tmp = { SCREENWIDTH, SCREENHEIGHT, 1, 1, 
+                        { 0, 0, 0, 0, 0, 0, 0, 0 } };
+
+        V_DrawPatch(0, y, FB, &tmp);
+    }
+
     V_DrawPatch((SCREENWIDTH - SHORT(finished->width))/2,
 		y, FB, finished);
 }