From c675d60bacefd9c6651b8006f799f7bb55d0870b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 18 Jun 2023 09:44:34 +0200 Subject: [PATCH] - finish the implementation for nosectionmerge. --- src/d_iwad.cpp | 1 + src/gamedata/gi.h | 1 + src/maploader/compatibility.cpp | 13 ++++++++++--- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 431c37813..4266b75a7 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -148,6 +148,7 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize, else if(sc.Compare("Extended")) iwad->flags |= GI_MENUHACK_EXTENDED; else if(sc.Compare("Shorttex")) iwad->flags |= GI_COMPATSHORTTEX; else if(sc.Compare("Stairs")) iwad->flags |= GI_COMPATSTAIRS; + else if (sc.Compare("nosectionmerge")) iwad->flags |= GI_NOSECTIONMERGE; else sc.ScriptError(NULL); } while (sc.CheckString(",")); diff --git a/src/gamedata/gi.h b/src/gamedata/gi.h index 5f11ecfa5..5e713628d 100644 --- a/src/gamedata/gi.h +++ b/src/gamedata/gi.h @@ -51,6 +51,7 @@ enum GI_COMPATPOLY1 = 0x00000040, // Hexen's MAP36 needs old polyobject drawing GI_COMPATPOLY2 = 0x00000080, // so does HEXDD's MAP47 GI_IGNORETITLEPATCHES = 0x00000200, // Ignore the map name graphics when not runnning in English language + GI_NOSECTIONMERGE = 0x00000400, // For the original id IWADs: avoid merging sections due to how idbsp created its sectors. }; #include "gametype.h" diff --git a/src/maploader/compatibility.cpp b/src/maploader/compatibility.cpp index 1d135132d..f85d89b19 100644 --- a/src/maploader/compatibility.cpp +++ b/src/maploader/compatibility.cpp @@ -294,10 +294,17 @@ FName MapLoader::CheckCompatibility(MapData *map) // When playing Doom IWAD levels force BCOMPATF_NOSECTIONMERGE, COMPAT_SHORTTEX and COMPATF_LIGHT. // I'm not sure if the IWAD maps actually need COMPATF_LIGHT but it certainly does not hurt. // TNT's MAP31 also needs COMPATF_STAIRINDEX but that only gets activated for TNT.WAD. - if (fileSystem.GetFileContainer(map->lumpnum) == fileSystem.GetIwadNum() && (gameinfo.flags & GI_COMPATSHORTTEX) && Level->maptype == MAPTYPE_DOOM) + if (fileSystem.GetFileContainer(map->lumpnum) == fileSystem.GetIwadNum()) { - Level->ii_compatflags = COMPATF_SHORTTEX|COMPATF_LIGHT; - if (gameinfo.flags & GI_COMPATSTAIRS) Level->ii_compatflags |= COMPATF_STAIRINDEX; + if ((gameinfo.flags & GI_COMPATSHORTTEX) && Level->maptype == MAPTYPE_DOOM) + { + Level->ii_compatflags = COMPATF_SHORTTEX | COMPATF_LIGHT; + if (gameinfo.flags & GI_COMPATSTAIRS) Level->ii_compatflags |= COMPATF_STAIRINDEX; + } + if (gameinfo.flags & GI_NOSECTIONMERGE) + { + Level->ib_compatflags |= BCOMPATF_NOSECTIONMERGE; + } } map->GetChecksum(md5.Bytes);