- migrated Duke's cutscene definitions to the new RMAPINFO.txt.

This commit is contained in:
Christoph Oelckers 2021-05-02 12:02:55 +02:00
parent dbd179be5c
commit 2d4e91615f
5 changed files with 68 additions and 60 deletions

View file

@ -234,7 +234,7 @@ void FMapInfoParser::ParseCutscene(CutsceneDef& cdef)
{ {
sc.MustGetString(); sc.MustGetString();
if (sc.Compare("video")) { ParseAssign(); sc.MustGetString(); cdef.video = sc.String; cdef.function = ""; } 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("sound")) { ParseAssign(); sc.MustGetString(); cdef.soundName = sc.String; }
else if (sc.Compare("soundid")) { ParseAssign(); sc.MustGetNumber(); cdef.soundID = sc.Number; } else if (sc.Compare("soundid")) { ParseAssign(); sc.MustGetNumber(); cdef.soundID = sc.Number; }
else if (sc.Compare("fps")) { ParseAssign(); sc.MustGetNumber(); cdef.framespersec = 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")) else if (sc.Compare("intro"))
{ {
ParseAssign();
ParseCutscene(clusterinfo->intro); ParseCutscene(clusterinfo->intro);
} }
else if (sc.Compare("outro")) else if (sc.Compare("outro"))
{ {
ParseAssign();
ParseCutscene(clusterinfo->outro); ParseCutscene(clusterinfo->outro);
} }
else if (sc.Compare("gameover")) else if (sc.Compare("gameover"))
{ {
ParseAssign();
ParseCutscene(clusterinfo->gameover); ParseCutscene(clusterinfo->gameover);
} }
else if (sc.Compare("interbackground")) else if (sc.Compare("interbackground"))
@ -321,15 +318,14 @@ bool FMapInfoParser::CheckLegacyMapDefinition(FString& mapname)
int indx = sc.Number; int indx = sc.Number;
auto map = FindMapByIndexOnly(vol, indx); auto map = FindMapByIndexOnly(vol, indx);
if (!map) I_Error("Map {%d, %d} does not exist", 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 else
{ {
// SW only uses the level number // SW only uses the level number
auto map = FindMapByLevelNum(vol); auto map = FindMapByLevelNum(vol);
if (!map) I_Error("Map {%d} does not exist", 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("}"); sc.MustGetStringName("}");
return true; return true;
@ -444,13 +440,11 @@ DEFINE_MAP_OPTION(cdtrack, true)
DEFINE_MAP_OPTION(intro, true) DEFINE_MAP_OPTION(intro, true)
{ {
parse.ParseAssign();
parse.ParseCutscene(info->intro); parse.ParseCutscene(info->intro);
} }
DEFINE_MAP_OPTION(outro, true) DEFINE_MAP_OPTION(outro, true)
{ {
parse.ParseAssign();
parse.ParseCutscene(info->outro); parse.ParseCutscene(info->outro);
} }
@ -769,7 +763,7 @@ MapRecord *FMapInfoParser::ParseMapHeader(MapRecord &defaultinfo)
} }
else else
{ {
if (map->name.IsEmpty()) I_Error("Missing level name"); if (map->name.IsEmpty()) sc.ScriptError("Missing level name");
sc.UnGet(); sc.UnGet();
} }
map->levelNumber = GetDefaultLevelNum(map->labelName); map->levelNumber = GetDefaultLevelNum(map->labelName);
@ -992,6 +986,10 @@ void FMapInfoParser::ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord
mapList.Clear(); mapList.Clear();
clusters.Clear(); clusters.Clear();
} }
else if (sc.Compare("cutscenes"))
{
//ParseCutsceneInfo();
}
else if (sc.Compare("gameinfo")) else if (sc.Compare("gameinfo"))
{ {
// todo: global game propeties. // todo: global game propeties.

View file

@ -74,6 +74,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "v_draw.h" #include "v_draw.h"
#include "gi.h" #include "gi.h"
#include "vm.h" #include "vm.h"
#include "g_mapinfo.h"
CVAR(Bool, autoloadlights, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CVAR(Bool, autoloadlights, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR(Bool, autoloadbrightmaps, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CVAR(Bool, autoloadbrightmaps, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
@ -961,6 +962,7 @@ int RunGame()
StartScreen->Progress(); StartScreen->Progress();
gi->app_init(); gi->app_init();
StartScreen->Progress(); StartScreen->Progress();
G_ParseMapInfo();
CreateStatusBar(); CreateStatusBar();
SetDefaultMenuColors(); SetDefaultMenuColors();
M_Init(); M_Init();

View file

@ -5,54 +5,6 @@ definecutscene intro
function DukeCutscenes.BuildIntro 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 definecutscene sharewareend
{ {
function DukeCutscenes.BuildSharewareEnd function DukeCutscenes.BuildSharewareEnd

View file

@ -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
}
}

View file

@ -579,8 +579,13 @@ class DukeLevelSummaryScreen : SummaryScreenBase
{ {
Super.Init(fadein | fadeout); Super.Init(fadein | fadeout);
SetParameters(m, s); SetParameters(m, s);
int vol = level.cluster; String basetex = level.InterBackground;
String basetex = vol == 2? "BONUSSCREEN2" : "BONUSSCREEN"; if (basetex.length() == 0)
{
let cluster = level.GetCluster();
if (cluster != null) basetex = cluster.InterBackground;
}
if (basetex.length() == 0) basetex = "BONUSSCREEN";
texBg = TexMan.CheckForTexture(basetex); texBg = TexMan.CheckForTexture(basetex);
for(int i = 0; i < 4; i++) for(int i = 0; i < 4; i++)
{ {