From 20b6395cf0ebddbe8785cca0889258e43b8626c5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 18 Jun 2019 20:40:41 +0200 Subject: [PATCH] - give UMAPINFO the ability to disable cluster-based exit texts. --- src/g_level.cpp | 6 +++--- src/gamedata/g_mapinfo.cpp | 2 ++ src/gamedata/g_mapinfo.h | 4 ++-- src/gamedata/umapinfo.cpp | 1 + wadsrc/static/mapinfo/chex.txt | 1 + wadsrc/static/mapinfo/doom1.txt | 4 ++++ wadsrc/static/mapinfo/doom2.txt | 7 +++++++ wadsrc/static/mapinfo/doom2bfg.txt | 1 + wadsrc/static/mapinfo/heretic.txt | 5 +++++ wadsrc/static/mapinfo/plutonia.txt | 6 ++++++ wadsrc/static/mapinfo/tnt.txt | 6 ++++++ 11 files changed, 38 insertions(+), 5 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index 4e253df01..e51ce4e1f 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1275,7 +1275,7 @@ void FLevelLocals::WorldDone (void) ext->mDefined & FExitText::DEF_LOOKUP, true, endsequence); } - else + else if (!(info->flags2 & LEVEL2_NOCLUSTERTEXT)) { F_StartFinale(thiscluster->MessageMusic, thiscluster->musicorder, thiscluster->cdtrack, thiscluster->cdid, @@ -1286,7 +1286,7 @@ void FLevelLocals::WorldDone (void) true, endsequence); } } - else + else if (!deathmatch) { FExitText *ext = nullptr; @@ -1313,7 +1313,7 @@ void FLevelLocals::WorldDone (void) nextcluster = FindClusterInfo (FindLevelInfo (nextlevel)->cluster); - if (nextcluster->cluster != cluster && !deathmatch) + if (nextcluster->cluster != cluster && !(info->flags2 & LEVEL2_NOCLUSTERTEXT)) { // Only start the finale if the next level's cluster is different // than the current one and we're not in deathmatch. diff --git a/src/gamedata/g_mapinfo.cpp b/src/gamedata/g_mapinfo.cpp index 42e06e2ba..09e8cb485 100644 --- a/src/gamedata/g_mapinfo.cpp +++ b/src/gamedata/g_mapinfo.cpp @@ -1620,6 +1620,8 @@ MapFlagHandlers[] = { "rememberstate", MITYPE_CLRFLAG2, LEVEL2_FORGETSTATE, 0 }, { "unfreezesingleplayerconversations",MITYPE_SETFLAG2, LEVEL2_CONV_SINGLE_UNFREEZE, 0 }, { "spawnwithweaponraised", MITYPE_SETFLAG2, LEVEL2_PRERAISEWEAPON, 0 }, + { "needclustertext", MITYPE_SETFLAG2, LEVEL2_NEEDCLUSTERTEXT, 0 }, + { "noclustertext", MITYPE_SETFLAG2, LEVEL2_NOCLUSTERTEXT, 0 }, // Normally there shouldn't be a need to explicitly set this { "forcefakecontrast", MITYPE_SETFLAG3, LEVEL3_FORCEFAKECONTRAST, 0 }, { "nolightfade", MITYPE_SETFLAG3, LEVEL3_NOLIGHTFADE, 0 }, { "nocoloredspritelighting", MITYPE_SETFLAG3, LEVEL3_NOCOLOREDSPRITELIGHTING, 0 }, diff --git a/src/gamedata/g_mapinfo.h b/src/gamedata/g_mapinfo.h index f4c74de08..d18c92fcb 100644 --- a/src/gamedata/g_mapinfo.h +++ b/src/gamedata/g_mapinfo.h @@ -201,7 +201,7 @@ enum ELevelFlags : unsigned int LEVEL2_LAXACTIVATIONMAPINFO = 0x00000008, // LEVEL_LAXMONSTERACTIVATION is not a default. LEVEL2_MISSILESACTIVATEIMPACT=0x00000010, // Missiles are the activators of SPAC_IMPACT events, not their shooters - // = 0x00000020, // unused + LEVEL2_NEEDCLUSTERTEXT = 0x00000020, // A map with this flag needs to retain its cluster intermission texts when being redefined in UMAPINFO LEVEL2_KEEPFULLINVENTORY = 0x00000040, // doesn't reduce the amount of inventory items to 1 @@ -225,7 +225,7 @@ enum ELevelFlags : unsigned int LEVEL2_FORCETEAMPLAYOFF = 0x00080000, LEVEL2_CONV_SINGLE_UNFREEZE = 0x00100000, - // = 0x00200000, // unused, was LEVEL2_RAILINGHACK + LEVEL2_NOCLUSTERTEXT = 0x00200000, // ignore intermission texts fro clusters. This gets set when UMAPINFO is used to redefine its properties. LEVEL2_DUMMYSWITCHES = 0x00400000, LEVEL2_HEXENHACK = 0x00800000, // Level was defined in a Hexen style MAPINFO diff --git a/src/gamedata/umapinfo.cpp b/src/gamedata/umapinfo.cpp index 39b91efd3..106b8a51a 100644 --- a/src/gamedata/umapinfo.cpp +++ b/src/gamedata/umapinfo.cpp @@ -462,6 +462,7 @@ void CommitUMapinfo(level_info_t *defaultinfo) levelinfo->ExitMapTexts[NAME_Secret] = { 0, 0 }; } if (map.nointermission) levelinfo->flags |= LEVEL_NOINTERMISSION; + if (!(levelinfo->flags2 & LEVEL2_NEEDCLUSTERTEXT)) levelinfo->flags2 |= LEVEL2_NOCLUSTERTEXT; // UMAPINFO should ignore cluster intermission texts. } diff --git a/wadsrc/static/mapinfo/chex.txt b/wadsrc/static/mapinfo/chex.txt index 6213e4c44..5839ad150 100644 --- a/wadsrc/static/mapinfo/chex.txt +++ b/wadsrc/static/mapinfo/chex.txt @@ -256,6 +256,7 @@ map E1M5 lookup "CHUSTR_E1M5" cluster = 1 par = 165 music = "$MUSIC_E1M5" + needclustertext } // Clusters (correspond with same-numbered episode) diff --git a/wadsrc/static/mapinfo/doom1.txt b/wadsrc/static/mapinfo/doom1.txt index 738c93c4a..c28186c55 100644 --- a/wadsrc/static/mapinfo/doom1.txt +++ b/wadsrc/static/mapinfo/doom1.txt @@ -152,6 +152,7 @@ map E1M8 lookup "HUSTR_E1M8" baronspecial specialaction_lowerfloor music = "$MUSIC_E1M8" + needclustertext } map E1M9 lookup "HUSTR_E1M9" @@ -266,6 +267,7 @@ map E2M8 lookup "HUSTR_E2M8" cyberdemonspecial specialaction_exitlevel music = "$MUSIC_E2M8" + needclustertext } map E2M9 lookup "HUSTR_E2M9" @@ -380,6 +382,7 @@ map E3M8 lookup "HUSTR_E3M8" spidermastermindspecial specialaction_exitlevel music = "$MUSIC_E3M8" + needclustertext } map E3M9 lookup "HUSTR_E3M9" @@ -496,6 +499,7 @@ map E4M8 lookup "HUSTR_E4M8" spidermastermindspecial specialaction_lowerfloor music = "$MUSIC_E2M5" + needclustertext } map E4M9 lookup "HUSTR_E4M9" diff --git a/wadsrc/static/mapinfo/doom2.txt b/wadsrc/static/mapinfo/doom2.txt index 032518aa7..8edba1719 100644 --- a/wadsrc/static/mapinfo/doom2.txt +++ b/wadsrc/static/mapinfo/doom2.txt @@ -85,6 +85,7 @@ map MAP06 lookup "HUSTR_6" par = 150 sucktime = 1 music = "$MUSIC_THE_DA" + needclustertext } map MAP07 lookup "HUSTR_7" @@ -141,6 +142,7 @@ map MAP11 lookup "HUSTR_11" cluster = 6 par = 210 music = "$MUSIC_STLKS2" + needclustertext } map MAP12 lookup "HUSTR_12" @@ -185,6 +187,7 @@ map MAP15 lookup "HUSTR_15" cluster = 7 par = 210 music = "$MUSIC_RUNNI2" + needclustertext } map MAP16 lookup "HUSTR_16" @@ -240,6 +243,7 @@ map MAP20 lookup "HUSTR_20" cluster = 7 par = 150 music = "$MUSIC_MESSAG" + needclustertext } map MAP21 lookup "HUSTR_21" @@ -351,6 +355,7 @@ map MAP30 lookup "HUSTR_30" par = 180 allowmonstertelefrags music = "$MUSIC_OPENIN" + needclustertext } map MAP31 lookup "HUSTR_31" @@ -362,6 +367,7 @@ map MAP31 lookup "HUSTR_31" cluster = 9 par = 120 music = "$MUSIC_EVIL" + needclustertext } map MAP32 lookup "HUSTR_32" @@ -515,6 +521,7 @@ map LEVEL08 lookup "NHUSTR_8" cluster = 11 par = 105 music = "$MUSIC_SHAWN" + needclustertext } map LEVEL09 lookup "NHUSTR_9" diff --git a/wadsrc/static/mapinfo/doom2bfg.txt b/wadsrc/static/mapinfo/doom2bfg.txt index 840f3c6c9..b53d7944f 100644 --- a/wadsrc/static/mapinfo/doom2bfg.txt +++ b/wadsrc/static/mapinfo/doom2bfg.txt @@ -53,6 +53,7 @@ map MAP31 lookup "HUSTR_31B" cluster = 9 par = 120 music = "$MUSIC_EVIL" + needclustertext } map MAP32 lookup "HUSTR_32B" diff --git a/wadsrc/static/mapinfo/heretic.txt b/wadsrc/static/mapinfo/heretic.txt index 377143f4f..a936c468c 100644 --- a/wadsrc/static/mapinfo/heretic.txt +++ b/wadsrc/static/mapinfo/heretic.txt @@ -421,6 +421,7 @@ map E1M8 lookup "HHUSTR_E1M8" ironlichspecial specialaction_lowerfloortohighest music = "MUS_E1M8" + needclustertext } map E1M9 lookup "HHUSTR_E1M9" @@ -508,6 +509,7 @@ map E2M8 lookup "HHUSTR_E2M8" specialaction_lowerfloortohighest specialaction_killmonsters music = "MUS_E2M8" + needclustertext } map E2M9 lookup "HHUSTR_E2M9" @@ -595,6 +597,7 @@ map E3M8 lookup "HHUSTR_E3M8" specialaction_lowerfloortohighest specialaction_killmonsters music = "MUS_E1M9" + needclustertext } map E3M9 lookup "HHUSTR_E3M9" @@ -682,6 +685,7 @@ map E4M8 lookup "HHUSTR_E4M8" specialaction_lowerfloortohighest specialaction_killmonsters music = "MUS_E1M8" + needclustertext } map E4M9 lookup "HHUSTR_E4M9" @@ -769,6 +773,7 @@ map E5M8 lookup "HHUSTR_E5M8" specialaction_killmonsters specialaction_lowerfloortohighest music = "MUS_E2M8" + needclustertext } map E5M9 lookup "HHUSTR_E5M9" diff --git a/wadsrc/static/mapinfo/plutonia.txt b/wadsrc/static/mapinfo/plutonia.txt index d248377f6..4b0fc478b 100644 --- a/wadsrc/static/mapinfo/plutonia.txt +++ b/wadsrc/static/mapinfo/plutonia.txt @@ -79,6 +79,7 @@ map MAP06 lookup "PHUSTR_6" cluster = 5 par = 150 music = "$MUSIC_THE_DA" + needclustertext } map MAP07 lookup "PHUSTR_7" @@ -135,6 +136,7 @@ map MAP11 lookup "PHUSTR_11" cluster = 6 par = 210 music = "$MUSIC_STLKS2" + needclustertext } map MAP12 lookup "PHUSTR_12" @@ -179,6 +181,7 @@ map MAP15 lookup "PHUSTR_15" cluster = 7 par = 210 music = "$MUSIC_RUNNI2" + needclustertext } map MAP16 lookup "PHUSTR_16" @@ -234,6 +237,7 @@ map MAP20 lookup "PHUSTR_20" cluster = 7 par = 150 music = "$MUSIC_MESSAG" + needclustertext } map MAP21 lookup "PHUSTR_21" @@ -345,6 +349,7 @@ map MAP30 lookup "PHUSTR_30" par = 180 allowmonstertelefrags music = "$MUSIC_OPENIN" + needclustertext } map MAP31 lookup "PHUSTR_31" @@ -356,6 +361,7 @@ map MAP31 lookup "PHUSTR_31" cluster = 9 par = 120 music = "$MUSIC_EVIL" + needclustertext } map MAP32 lookup "PHUSTR_32" diff --git a/wadsrc/static/mapinfo/tnt.txt b/wadsrc/static/mapinfo/tnt.txt index df10bfa7e..b4b94463b 100644 --- a/wadsrc/static/mapinfo/tnt.txt +++ b/wadsrc/static/mapinfo/tnt.txt @@ -79,6 +79,7 @@ map MAP06 lookup "THUSTR_6" cluster = 5 par = 150 music = "$MUSIC_THE_DA" + needclustertext } map MAP07 lookup "THUSTR_7" @@ -135,6 +136,7 @@ map MAP11 lookup "THUSTR_11" cluster = 6 par = 210 music = "$MUSIC_STLKS2" + needclustertext } map MAP12 lookup "THUSTR_12" @@ -179,6 +181,7 @@ map MAP15 lookup "THUSTR_15" cluster = 7 par = 210 music = "$MUSIC_RUNNI2" + needclustertext } map MAP16 lookup "THUSTR_16" @@ -234,6 +237,7 @@ map MAP20 lookup "THUSTR_20" cluster = 7 par = 150 music = "$MUSIC_MESSAG" + needclustertext } map MAP21 lookup "THUSTR_21" @@ -345,6 +349,7 @@ map MAP30 lookup "THUSTR_30" par = 180 allowmonstertelefrags music = "$MUSIC_OPENIN" + needclustertext } map MAP31 lookup "THUSTR_31" @@ -356,6 +361,7 @@ map MAP31 lookup "THUSTR_31" cluster = 9 par = 120 music = "$MUSIC_EVIL" + needclustertext } map MAP32 lookup "THUSTR_32"