From ce351cc951c75cbd9d297222a8e6d56d6c49b098 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Sun, 23 May 2021 16:24:40 +0700 Subject: [PATCH] add e1m4b and e1m8b UMAPINFOs (#209) * add W_ListNumFromName from PrBoom+, add e1m4b and e1m8b UMAPINFOs * add labels * remove W_ListNumFromName, add D_ProcessUMInWads --- Source/d_main.c | 23 +++++++++++++++++------ autoload/e1m4b.wad/umapinfo.lmp | 5 +++++ autoload/e1m8b.wad/umapinfo.lmp | 5 +++++ 3 files changed, 27 insertions(+), 6 deletions(-) create mode 100644 autoload/e1m4b.wad/umapinfo.lmp create mode 100644 autoload/e1m8b.wad/umapinfo.lmp diff --git a/Source/d_main.c b/Source/d_main.c index 005147c0..bfa2f410 100644 --- a/Source/d_main.c +++ b/Source/d_main.c @@ -1595,6 +1595,22 @@ static void D_ProcessDehInWad(int i) #define D_ProcessDehInWads() D_ProcessDehInWad(lumpinfo[W_LumpNameHash \ ("dehacked") % (unsigned) numlumps].index); +// Process multiple UMAPINFO files + +static void D_ProcessUMInWad(int i) +{ + if (i >= 0) + { + D_ProcessUMInWad(lumpinfo[i].next); + if (!strncasecmp(lumpinfo[i].name, "umapinfo", 8) && + lumpinfo[i].namespace == ns_global) + U_ParseMapInfo((const char *)W_CacheLumpNum(i, PU_CACHE), W_LumpLength(i)); + } +} + +#define D_ProcessUMInWads() D_ProcessUMInWad(lumpinfo[W_LumpNameHash \ + ("umapinfo") % (unsigned) numlumps].index); + // [FG] fast-forward demo to the desired map int demowarp = -1; @@ -1946,12 +1962,7 @@ void D_DoomMain(void) if (!M_CheckParm("-nomapinfo")) { - int lumpnum; - if ( (lumpnum = W_CheckNumForName("UMAPINFO")) != -1 ) - { - const char * lump = (const char *)W_CacheLumpNum(lumpnum, PU_STATIC); - U_ParseMapInfo(lump, W_LumpLength(lumpnum)); - } + D_ProcessUMInWads(); } V_InitColorTranslation(); //jff 4/24/98 load color translation lumps diff --git a/autoload/e1m4b.wad/umapinfo.lmp b/autoload/e1m4b.wad/umapinfo.lmp new file mode 100644 index 00000000..1ab6fb6d --- /dev/null +++ b/autoload/e1m4b.wad/umapinfo.lmp @@ -0,0 +1,5 @@ +map E1M4 +{ + levelname = "Phobos Mission Control" + label = "E1M4b" +} diff --git a/autoload/e1m8b.wad/umapinfo.lmp b/autoload/e1m8b.wad/umapinfo.lmp new file mode 100644 index 00000000..92a4936f --- /dev/null +++ b/autoload/e1m8b.wad/umapinfo.lmp @@ -0,0 +1,5 @@ +map E1M8 +{ + levelname = "Tech Gone Bad" + label = "E1M8b" +}