From 336c45aaa4d43d371a5446bb77a17d051583261b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 22 Apr 2022 12:43:08 +0200 Subject: [PATCH] - SCreenjob fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Still doesn’r show anything but we got it all set up now. --- src/common/cutscenes/screenjob.cpp | 6 ++---- src/d_main.cpp | 1 + src/g_game.cpp | 1 + src/g_level.cpp | 9 ++++++--- wadsrc/static/zscript/ui/intermission.zs | 11 ++++++++--- wadsrc/static/zscript/ui/statscreen/statscreen.zs | 11 ++++++++--- 6 files changed, 26 insertions(+), 13 deletions(-) diff --git a/src/common/cutscenes/screenjob.cpp b/src/common/cutscenes/screenjob.cpp index 4a0f1e97c5..28e0d682cb 100644 --- a/src/common/cutscenes/screenjob.cpp +++ b/src/common/cutscenes/screenjob.cpp @@ -312,16 +312,14 @@ bool StartCutscene(CutsceneDef& cs, int flags, const CompletionFunc& completion_ cs.Create(runner); if (!ScreenJobValidate()) { - runner->Destroy(); - runner = nullptr; + DeleteScreenJob(); return false; } if (sysCallbacks.StartCutscene) sysCallbacks.StartCutscene(flags & SJ_BLOCKUI); } catch (...) { - if (runner) runner->Destroy(); - runner = nullptr; + DeleteScreenJob(); throw; } return true; diff --git a/src/d_main.cpp b/src/d_main.cpp index a104f4ba40..97397cc83b 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -3385,6 +3385,7 @@ static int D_DoomMain_Internal (void) R_ParseTrnslate(); PClassActor::StaticInit (); + Job_Init(); // [GRB] Initialize player class list SetupPlayerClasses (); diff --git a/src/g_game.cpp b/src/g_game.cpp index a548361a7b..6e7088663f 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1190,6 +1190,7 @@ void G_Ticker () break; case ga_intermission: gamestate = GS_CUTSCENE; + gameaction = ga_nothing; break; diff --git a/src/g_level.cpp b/src/g_level.cpp index 4647c8b88c..eb3c882a95 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -956,8 +956,7 @@ void RunIntermission(DIntermissionController* intermissionScreen, DObject* statu if (!ScreenJobValidate()) { - runner->Destroy(); - runner = nullptr; + DeleteScreenJob(); if (completion) completion(false); completion = nullptr; return; @@ -1010,7 +1009,11 @@ void G_DoCompleted (void) } bool endgame = intermissionScreen && intermissionScreen->mEndGame; intermissionScreen = primaryLevel->CreateIntermission(); - RunIntermission(intermissionScreen, statusScreen, [=](bool) { if (!endgame) primaryLevel->WorldDone(); }); + RunIntermission(intermissionScreen, statusScreen, [=](bool) + { + if (!endgame) primaryLevel->WorldDone(); + + }); } //========================================================================== diff --git a/wadsrc/static/zscript/ui/intermission.zs b/wadsrc/static/zscript/ui/intermission.zs index 6bb2c988d9..424278e76a 100644 --- a/wadsrc/static/zscript/ui/intermission.zs +++ b/wadsrc/static/zscript/ui/intermission.zs @@ -19,7 +19,11 @@ class IntermissionScreenJob : ScreenJob { IntermissionController controller; - void Init(IntermissionController ctrl) { controller = ctrl; } + ScreenJob Init(IntermissionController ctrl) + { + controller = ctrl; + return self; + } override bool OnEvent(InputEvent evt) { return controller.Responder(evt); } override void OnTick() { if (!controller.Ticker()) jobstate = finished; } @@ -37,9 +41,10 @@ class StatusScreenJob : SkippableScreenJob { StatusScreen controller; - void Init(StatusScreen scr) + ScreenJob Init(StatusScreen scr) { controller = scr; + return self; } override void OnTick() { controller.Ticker(); if (controller.CurState == StatusScreen.LeavingIntermission) jobstate = finished; } @@ -54,7 +59,7 @@ class StatusScreenJob : SkippableScreenJob } -class DoomCutscenes +class DoomCutscenes ui { //--------------------------------------------------------------------------- // diff --git a/wadsrc/static/zscript/ui/statscreen/statscreen.zs b/wadsrc/static/zscript/ui/statscreen/statscreen.zs index f49c7f81e8..614f56739e 100644 --- a/wadsrc/static/zscript/ui/statscreen/statscreen.zs +++ b/wadsrc/static/zscript/ui/statscreen/statscreen.zs @@ -1,6 +1,6 @@ // Note that the status screen needs to run in 'play' scope! -class InterBackground native play version("2.5") +class InterBackground native ui version("2.5") { native static InterBackground Create(wbstartstruct wbst); native virtual bool LoadBackground(bool isenterpic); @@ -9,7 +9,7 @@ class InterBackground native play version("2.5") } // This is obsolete. Hopefully this was never used... -struct PatchInfo play version("2.5") +struct PatchInfo ui version("2.5") { Font mFont; deprecated("3.8") TextureID mPatch; @@ -39,7 +39,7 @@ struct PatchInfo play version("2.5") }; -class StatusScreen abstract play version("2.5") +class StatusScreen abstract ui version("2.5") { enum EValues { @@ -801,6 +801,11 @@ class StatusScreen abstract play version("2.5") accelerateStage = 1; } + void checkForAccelerate() + { + // no longer used, but still needed for old content. + } + // ==================================================================== // Ticker // Purpose: Do various updates every gametic, for stats, animation,