From d39ee1daf328a61f324abde7c94fc921a7b93981 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 16:56:49 +0100 Subject: [PATCH 1/3] - added a new thinker statnum STAT_STATIC which do not get deleted between levels. --- src/d_main.cpp | 1 + src/dthinker.cpp | 2 +- src/g_level.cpp | 1 + src/p_actionfunctions.cpp | 2 +- src/p_setup.cpp | 1 + src/statnums.h | 1 + 6 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index c7a001dfe..02cbca73a 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -2708,6 +2708,7 @@ void D_DoomMain (void) // clean up game state ST_Clear(); D_ErrorCleanup (); + DThinker::DestroyThinkersInList(STAT_STATIC); P_FreeLevelData(); P_FreeExtraLevelData(); diff --git a/src/dthinker.cpp b/src/dthinker.cpp index da68d8388..fddc28317 100644 --- a/src/dthinker.cpp +++ b/src/dthinker.cpp @@ -422,7 +422,7 @@ void DThinker::DestroyAllThinkers () for (i = 0; i <= MAX_STATNUM; i++) { - if (i != STAT_TRAVELLING) + if (i != STAT_TRAVELLING && i != STAT_STATIC) { DestroyThinkersInList (Thinkers[i]); DestroyThinkersInList (FreshThinkers[i]); diff --git a/src/g_level.cpp b/src/g_level.cpp index b811c1215..01911f742 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -427,6 +427,7 @@ void G_InitNew (const char *mapname, bool bTitleLevel) UnlatchCVars (); G_VerifySkill(); UnlatchCVars (); + DThinker::DestroyThinkersInList(STAT_STATIC); if (paused) { diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 8f916614b..16c8c3267 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -1124,7 +1124,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SeekerMissile) PARAM_INT_DEF(chance); PARAM_INT_DEF(distance); - if ((flags & SMF_LOOK) && (self->tracer == 0) && (pr_seekermissile()tracer == nullptr) && (pr_seekermissile()tracer = P_RoughMonsterSearch (self, distance, true); } diff --git a/src/p_setup.cpp b/src/p_setup.cpp index ac7faea76..308054a8b 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -4202,6 +4202,7 @@ void P_Init () static void P_Shutdown () { // [ZZ] delete global event handlers + DThinker::DestroyThinkersInList(STAT_STATIC); E_Shutdown(false); P_DeinitKeyMessages (); P_FreeLevelData (); diff --git a/src/statnums.h b/src/statnums.h index 7f691e232..dd868bbe1 100644 --- a/src/statnums.h +++ b/src/statnums.h @@ -45,6 +45,7 @@ enum STAT_AUTODECAL, // A decal that can be automatically deleted STAT_CORPSEPOINTER, // An entry in Hexen's corpse queue STAT_TRAVELLING, // An actor temporarily travelling to a new map + STAT_STATIC, // persistent across maps. // Thinkers that do think STAT_FIRST_THINKING=32, From 13c6cebef3fbf0f76af6c2b3f6cecf1fdb5bbab2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 16:57:46 +0100 Subject: [PATCH 2/3] - call WI_updateAnimatedBack only once from WI_Ticker instead of from each single WI_update function. --- src/wi_stuff.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 7e7fe4d15..a7f6b8f17 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -1090,8 +1090,6 @@ public: void WI_updateNoState () { - WI_updateAnimatedBack(); - if (acceleratestage) { cnt = 0; @@ -1140,8 +1138,6 @@ public: void WI_updateShowNextLoc () { - WI_updateAnimatedBack(); - if (!--cnt || acceleratestage) WI_initNoState(); else @@ -1239,8 +1235,6 @@ public: bool stillticking; bool autoskip = WI_autoSkip(); - WI_updateAnimatedBack(); - if ((acceleratestage || autoskip) && ng_state != 6) { acceleratestage = 0; @@ -1491,8 +1485,6 @@ public: bool stillticking; bool autoskip = WI_autoSkip(); - WI_updateAnimatedBack (); - if ((acceleratestage || autoskip) && ng_state != 10) { acceleratestage = 0; @@ -1786,8 +1778,6 @@ public: void WI_updateStats () { - WI_updateAnimatedBack (); - if (acceleratestage && sp_state != 10) { acceleratestage = 0; @@ -2165,6 +2155,7 @@ static FIntermissionScreen WI_Screen; void WI_Ticker() { + WI_Screen.WI_updateAnimatedBack(); WI_Screen.WI_Ticker(); } From b2a1e03d7e09ec368a818b75177dd29c24334c59 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 25 Feb 2017 17:14:03 +0100 Subject: [PATCH 3/3] - fprgot to commit the script-side definition of STAT_STATIC. --- wadsrc/static/zscript/base.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 0aba717cb..d8fed2f28 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -353,6 +353,7 @@ class Thinker : Object native STAT_AUTODECAL, // A decal that can be automatically deleted STAT_CORPSEPOINTER, // An entry in Hexen's corpse queue STAT_TRAVELLING, // An actor temporarily travelling to a new map + STAT_STATIC, // Thinkers that do think STAT_FIRST_THINKING=32,