summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabian Greffrath2014-02-24 07:20:49 +0100
committerFabian Greffrath2014-02-24 07:20:49 +0100
commit79f8427436cf2da7de710e9046f2e01dc6c8b17e (patch)
tree2fe58f26879c5b5cf90a9ddfd479ff660a875311
parentdc57eb0844fea8fd444281453b25f43ab7007a22 (diff)
downloadchocolate-doom-79f8427436cf2da7de710e9046f2e01dc6c8b17e.tar.gz
chocolate-doom-79f8427436cf2da7de710e9046f2e01dc6c8b17e.tar.bz2
chocolate-doom-79f8427436cf2da7de710e9046f2e01dc6c8b17e.zip
More robust checks for BFG Edition.
1) Move the check for (bfgedition) right behind loading the IWAD, i.e. before any PWADs are loaded that could probably provide a DMENUPIC lump. 2) Instead of checking for a missing TITLEPIC lump (which is only true for the doom2.wad shipped with the BFG Edition) check for the presence of DMENUPIC (which is exclusive to both classic IWADs shipped with the BFG Edition). The M_GDHIGH lumps, however, are incompatibly modified in *both* IWADs. 3) Move the check for the missing TITLEPIC lump to the place where it becomes actually crucial, i.e. D_DoAdvanceDemo() and make it independent of the (bfgedition) check. So, PWADs still have a chance to provide their own TITLEPIC lump.
-rw-r--r--src/doom/d_main.c53
1 files changed, 27 insertions, 26 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index 70144fb6..75c9328c 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -576,9 +576,9 @@ void D_DoAdvanceDemo (void)
// 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"))
+ if (!strcasecmp(pagename, "TITLEPIC") && W_CheckNumForName("titlepic") < 0)
{
- pagename = "INTERPIC";
+ pagename = DEH_String("INTERPIC");
}
}
@@ -1278,6 +1278,31 @@ void D_DoomMain (void)
DEH_printf("W_Init: Init WADfiles.\n");
D_AddFile(iwadfile);
+
+ // Doom 3: BFG Edition includes modified versions of the classic
+ // IWADs which can be identified by an additional DMENUPIC lump.
+ // Furthermore, the M_GDHIGH lumps have been modified in a way that
+ // makes them incompatible to Vanilla Doom and the modified version
+ // of doom2.wad is missing the TITLEPIC lump.
+ // We specifically check for DMENUPIC here, before PWADs have been
+ // loaded which could probably include a lump of that name.
+
+ if (W_CheckNumForName("dmenupic") >= 0)
+ {
+ printf("BFG Edition: Using workarounds as needed.\n");
+ bfgedition = true;
+
+ // BFG Edition changes the names of the secret levels to
+ // censor the Wolfenstein references. It also has an extra
+ // secret level (MAP33). In Vanilla Doom (meaning the DOS
+ // version), MAP33 overflows into the Plutonia level names
+ // array, so HUSTR_33 is actually PHUSTR_1.
+
+ DEH_AddStringReplacement(HUSTR_31, "level 31: idkfa");
+ DEH_AddStringReplacement(HUSTR_32, "level 32: keen");
+ DEH_AddStringReplacement(PHUSTR_1, "level 33: betray");
+ }
+
modifiedgame = W_ParseCommandLine();
// Debug:
@@ -1577,30 +1602,6 @@ void D_DoomMain (void)
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;
-
- // BFG Edition changes the names of the secret levels to
- // censor the Wolfenstein references. It also has an extra
- // secret level (MAP33). In Vanilla Doom (meaning the DOS
- // version), MAP33 overflows into the Plutonia level names
- // array, so HUSTR_33 is actually PHUSTR_1.
-
- DEH_AddStringReplacement(HUSTR_31, "level 31: idkfa");
- DEH_AddStringReplacement(HUSTR_32, "level 32: keen");
- DEH_AddStringReplacement(PHUSTR_1, "level 33: betray");
- }
-
if (M_CheckParmWithArgs("-statdump", 1))
{
I_AtExit(StatDump, true);