- added cutscene definitions for Duke and finalized the definecutscene parser.

This commit is contained in:
Christoph Oelckers 2021-04-26 19:16:45 +02:00
parent 021f1b7832
commit ef6d8c2c67
4 changed files with 64 additions and 3 deletions

View file

@ -17,6 +17,7 @@
#include "gamecontrol.h" #include "gamecontrol.h"
#include "palettecontainer.h" #include "palettecontainer.h"
#include "mapinfo.h" #include "mapinfo.h"
#include "s_soundinternal.h"
#include "parsefuncs.h" #include "parsefuncs.h"
int tileSetHightileReplacement(int picnum, int palnum, const char* filename, float alphacut, float xscale, float yscale, float specpower, float specfactor, uint8_t flags); int tileSetHightileReplacement(int picnum, int palnum, const char* filename, float alphacut, float xscale, float yscale, float specpower, float specfactor, uint8_t flags);

View file

@ -67,7 +67,13 @@ static void parseCutscene(FScanner& sc, CutsceneDef& cdef)
} }
if (sound.IsNotEmpty()) if (sound.IsNotEmpty())
{ {
cdef.sound = soundEngine->FindSound(sound);
if (cdef.sound == 0)
{
int lump = fileSystem.FindFile(sound);
if (lump < 0) return;
cdef.sound = FSoundID(soundEngine->AddSoundLump(sound, lump, 0));
}
} }
} }
@ -81,11 +87,11 @@ void parseDefineCutscene(FScanner& sc, FScriptPosition& pos)
{ {
parseCutscene(sc, globalCutscenes.Intro); parseCutscene(sc, globalCutscenes.Intro);
} }
if (sc.Compare("mapintro")) // sets the global default for a map entry handler. else if (sc.Compare("mapintro")) // sets the global default for a map entry handler.
{ {
parseCutscene(sc, globalCutscenes.DefaultMapIntro); parseCutscene(sc, globalCutscenes.DefaultMapIntro);
} }
if (sc.Compare("mapoutro")) // sets the global default for a map exit handler. else if (sc.Compare("mapoutro")) // sets the global default for a map exit handler.
{ {
parseCutscene(sc, globalCutscenes.DefaultMapOutro); parseCutscene(sc, globalCutscenes.DefaultMapOutro);
} }

View file

@ -0,0 +1,53 @@
// Cutscene definitions for Duke
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
{
intro
{
function DukeCutscenes.BuildE4Intro
}
outro
{
function DukeCutscenes.BuildE4End
}
}
definecutscene episode 5
{
outro
{
function DukeCutscenes.BuildE5End
}
}
definecutscene summary DukeCutscenes.BuildSPSummary
definecutscene mpsummary DukeCutscenes.BuildMPSummary

View file

@ -354,6 +354,7 @@ struct RRCutscenes
static void BuildMapIntro(ScreenJobRunner runner, MapRecord map) static void BuildMapIntro(ScreenJobRunner runner, MapRecord map)
{ {
if (!raze.isRRRA()) return;
int ln = map.levelnumber; int ln = map.levelnumber;
if (ln == 0) return; if (ln == 0) return;
if (ln > 1000) ln -= 1000-7; if (ln > 1000) ln -= 1000-7;