diff options
author | Simon Howard | 2014-02-24 10:37:19 -0500 |
---|---|---|
committer | Simon Howard | 2014-02-24 10:37:19 -0500 |
commit | 18efe412b69bf733c2a9cd544212e4fd3a3c636a (patch) | |
tree | a5c081bbebc9bc664f732d557024e857e6f153f2 /src/doom | |
parent | dc57eb0844fea8fd444281453b25f43ab7007a22 (diff) | |
parent | b8fd310fc155b969346265601a48c21faec2ecf9 (diff) | |
download | chocolate-doom-18efe412b69bf733c2a9cd544212e4fd3a3c636a.tar.gz chocolate-doom-18efe412b69bf733c2a9cd544212e4fd3a3c636a.tar.bz2 chocolate-doom-18efe412b69bf733c2a9cd544212e4fd3a3c636a.zip |
Merge pull request #346 from fabiangreffrath/bfgedition
More robust checks for BFG Edition.
Diffstat (limited to 'src/doom')
-rw-r--r-- | src/doom/d_main.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/src/doom/d_main.c b/src/doom/d_main.c index 70144fb6..3badb4ad 100644 --- a/src/doom/d_main.c +++ b/src/doom/d_main.c @@ -576,9 +576,10 @@ 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 (bfgedition && !strcasecmp(pagename, "TITLEPIC") + && W_CheckNumForName("titlepic") < 0) { - pagename = "INTERPIC"; + pagename = DEH_String("INTERPIC"); } } @@ -1278,6 +1279,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 +1603,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); |