From 15f9861633c0d99620e70dc9faed7931411d3120 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 2 May 2021 12:28:32 +0200 Subject: [PATCH] - summary screens, too. --- source/core/g_mapinfo.cpp | 72 ++++++++++++------- source/core/g_mapinfo.h | 1 + wadsrc/static/filter/duke/engine/engine.def | 4 -- wadsrc/static/filter/duke/engine/rmapinfo.txt | 6 ++ 4 files changed, 53 insertions(+), 30 deletions(-) delete mode 100644 wadsrc/static/filter/duke/engine/engine.def diff --git a/source/core/g_mapinfo.cpp b/source/core/g_mapinfo.cpp index 060434ebb..c899cb35d 100644 --- a/source/core/g_mapinfo.cpp +++ b/source/core/g_mapinfo.cpp @@ -931,38 +931,58 @@ void FMapInfoParser::ParseCutsceneInfo() break; } } - CheckEndOfFile("episode"); + CheckEndOfFile("cutscenes"); +} - for (i = 0; i < volumes.Size(); i++) +//========================================================================== +// +// +// +//========================================================================== + +void FMapInfoParser::ParseGameInfo() +{ + unsigned int i; + FString map; + FString pic; + FString name; + bool remove = false; + char key = 0; + int flags = 0; + + ParseOpenBrace(); + + while (sc.GetString()) { - if (volumes[i].startmap.CompareNoCase(map) == 0) + if (sc.Compare("summaryscreen")) + { + ParseAssign(); + sc.SetCMode(false); + sc.MustGetString(); + sc.SetCMode(false); + globalCutscenes.SummaryScreen = sc.String; + } + else if (sc.Compare("mpsummaryscreen")) + { + ParseAssign(); + sc.SetCMode(false); + sc.MustGetString(); + sc.SetCMode(false); + globalCutscenes.MPSummaryScreen = sc.String; + } + else if (!ParseCloseBrace()) + { + // Unknown + sc.ScriptMessage("Unknown property '%s' found in episode definition\n", sc.String); + SkipToNext(); + } + else { break; } } - - if (remove) - { - // If the remove property is given for an episode, remove it. - volumes.Delete(i); - } - else - { - // Only allocate a new entry if this doesn't replace an existing episode. - if (i >= volumes.Size()) - { - i = volumes.Reserve(1); - } - - auto epi = &volumes[i]; - - epi->startmap = map; - epi->name = name; - epi->shortcut = tolower(key); - epi->flags = flags; - epi->index = i; - } + CheckEndOfFile("cutscenes"); } @@ -1082,7 +1102,7 @@ void FMapInfoParser::ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord } else if (sc.Compare("gameinfo")) { - // todo: global game propeties. + ParseGameInfo(); } else { diff --git a/source/core/g_mapinfo.h b/source/core/g_mapinfo.h index be7e22284..6131b1e97 100644 --- a/source/core/g_mapinfo.h +++ b/source/core/g_mapinfo.h @@ -62,6 +62,7 @@ struct FMapInfoParser void ParseMapDefinition(MapRecord &leveldef); void ParseEpisodeInfo (); void ParseCutsceneInfo(); + void ParseGameInfo(); void ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord &defaultinfo); void ParseOpenBrace(); diff --git a/wadsrc/static/filter/duke/engine/engine.def b/wadsrc/static/filter/duke/engine/engine.def deleted file mode 100644 index 78677d761..000000000 --- a/wadsrc/static/filter/duke/engine/engine.def +++ /dev/null @@ -1,4 +0,0 @@ - -definecutscene summary DukeCutscenes.BuildSPSummary -definecutscene mpsummary DukeCutscenes.BuildMPSummary - diff --git a/wadsrc/static/filter/duke/engine/rmapinfo.txt b/wadsrc/static/filter/duke/engine/rmapinfo.txt index 21ee09ac5..4462a9795 100644 --- a/wadsrc/static/filter/duke/engine/rmapinfo.txt +++ b/wadsrc/static/filter/duke/engine/rmapinfo.txt @@ -66,3 +66,9 @@ cutscenes function = DukeCutscenes.BuildLoading } } + +gameinfo +{ + summaryscreen = DukeCutscenes.BuildSPSummary + mpsummaryscreen = DukeCutscenes.BuildMPSummary +} \ No newline at end of file