diff --git a/source/core/g_mapinfo.cpp b/source/core/g_mapinfo.cpp index 4100540f7..dda3500d5 100644 --- a/source/core/g_mapinfo.cpp +++ b/source/core/g_mapinfo.cpp @@ -234,7 +234,7 @@ void FMapInfoParser::ParseCutscene(CutsceneDef& cdef) { sc.MustGetString(); if (sc.Compare("video")) { ParseAssign(); sc.MustGetString(); cdef.video = sc.String; cdef.function = ""; } - else if (sc.Compare("function")) { ParseAssign(); sc.MustGetString(); cdef.function = sc.String; cdef.video = ""; } + else if (sc.Compare("function")) { ParseAssign(); sc.SetCMode(false); sc.MustGetString(); sc.SetCMode(true); cdef.function = sc.String; cdef.video = ""; } else if (sc.Compare("sound")) { ParseAssign(); sc.MustGetString(); cdef.soundName = sc.String; } else if (sc.Compare("soundid")) { ParseAssign(); sc.MustGetNumber(); cdef.soundID = sc.Number; } else if (sc.Compare("fps")) { ParseAssign(); sc.MustGetNumber(); cdef.framespersec = sc.Number; } @@ -269,17 +269,14 @@ void FMapInfoParser::ParseCluster() } else if (sc.Compare("intro")) { - ParseAssign(); ParseCutscene(clusterinfo->intro); } else if (sc.Compare("outro")) { - ParseAssign(); ParseCutscene(clusterinfo->outro); } else if (sc.Compare("gameover")) { - ParseAssign(); ParseCutscene(clusterinfo->gameover); } else if (sc.Compare("interbackground")) @@ -321,15 +318,14 @@ bool FMapInfoParser::CheckLegacyMapDefinition(FString& mapname) int indx = sc.Number; auto map = FindMapByIndexOnly(vol, indx); if (!map) I_Error("Map {%d, %d} does not exist", vol, indx); - mapname = map->fileName; // we need the actual file name for further processing. + mapname = map->labelName; } else { // SW only uses the level number auto map = FindMapByLevelNum(vol); if (!map) I_Error("Map {%d} does not exist", vol); - mapname = map->fileName; // we need the actual file name for further processing. - + mapname = map->labelName; } sc.MustGetStringName("}"); return true; @@ -444,13 +440,11 @@ DEFINE_MAP_OPTION(cdtrack, true) DEFINE_MAP_OPTION(intro, true) { - parse.ParseAssign(); parse.ParseCutscene(info->intro); } DEFINE_MAP_OPTION(outro, true) { - parse.ParseAssign(); parse.ParseCutscene(info->outro); } @@ -769,7 +763,7 @@ MapRecord *FMapInfoParser::ParseMapHeader(MapRecord &defaultinfo) } else { - if (map->name.IsEmpty()) I_Error("Missing level name"); + if (map->name.IsEmpty()) sc.ScriptError("Missing level name"); sc.UnGet(); } map->levelNumber = GetDefaultLevelNum(map->labelName); @@ -992,6 +986,10 @@ void FMapInfoParser::ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord mapList.Clear(); clusters.Clear(); } + else if (sc.Compare("cutscenes")) + { + //ParseCutsceneInfo(); + } else if (sc.Compare("gameinfo")) { // todo: global game propeties. diff --git a/source/core/gamecontrol.cpp b/source/core/gamecontrol.cpp index f1e362e82..362df73ad 100644 --- a/source/core/gamecontrol.cpp +++ b/source/core/gamecontrol.cpp @@ -74,6 +74,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "v_draw.h" #include "gi.h" #include "vm.h" +#include "g_mapinfo.h" CVAR(Bool, autoloadlights, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR(Bool, autoloadbrightmaps, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) @@ -961,6 +962,7 @@ int RunGame() StartScreen->Progress(); gi->app_init(); StartScreen->Progress(); + G_ParseMapInfo(); CreateStatusBar(); SetDefaultMenuColors(); M_Init(); diff --git a/wadsrc/static/filter/duke/engine/engine.def b/wadsrc/static/filter/duke/engine/engine.def index e9455553c..d85394543 100644 --- a/wadsrc/static/filter/duke/engine/engine.def +++ b/wadsrc/static/filter/duke/engine/engine.def @@ -5,54 +5,6 @@ definecutscene intro function DukeCutscenes.BuildIntro } -definecutscene episode 1 -{ - outro - { - function DukeCutscenes.BuildE1End - } -} - -definecutscene episode 2 -{ - outro - { - function DukeCutscenes.BuildE2End - } -} - -definecutscene episode 3 -{ - outro - { - function DukeCutscenes.BuildE3End - } -} - -definecutscene episode 4 -{ - outro - { - function DukeCutscenes.BuildE4End - } -} - -definecutscene episode 5 -{ - outro - { - function DukeCutscenes.BuildE5End - } -} - -definecutscene map e4l1 -{ - intro - { - function DukeCutscenes.BuildE4Intro - } -} - definecutscene sharewareend { function DukeCutscenes.BuildSharewareEnd diff --git a/wadsrc/static/filter/duke/engine/rmapinfo.txt b/wadsrc/static/filter/duke/engine/rmapinfo.txt new file mode 100644 index 000000000..0ed96c42d --- /dev/null +++ b/wadsrc/static/filter/duke/engine/rmapinfo.txt @@ -0,0 +1,51 @@ +//This sets up the missing things that cannot be inferred from the setup in the .CON files. + +cluster 1 +{ + outro + { + function = DukeCutscenes.BuildE1End + } +} + +cluster 2 +{ + outro + { + function = DukeCutscenes.BuildE2End + } + interbackground = "BONUSSCREEN2" +} + +cluster 3 +{ + outro + { + function = DukeCutscenes.BuildE3End + } +} + +cluster 4 +{ + outro + { + function = DukeCutscenes.BuildE4End + } +} + +cluster 5 +{ + outro + { + function = DukeCutscenes.BuildE5End + } +} + +map { 4, 1 } +{ + intro + { + function = DukeCutscenes.BuildE4Intro + } +} + diff --git a/wadsrc/static/zscript/games/duke/ui/screens.zs b/wadsrc/static/zscript/games/duke/ui/screens.zs index d36fe4b34..6228a19b8 100644 --- a/wadsrc/static/zscript/games/duke/ui/screens.zs +++ b/wadsrc/static/zscript/games/duke/ui/screens.zs @@ -579,8 +579,13 @@ class DukeLevelSummaryScreen : SummaryScreenBase { Super.Init(fadein | fadeout); SetParameters(m, s); - int vol = level.cluster; - String basetex = vol == 2? "BONUSSCREEN2" : "BONUSSCREEN"; + String basetex = level.InterBackground; + if (basetex.length() == 0) + { + let cluster = level.GetCluster(); + if (cluster != null) basetex = cluster.InterBackground; + } + if (basetex.length() == 0) basetex = "BONUSSCREEN"; texBg = TexMan.CheckForTexture(basetex); for(int i = 0; i < 4; i++) {