diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index b629626be..732dd6c41 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -17,6 +17,7 @@ #include "gamecontrol.h" #include "palettecontainer.h" #include "mapinfo.h" +#include "s_soundinternal.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); diff --git a/source/core/parsefuncs.h b/source/core/parsefuncs.h index 5c23b6e02..778ea2532 100644 --- a/source/core/parsefuncs.h +++ b/source/core/parsefuncs.h @@ -67,7 +67,13 @@ static void parseCutscene(FScanner& sc, CutsceneDef& cdef) } 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); } - 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); } - 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); } diff --git a/wadsrc/static/filter/duke/engine/engine.def b/wadsrc/static/filter/duke/engine/engine.def new file mode 100644 index 000000000..8adfcea29 --- /dev/null +++ b/wadsrc/static/filter/duke/engine/engine.def @@ -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 diff --git a/wadsrc/static/zscript/games/duke/ui/cutscenes.zs b/wadsrc/static/zscript/games/duke/ui/cutscenes.zs index d8592bdd3..ed90b8149 100644 --- a/wadsrc/static/zscript/games/duke/ui/cutscenes.zs +++ b/wadsrc/static/zscript/games/duke/ui/cutscenes.zs @@ -354,6 +354,7 @@ struct RRCutscenes static void BuildMapIntro(ScreenJobRunner runner, MapRecord map) { + if (!raze.isRRRA()) return; int ln = map.levelnumber; if (ln == 0) return; if (ln > 1000) ln -= 1000-7;