From 4ac1376b9f55f4b738062841432d205364984c99 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Mon, 19 Jul 2021 12:24:47 +1000 Subject: [PATCH] - Make naming of multiplayer episode exclusion stuff from d0e6a7ea29f3ca2ce3d55cb09f537f17cd71d492 more generic and exclude invalid episodes from "Duke It Out in DC", "Duke Nuclear Winter" and "Duke Caribbean". --- source/core/gamecontrol.cpp | 6 +++--- source/core/gamecontrol.h | 2 +- source/core/gamestruct.h | 2 +- source/core/searchpaths.cpp | 4 ++-- source/games/duke/src/duke3d.h | 2 +- source/games/duke/src/gamedef.cpp | 12 ++++++------ wadsrc/static/engine/grpinfo.txt | 25 +++++++++++++++++++------ 7 files changed, 33 insertions(+), 20 deletions(-) diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index 1e257d12f..7a979d9ca 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -949,11 +949,11 @@ int RunGame() colorset = true; } } - if (grp.FileInfo.mpepisodes.Size()) + if (grp.FileInfo.exclepisodes.Size()) { - for (auto& mpepisode : grp.FileInfo.mpepisodes) + for (auto& episode : grp.FileInfo.exclepisodes) { - gi->AddMultiplayerEpisode(mpepisode); + gi->AddExcludedEpisode(episode); } } } diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index 753c82c75..1d9c9573c 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -132,7 +132,7 @@ struct GrpInfo TArray tobedeleted; TArray loadfiles; TArray loadart; - TArray mpepisodes; + TArray exclepisodes; uint32_t FgColor = 0, BgColor = 0; }; diff --git a/source/core/gamestruct.h b/source/core/gamestruct.h index 3401b65f6..c78ae6359 100644 --- a/source/core/gamestruct.h +++ b/source/core/gamestruct.h @@ -120,7 +120,7 @@ struct GameInterface virtual void LeavePortal(spritetype* viewer, int type) {} virtual bool GetGeoEffect(GeoEffect* eff, int viewsector) { return false; } virtual int Voxelize(int sprnum) { return -1; } - virtual void AddMultiplayerEpisode(FString name) {} + virtual void AddExcludedEpisode(FString episode) {} virtual FString statFPS() { diff --git a/source/core/searchpaths.cpp b/source/core/searchpaths.cpp index 96fbb6aec..df4c6e51c 100644 --- a/source/core/searchpaths.cpp +++ b/source/core/searchpaths.cpp @@ -588,12 +588,12 @@ static TArray ParseGrpInfo(const char *fn, FileReader &fr, TMap mpEpisodes; +static TArray exclEpisodes; -void GameInterface::AddMultiplayerEpisode(FString name) +void GameInterface::AddExcludedEpisode(FString episode) { - mpEpisodes.Push(FStringTable::MakeMacro(name.GetChars())); + exclEpisodes.Push(FStringTable::MakeMacro(episode.GetChars())); } @@ -1681,11 +1681,11 @@ int ConCompiler::parsecommand() auto clust = MustFindCluster(j + 1); vol->name = clust->name = FStringTable::MakeMacro(parsebuffer.Data(), i); if (j > 0) vol->flags |= VF_SHAREWARELOCK; - if (mpEpisodes.Size()) + if (exclEpisodes.Size()) { - for (auto& mpEpisode : mpEpisodes) + for (auto& episode : exclEpisodes) { - if (vol->name == mpEpisode) + if (vol->name == episode) { vol->flags |= VF_HIDEFROMSP; } diff --git a/wadsrc/static/engine/grpinfo.txt b/wadsrc/static/engine/grpinfo.txt index 0ec56a4e5..be490ee49 100644 --- a/wadsrc/static/engine/grpinfo.txt +++ b/wadsrc/static/engine/grpinfo.txt @@ -203,6 +203,7 @@ grpinfo dependency DUKE13_CRC gamefilter "Duke.DukeDC.13" GameID "DukeDC13" + exclepisodes "L.A. MELTDOWN", "LUNAR APOCALYPSE", "THE BIRTH" } grpinfo @@ -214,6 +215,7 @@ grpinfo dependency DUKE15_CRC gamefilter "Duke.DukeDC.13" GameID "DukeDC" + exclepisodes "L.A. MELTDOWN", "LUNAR APOCALYPSE", "THE BIRTH" } grpinfo @@ -225,6 +227,7 @@ grpinfo dependency DUKE15_CRC gamefilter "Duke.DukeDC.15" GameID "DukeDC" + exclepisodes "L.A. MELTDOWN", "LUNAR APOCALYPSE", "THE BIRTH" } grpinfo @@ -237,6 +240,7 @@ grpinfo dependency DUKE15_CRC gamefilter "Duke.DukeDC.15" GameID "DukeDC" + exclepisodes "L.A. MELTDOWN", "LUNAR APOCALYPSE", "THE BIRTH" } grpinfo @@ -249,6 +253,7 @@ grpinfo dependency DUKE15_CRC gamefilter "Duke.DukeDC.15" GameID "DukeDC" + exclepisodes "L.A. MELTDOWN", "LUNAR APOCALYPSE", "THE BIRTH" } grpinfo @@ -262,6 +267,7 @@ grpinfo FgColor 0x00004f BkColor 0x8f8fff GameID "DukeVacation13" + exclepisodes "L.A. MELTDOWN", "VACATION DUKEMATCH", "THE BIRTH" } grpinfo @@ -275,6 +281,7 @@ grpinfo FgColor 0x00004f BkColor 0x8f8fff GameID "DukeVacation" + exclepisodes "L.A. MELTDOWN", "VACATION DUKEMATCH", "THE BIRTH" } grpinfo @@ -288,6 +295,7 @@ grpinfo FgColor 0x00004f BkColor 0x8f8fff GameID "DukeVacation" + exclepisodes "L.A. MELTDOWN", "VACATION DUKEMATCH", "THE BIRTH" } @@ -302,6 +310,7 @@ grpinfo FgColor 0x00004f BkColor 0x8f8fff GameID "DukeVacation" + exclepisodes "L.A. MELTDOWN", "VACATION DUKEMATCH", "THE BIRTH" } grpinfo @@ -316,6 +325,7 @@ grpinfo FgColor 0x00004f BkColor 0x8f8fff GameID "DukeVacation" + exclepisodes "L.A. MELTDOWN", "VACATION DUKEMATCH", "THE BIRTH" } grpinfo @@ -330,6 +340,7 @@ grpinfo FgColor 0x00004f BkColor 0x8f8fff GameID "DukeVacation" + exclepisodes "L.A. MELTDOWN", "VACATION DUKEMATCH", "THE BIRTH" } grpinfo @@ -344,6 +355,7 @@ grpinfo FgColor 0 BkColor 0x8f8f8f GameID "NuclearWinter" + exclepisodes "L.A. MELTDOWN" } grpinfo @@ -357,6 +369,7 @@ grpinfo gamefilter "Duke.NWinter" FgColor 0 BkColor 0x8f8f8f + exclepisodes "L.A. MELTDOWN" } grpinfo @@ -717,7 +730,7 @@ grpinfo FgColor 0xbc9e89 BkColor 0x7f3300 GameID "Redneck" - mpepisodes "PISSIN' CONTEST" + exclepisodes "PISSIN' CONTEST" } grpinfo @@ -732,7 +745,7 @@ grpinfo FgColor 0xbc9e89 BkColor 0x7f3300 GameID "RedneckRides" - mpepisodes "PISSIN' CONTEST" + exclepisodes "PISSIN' CONTEST" } grpinfo @@ -774,7 +787,7 @@ grpinfo FgColor 0 BkColor 0x78720d GameID "Nam" - mpepisodes "MULTIPLAYER I", "MULTIPLAYER II" + exclepisodes "MULTIPLAYER I", "MULTIPLAYER II" } grpinfo @@ -788,7 +801,7 @@ grpinfo FgColor 0 BkColor 0x78720d GameID "Nam" - mpepisodes "MULTIPLAYER I", "MULTIPLAYER II" + exclepisodes "MULTIPLAYER I", "MULTIPLAYER II" } grpinfo @@ -802,7 +815,7 @@ grpinfo FgColor 0 BkColor 0x78720d GameID "WW2GI" - mpepisodes "MULTIPLAYER I", "MULTIPLAYER II" + exclepisodes "MULTIPLAYER I", "MULTIPLAYER II" } grpinfo @@ -815,7 +828,7 @@ grpinfo dependency WW2GI_CRC gamefilter "WW2GI.Platoon" GameID "PlatoonLeader" - mpepisodes "MULTIPLAYER I", "MULTIPLAYER II" + exclepisodes "MULTIPLAYER I", "MULTIPLAYER II" } grpinfo