- migrated the global cutscenes to RMAPINFO as well.

This commit is contained in:
Christoph Oelckers 2021-05-02 12:22:40 +02:00
parent 2d4e91615f
commit 4458f8c929
5 changed files with 110 additions and 19 deletions

View file

@ -876,6 +876,96 @@ void FMapInfoParser::ParseEpisodeInfo ()
} }
//==========================================================================
//
//
//
//==========================================================================
void FMapInfoParser::ParseCutsceneInfo()
{
unsigned int i;
FString map;
FString pic;
FString name;
bool remove = false;
char key = 0;
int flags = 0;
ParseOpenBrace();
while (sc.GetString())
{
if (sc.Compare("intro"))
{
ParseCutscene(globalCutscenes.Intro);
}
else if (sc.Compare("defaultmapintro"))
{
ParseCutscene(globalCutscenes.DefaultMapIntro);
}
else if (sc.Compare("defaultmapoutro"))
{
ParseCutscene(globalCutscenes.DefaultMapOutro);
}
else if (sc.Compare("defaultgameover"))
{
ParseCutscene(globalCutscenes.DefaultGameover);
}
else if (sc.Compare("sharewareend"))
{
ParseCutscene(globalCutscenes.SharewareEnd);
}
else if (sc.Compare("loadscreen"))
{
ParseCutscene(globalCutscenes.LoadingScreen);
}
else if (!ParseCloseBrace())
{
// Unknown
sc.ScriptMessage("Unknown property '%s' found in episode definition\n", sc.String);
SkipToNext();
}
else
{
break;
}
}
CheckEndOfFile("episode");
for (i = 0; i < volumes.Size(); i++)
{
if (volumes[i].startmap.CompareNoCase(map) == 0)
{
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;
}
}
//========================================================================== //==========================================================================
// //
// SetLevelNum // SetLevelNum
@ -988,7 +1078,7 @@ void FMapInfoParser::ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord
} }
else if (sc.Compare("cutscenes")) else if (sc.Compare("cutscenes"))
{ {
//ParseCutsceneInfo(); ParseCutsceneInfo();
} }
else if (sc.Compare("gameinfo")) else if (sc.Compare("gameinfo"))
{ {

View file

@ -53,7 +53,6 @@ struct FMapInfoParser
bool CheckLegacyMapDefinition(FString& mapname); bool CheckLegacyMapDefinition(FString& mapname);
bool ParseLookupName(FString &dest); bool ParseLookupName(FString &dest);
void ParseMusic(FString &name, int &order); void ParseMusic(FString &name, int &order);
//void ParseLumpOrTextureName(char *name);
void ParseLumpOrTextureName(FString &name); void ParseLumpOrTextureName(FString &name);
void ParseCutscene(CutsceneDef& cdef); void ParseCutscene(CutsceneDef& cdef);
@ -62,7 +61,7 @@ struct FMapInfoParser
MapRecord *ParseMapHeader(MapRecord &defaultinfo); MapRecord *ParseMapHeader(MapRecord &defaultinfo);
void ParseMapDefinition(MapRecord &leveldef); void ParseMapDefinition(MapRecord &leveldef);
void ParseEpisodeInfo (); void ParseEpisodeInfo ();
void ParseSkill (); void ParseCutsceneInfo();
void ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord &defaultinfo); void ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord &defaultinfo);
void ParseOpenBrace(); void ParseOpenBrace();

View file

@ -85,6 +85,7 @@ struct GlobalCutscenes
CutsceneDef Intro; CutsceneDef Intro;
CutsceneDef DefaultMapIntro; CutsceneDef DefaultMapIntro;
CutsceneDef DefaultMapOutro; CutsceneDef DefaultMapOutro;
CutsceneDef DefaultGameover;
CutsceneDef SharewareEnd; CutsceneDef SharewareEnd;
CutsceneDef LoadingScreen; CutsceneDef LoadingScreen;
FString MPSummaryScreen; FString MPSummaryScreen;

View file

@ -1,19 +1,3 @@
// Cutscene definitions for Duke
definecutscene intro
{
function DukeCutscenes.BuildIntro
}
definecutscene sharewareend
{
function DukeCutscenes.BuildSharewareEnd
}
definecutscene loading
{
function DukeCutscenes.BuildLoading
}
definecutscene summary DukeCutscenes.BuildSPSummary definecutscene summary DukeCutscenes.BuildSPSummary
definecutscene mpsummary DukeCutscenes.BuildMPSummary definecutscene mpsummary DukeCutscenes.BuildMPSummary

View file

@ -49,3 +49,20 @@ map { 4, 1 }
} }
} }
cutscenes
{
intro
{
function = DukeCutscenes.BuildIntro
}
sharewareend
{
function = DukeCutscenes.BuildSharewareEnd
}
loadscreen
{
function = DukeCutscenes.BuildLoading
}
}