- removed all remaining references to level and TThinkerIterator from p_floor.cpp, p_lights.cpp, p_pusher.cpp and p_scroll.cpp.

This commit is contained in:
Christoph Oelckers 2019-01-27 15:02:37 +01:00
parent 5aa379e50e
commit c94f0f47a2
4 changed files with 15 additions and 15 deletions

View file

@ -188,19 +188,19 @@ void DFloor::Tick ()
sector_t *sec = m_Sector; sector_t *sec = m_Sector;
sec->stairlock = -1; // thinker done, promote lock to -1 sec->stairlock = -1; // thinker done, promote lock to -1
while (sec->prevsec != -1 && level.sectors[sec->prevsec].stairlock != -2) while (sec->prevsec != -1 && Level->sectors[sec->prevsec].stairlock != -2)
sec = &level.sectors[sec->prevsec]; // search for a non-done thinker sec = &Level->sectors[sec->prevsec]; // search for a non-done thinker
if (sec->prevsec == -1) // if all thinkers previous are done if (sec->prevsec == -1) // if all thinkers previous are done
{ {
sec = m_Sector; // search forward sec = m_Sector; // search forward
while (sec->nextsec != -1 && level.sectors[sec->nextsec].stairlock != -2) while (sec->nextsec != -1 && Level->sectors[sec->nextsec].stairlock != -2)
sec = &level.sectors[sec->nextsec]; sec = &Level->sectors[sec->nextsec];
if (sec->nextsec == -1) // if all thinkers ahead are done too if (sec->nextsec == -1) // if all thinkers ahead are done too
{ {
while (sec->prevsec != -1) // clear all locks while (sec->prevsec != -1) // clear all locks
{ {
sec->stairlock = 0; sec->stairlock = 0;
sec = &level.sectors[sec->prevsec]; sec = &Level->sectors[sec->prevsec];
} }
sec->stairlock = 0; sec->stairlock = 0;
} }

View file

@ -816,10 +816,10 @@ void FLevelLocals::EV_StartLightFading(int tag, int value, int tics)
void FLevelLocals::EV_StopLightEffect (int tag) void FLevelLocals::EV_StopLightEffect (int tag)
{ {
TThinkerIterator<DLighting> iterator; auto iterator = GetThinkerIterator<DLighting>(NAME_None, STAT_LIGHTNING);
DLighting *effect; DLighting *effect;
while ((effect = iterator.Next()) != NULL) while ((effect = iterator.Next()) != nullptr)
{ {
if (SectorHasTag(effect->GetSector(), tag)) if (SectorHasTag(effect->GetSector(), tag))
{ {

View file

@ -133,7 +133,7 @@ void DPusher::Construct (DPusher::EPusher type, line_t *l, int magnitude, int an
int DPusher::CheckForSectorMatch (EPusher type, int tag) 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; return m_Affectee;
else else
return -1; return -1;
@ -155,7 +155,7 @@ void DPusher::Tick ()
if (!var_pushers) if (!var_pushers)
return; return;
sec = &level.sectors[m_Affectee]; sec = &Level->sectors[m_Affectee];
// Be sure the special sector type is still turned on. If so, proceed. // Be sure the special sector type is still turned on. If so, proceed.
// Else, bail out; the sector type has been changed on us. // 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; int secnum;
// Now create pushers for any sectors that don't already have them. // 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) while ((secnum = itr.Next()) >= 0)
{ {
unsigned int i; unsigned int i;

View file

@ -213,7 +213,7 @@ void DScroller::Tick ()
// [RH] Don't actually carry anything here. That happens later. // [RH] Don't actually carry anything here. That happens later.
case EScroll::sc_carry: 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. // 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) 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: case EScroll::sc_carry:
assert(sec != nullptr); assert(sec != nullptr);
level.AddScroller (sec->Index()); Level->AddScroller (sec->Index());
break; break;
case EScroll::sc_side: case EScroll::sc_side:
@ -381,7 +381,7 @@ void SetWallScroller (FLevelLocals *Level, int id, int sidechoice, double dx, do
if (dx == 0 && dy == 0) if (dx == 0 && dy == 0)
{ {
// Special case: Remove the scroller, because the deltas are both 0. // Special case: Remove the scroller, because the deltas are both 0.
TThinkerIterator<DScroller> iterator (STAT_SCROLLER); auto iterator = Level->GetThinkerIterator<DScroller>(NAME_None, STAT_SCROLLER);
DScroller *scroller; DScroller *scroller;
while ( (scroller = iterator.Next ()) ) while ( (scroller = iterator.Next ()) )
@ -400,7 +400,7 @@ void SetWallScroller (FLevelLocals *Level, int id, int sidechoice, double dx, do
// their rates. // their rates.
TArray<DScroller *> Collection; TArray<DScroller *> Collection;
{ {
TThinkerIterator<DScroller> iterator (STAT_SCROLLER); auto iterator = Level->GetThinkerIterator<DScroller>(NAME_None, STAT_SCROLLER);
DScroller *scroll; DScroller *scroll;
while ( (scroll = iterator.Next ()) ) 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) void SetScroller (FLevelLocals *Level, int tag, EScroll type, double dx, double dy)
{ {
TThinkerIterator<DScroller> iterator (STAT_SCROLLER); auto iterator = Level->GetThinkerIterator<DScroller>(NAME_None, STAT_SCROLLER);
DScroller *scroller; DScroller *scroller;
int i; int i;