shithub: choc

Download patch

ref: 80571d7c6bc1bdd2f72325dc393f60d62b6a4250
parent: e6d59fa34c6ae40e1f4d69767b7ff96dcf5aba76
author: Simon Howard <[email protected]>
date: Fri Oct 26 17:52:40 EDT 2012

Add small workaround to deal with the fact that the BFG Edition's
version of doom2.wad has no TITLEPIC lump (thanks Gez).

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

--- a/src/d_main.c
+++ b/src/d_main.c
@@ -127,9 +127,10 @@
 boolean		advancedemo;
 
 // Store demo, do not accept any inputs
-
 boolean         storedemo;
 
+// "BFG Edition" version of doom2.wad does not include TITLEPIC.
+boolean         bfgedition;
 
 char		wadfile[1024];		// primary wad file
 char		mapdir[1024];           // directory of development maps
@@ -559,6 +560,13 @@
 	G_DeferedPlayDemo(DEH_String("demo4"));
 	break;
     }
+
+    // The Doom 3: BFG Edition version of doom2.wad does not have a
+    // TITLETPIC lump. Use INTERPIC instead as a workaround.
+    if (bfgedition && !strcasecmp(pagename, "TITLEPIC"))
+    {
+        pagename = "INTERPIC";
+    }
 }
 
 
@@ -1494,12 +1502,26 @@
     DEH_printf("ST_Init: Init status bar.\n");
     ST_Init ();
 
-    // If Doom II without a MAP01 lump, this is a store demo.  
+    // If Doom II without a MAP01 lump, this is a store demo.
     // Moved this here so that MAP01 isn't constantly looked up
     // in the main loop.
 
     if (gamemode == commercial && W_CheckNumForName("map01") < 0)
         storedemo = true;
+
+    // Doom 3: BFG Edition includes modified versions of the classic
+    // IWADs. The modified version of doom2.wad does not have a
+    // TITLEPIC lump, so detect this so we can apply a workaround.
+    // We specifically check for TITLEPIC here, after PWADs have been
+    // loaded - this means that we can play with the BFG Edition with
+    // PWADs that change the title screen and still see the modified
+    // titles.
+
+    if (gamemode == commercial && W_CheckNumForName("titlepic") < 0)
+    {
+        printf("BFG Edition: Using INTERPIC instead of TITLEPIC.\n");
+        bfgedition = true;
+    }
 
     //!
     // @arg <x>