Skip to content

Commit

Permalink
- migrated Duke's cutscene definitions to the new RMAPINFO.txt.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed May 2, 2021
1 parent dbd179b commit 2d4e916
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 60 deletions.
18 changes: 8 additions & 10 deletions source/core/g_mapinfo.cpp
Expand Up @@ -234,7 +234,7 @@ void FMapInfoParser::ParseCutscene(CutsceneDef& cdef)
{
sc.MustGetString();
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("soundid")) { ParseAssign(); sc.MustGetNumber(); cdef.soundID = sc.Number; }
else if (sc.Compare("fps")) { ParseAssign(); sc.MustGetNumber(); cdef.framespersec = sc.Number; }
Expand Down Expand Up @@ -269,17 +269,14 @@ void FMapInfoParser::ParseCluster()
}
else if (sc.Compare("intro"))
{
ParseAssign();
ParseCutscene(clusterinfo->intro);
}
else if (sc.Compare("outro"))
{
ParseAssign();
ParseCutscene(clusterinfo->outro);
}
else if (sc.Compare("gameover"))
{
ParseAssign();
ParseCutscene(clusterinfo->gameover);
}
else if (sc.Compare("interbackground"))
Expand Down Expand Up @@ -321,15 +318,14 @@ bool FMapInfoParser::CheckLegacyMapDefinition(FString& mapname)
int indx = sc.Number;
auto map = FindMapByIndexOnly(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
{
// SW only uses the level number
auto map = FindMapByLevelNum(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("}");
return true;
Expand Down Expand Up @@ -444,13 +440,11 @@ DEFINE_MAP_OPTION(cdtrack, true)

DEFINE_MAP_OPTION(intro, true)
{
parse.ParseAssign();
parse.ParseCutscene(info->intro);
}

DEFINE_MAP_OPTION(outro, true)
{
parse.ParseAssign();
parse.ParseCutscene(info->outro);
}

Expand Down Expand Up @@ -769,7 +763,7 @@ MapRecord *FMapInfoParser::ParseMapHeader(MapRecord &defaultinfo)
}
else
{
if (map->name.IsEmpty()) I_Error("Missing level name");
if (map->name.IsEmpty()) sc.ScriptError("Missing level name");
sc.UnGet();
}
map->levelNumber = GetDefaultLevelNum(map->labelName);
Expand Down Expand Up @@ -992,6 +986,10 @@ void FMapInfoParser::ParseMapInfo (int lump, MapRecord &gamedefaults, MapRecord
mapList.Clear();
clusters.Clear();
}
else if (sc.Compare("cutscenes"))
{
//ParseCutsceneInfo();
}
else if (sc.Compare("gameinfo"))
{
// todo: global game propeties.
Expand Down
2 changes: 2 additions & 0 deletions source/core/gamecontrol.cpp
Expand Up @@ -74,6 +74,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "v_draw.h"
#include "gi.h"
#include "vm.h"
#include "g_mapinfo.h"

CVAR(Bool, autoloadlights, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
CVAR(Bool, autoloadbrightmaps, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
Expand Down Expand Up @@ -961,6 +962,7 @@ int RunGame()
StartScreen->Progress();
gi->app_init();
StartScreen->Progress();
G_ParseMapInfo();
CreateStatusBar();
SetDefaultMenuColors();
M_Init();
Expand Down
48 changes: 0 additions & 48 deletions wadsrc/static/filter/duke/engine/engine.def
Expand Up @@ -5,54 +5,6 @@ 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
{
outro
{
function DukeCutscenes.BuildE4End
}
}

definecutscene episode 5
{
outro
{
function DukeCutscenes.BuildE5End
}
}

definecutscene map e4l1
{
intro
{
function DukeCutscenes.BuildE4Intro
}
}

definecutscene sharewareend
{
function DukeCutscenes.BuildSharewareEnd
Expand Down
51 changes: 51 additions & 0 deletions wadsrc/static/filter/duke/engine/rmapinfo.txt
@@ -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
}
}

9 changes: 7 additions & 2 deletions wadsrc/static/zscript/games/duke/ui/screens.zs
Expand Up @@ -579,8 +579,13 @@ class DukeLevelSummaryScreen : SummaryScreenBase
{
Super.Init(fadein | fadeout);
SetParameters(m, s);
int vol = level.cluster;
String basetex = vol == 2? "BONUSSCREEN2" : "BONUSSCREEN";
String basetex = level.InterBackground;
if (basetex.length() == 0)
{
let cluster = level.GetCluster();
if (cluster != null) basetex = cluster.InterBackground;
}
if (basetex.length() == 0) basetex = "BONUSSCREEN";
texBg = TexMan.CheckForTexture(basetex);
for(int i = 0; i < 4; i++)
{
Expand Down

0 comments on commit 2d4e916

Please sign in to comment.