From a28b4ea06a0e086f085d3f3108a9a82ebb956e20 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 2 May 2021 13:29:41 +0200 Subject: [PATCH] - migrated Route66 and fixed some issues pointed out by this mod. --- source/core/g_mapinfo.cpp | 31 +++-- .../redneck.route66/engine/rmapinfo.txt | 109 ++++++++++++++++++ 2 files changed, 129 insertions(+), 11 deletions(-) create mode 100644 wadsrc/static/filter/redneck.route66/engine/rmapinfo.txt diff --git a/source/core/g_mapinfo.cpp b/source/core/g_mapinfo.cpp index 5e5a38d65..a0dadc7f8 100644 --- a/source/core/g_mapinfo.cpp +++ b/source/core/g_mapinfo.cpp @@ -317,15 +317,15 @@ bool FMapInfoParser::CheckLegacyMapDefinition(FString& mapname) sc.MustGetNumber(); int indx = sc.Number; auto map = FindMapByIndexOnly(vol, indx); - if (!map) I_Error("Map {%d, %d} does not exist", vol, indx); - mapname = map->labelName; + if (!map) mapname = ""; + else 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->labelName; + if (!map) mapname = ""; + else mapname = map->labelName; } sc.MustGetStringName("}"); return true; @@ -744,23 +744,32 @@ static int GetDefaultLevelNum(const char *mapname) // Parses the header of a map definition ('map mapxx mapname') // //========================================================================== +static MapRecord sink; MapRecord *FMapInfoParser::ParseMapHeader(MapRecord &defaultinfo) { FString mapname; + MapRecord* map; if (!CheckLegacyMapDefinition(mapname)) { ParseLookupName(mapname); } - auto map = FindMapByName(mapname); - if (!map) + if (mapname.IsEmpty()) { - map = AllocateMap(); - *map = defaultinfo; - DefaultExtension(mapname, ".map"); - map->SetFileName(mapname); + map = &sink; // parse over the entire definition but discard the result. + } + else + { + map = FindMapByName(mapname); + if (!map) + { + map = AllocateMap(); + *map = defaultinfo; + DefaultExtension(mapname, ".map"); + map->SetFileName(mapname); + } } if (!sc.CheckString("{")) @@ -770,7 +779,7 @@ MapRecord *FMapInfoParser::ParseMapHeader(MapRecord &defaultinfo) } else { - if (map->name.IsEmpty()) sc.ScriptError("Missing level name"); + if (map != &sink && map->name.IsEmpty()) sc.ScriptError("Missing level name"); sc.UnGet(); } map->levelNumber = GetDefaultLevelNum(map->labelName); diff --git a/wadsrc/static/filter/redneck.route66/engine/rmapinfo.txt b/wadsrc/static/filter/redneck.route66/engine/rmapinfo.txt new file mode 100644 index 000000000..59246e710 --- /dev/null +++ b/wadsrc/static/filter/redneck.route66/engine/rmapinfo.txt @@ -0,0 +1,109 @@ +// Cutscene definitions for RRR66. This is a little bit different than the main game. + +cluster 2 +{ + outro + { + function = RRCutscenes.BuildE2End + } +} + +map { 1, 1 } +{ + interbackground = "BONUSPIC01" + rr_startsound = 391 // fixme: allow symbolic names +} + +map { 1, 2 } +{ + interbackground = "BONUSPIC02" + rr_startsound = 64 +} + +map { 1, 3 } +{ + interbackground = "BONUSPIC03" + rr_startsound = 77 +} + +map { 1, 4 } +{ + interbackground = "BONUSPIC04" + rr_startsound = 80 +} + +map { 1, 5 } +{ + interbackground = "BONUSPIC05" + rr_startsound = 102 +} + +map { 1, 6 } +{ + interbackground = "BONUSPIC06" + rr_startsound = 103 +} + +map { 1, 7 } +{ + interbackground = "BONUSPIC07" + rr_startsound = 104 +} + +map { 2, 1 } +{ + interbackground = "BONUSPIC08" + rr_startsound = 105 +} + +map { 2, 2 } +{ + interbackground = "BONUSPIC09" + rr_startsound = 176 + clearweapons +} + +map { 2, 3 } +{ + interbackground = "BONUSPIC10" + rr_startsound = 177 +} + +map { 2, 4 } +{ + interbackground = "BONUSPIC11" + rr_startsound = 198 +} + +map { 2, 5 } +{ + interbackground = "BONUSPIC12" + rr_startsound = 230 +} + +map { 2, 6 } +{ + interbackground = "BONUSPIC13" + rr_startsound = 255 +} + +map { 2, 7 } +{ + interbackground = "BONUSPIC14" + rr_startsound = 283 + PrecacheTextures = "UFO1", "UFO2", "UFO3", "UFO4", "UFO5" +} + +cutscenes +{ + loadscreen + { + function = DukeCutscenes.BuildLoading // identical with Duke's + } +} + +gameinfo +{ + summaryscreen = RRCutscenes.BuildSPSummary + mpsummaryscreen = DukeCutscenes.BuildMPSummary // identical with Duke's +}