From c94f0f47a26fb414777ddd6022282156b11a9419 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 27 Jan 2019 15:02:37 +0100 Subject: [PATCH] - removed all remaining references to level and TThinkerIterator from p_floor.cpp, p_lights.cpp, p_pusher.cpp and p_scroll.cpp. --- src/p_floor.cpp | 10 +++++----- src/p_lights.cpp | 4 ++-- src/p_pusher.cpp | 6 +++--- src/p_scroll.cpp | 10 +++++----- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/p_floor.cpp b/src/p_floor.cpp index 45357bf8c..4f6e087b1 100644 --- a/src/p_floor.cpp +++ b/src/p_floor.cpp @@ -188,19 +188,19 @@ void DFloor::Tick () sector_t *sec = m_Sector; sec->stairlock = -1; // thinker done, promote lock to -1 - while (sec->prevsec != -1 && level.sectors[sec->prevsec].stairlock != -2) - sec = &level.sectors[sec->prevsec]; // search for a non-done thinker + while (sec->prevsec != -1 && Level->sectors[sec->prevsec].stairlock != -2) + sec = &Level->sectors[sec->prevsec]; // search for a non-done thinker if (sec->prevsec == -1) // if all thinkers previous are done { sec = m_Sector; // search forward - while (sec->nextsec != -1 && level.sectors[sec->nextsec].stairlock != -2) - sec = &level.sectors[sec->nextsec]; + while (sec->nextsec != -1 && Level->sectors[sec->nextsec].stairlock != -2) + sec = &Level->sectors[sec->nextsec]; if (sec->nextsec == -1) // if all thinkers ahead are done too { while (sec->prevsec != -1) // clear all locks { sec->stairlock = 0; - sec = &level.sectors[sec->prevsec]; + sec = &Level->sectors[sec->prevsec]; } sec->stairlock = 0; } diff --git a/src/p_lights.cpp b/src/p_lights.cpp index d5fb201cd..7dce5215f 100644 --- a/src/p_lights.cpp +++ b/src/p_lights.cpp @@ -816,10 +816,10 @@ void FLevelLocals::EV_StartLightFading(int tag, int value, int tics) void FLevelLocals::EV_StopLightEffect (int tag) { - TThinkerIterator iterator; + auto iterator = GetThinkerIterator(NAME_None, STAT_LIGHTNING); DLighting *effect; - while ((effect = iterator.Next()) != NULL) + while ((effect = iterator.Next()) != nullptr) { if (SectorHasTag(effect->GetSector(), tag)) { diff --git a/src/p_pusher.cpp b/src/p_pusher.cpp index 0859429e4..c06ee2c1f 100644 --- a/src/p_pusher.cpp +++ b/src/p_pusher.cpp @@ -133,7 +133,7 @@ void DPusher::Construct (DPusher::EPusher type, line_t *l, int magnitude, int an int DPusher::CheckForSectorMatch (EPusher type, int tag) { - if (m_Type == type && level.SectorHasTag(m_Affectee, tag)) + if (m_Type == type && Level->SectorHasTag(m_Affectee, tag)) return m_Affectee; else return -1; @@ -155,7 +155,7 @@ void DPusher::Tick () if (!var_pushers) return; - sec = &level.sectors[m_Affectee]; + sec = &Level->sectors[m_Affectee]; // Be sure the special sector type is still turned on. If so, proceed. // Else, bail out; the sector type has been changed on us. @@ -317,7 +317,7 @@ void FLevelLocals::AdjustPusher(int tag, int magnitude, int angle, bool wind) int secnum; // Now create pushers for any sectors that don't already have them. - auto itr = level.GetSectorTagIterator(tag); + auto itr = GetSectorTagIterator(tag); while ((secnum = itr.Next()) >= 0) { unsigned int i; diff --git a/src/p_scroll.cpp b/src/p_scroll.cpp index b48160ab5..c62aafe6f 100644 --- a/src/p_scroll.cpp +++ b/src/p_scroll.cpp @@ -213,7 +213,7 @@ void DScroller::Tick () // [RH] Don't actually carry anything here. That happens later. case EScroll::sc_carry: - level.Scrolls[m_Sector->Index()] += { dx, dy }; + Level->Scrolls[m_Sector->Index()] += { dx, dy }; // mark all potentially affected things here so that the very expensive calculation loop in AActor::Tick does not need to run for actors which do not touch a scrolling sector. for (auto n = m_Sector->touching_thinglist; n; n = n->m_snext) { @@ -267,7 +267,7 @@ void DScroller::Construct (EScroll type, double dx, double dy, sector_t *ctrl, { case EScroll::sc_carry: assert(sec != nullptr); - level.AddScroller (sec->Index()); + Level->AddScroller (sec->Index()); break; case EScroll::sc_side: @@ -381,7 +381,7 @@ void SetWallScroller (FLevelLocals *Level, int id, int sidechoice, double dx, do if (dx == 0 && dy == 0) { // Special case: Remove the scroller, because the deltas are both 0. - TThinkerIterator iterator (STAT_SCROLLER); + auto iterator = Level->GetThinkerIterator(NAME_None, STAT_SCROLLER); DScroller *scroller; while ( (scroller = iterator.Next ()) ) @@ -400,7 +400,7 @@ void SetWallScroller (FLevelLocals *Level, int id, int sidechoice, double dx, do // their rates. TArray Collection; { - TThinkerIterator iterator (STAT_SCROLLER); + auto iterator = Level->GetThinkerIterator(NAME_None, STAT_SCROLLER); DScroller *scroll; while ( (scroll = iterator.Next ()) ) @@ -439,7 +439,7 @@ void SetWallScroller (FLevelLocals *Level, int id, int sidechoice, double dx, do void SetScroller (FLevelLocals *Level, int tag, EScroll type, double dx, double dy) { - TThinkerIterator iterator (STAT_SCROLLER); + auto iterator = Level->GetThinkerIterator(NAME_None, STAT_SCROLLER); DScroller *scroller; int i;