- eliminated wallsofsector.

This commit is contained in:
Christoph Oelckers 2022-11-15 15:24:17 +01:00
parent 84b17a8a53
commit 7d9a4ea70d
38 changed files with 119 additions and 129 deletions

View file

@ -250,7 +250,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
auto const sec = &sector[dasect]; auto const sec = &sector[dasect];
for (auto& wal : wallsofsector(sec)) for (auto& wal : sec->walls)
{ {
auto const wal2 = wal.point2Wall(); auto const wal2 = wal.point2Wall();
vec2_t p1 = wal.wall_int_pos(); vec2_t p1 = wal.wall_int_pos();
@ -293,7 +293,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
&& inside(pos->X * inttoworld, pos->Y * inttoworld, sec) == 1) && inside(pos->X * inttoworld, pos->Y * inttoworld, sec) == 1)
{ {
bool found = false; bool found = false;
for (auto& wwal : wallsofsector(sec)) for (auto& wwal : sec->walls)
{ {
if (wwal.nextsector == initialsectnum) if (wwal.nextsector == initialsectnum)
{ {

View file

@ -272,7 +272,7 @@ void MarkSectorSeen(sectortype* sec)
if (sec) if (sec)
{ {
show2dsector.Set(sectindex(sec)); show2dsector.Set(sectindex(sec));
for (auto& wal : wallsofsector(sec)) for (auto& wal : sec->walls)
{ {
if (!wal.twoSided()) continue; if (!wal.twoSided()) continue;
const auto bits = (CSTAT_WALL_BLOCK | CSTAT_WALL_MASKED | CSTAT_WALL_1WAY | CSTAT_WALL_BLOCK_HITSCAN); const auto bits = (CSTAT_WALL_BLOCK | CSTAT_WALL_MASKED | CSTAT_WALL_1WAY | CSTAT_WALL_BLOCK_HITSCAN);
@ -395,7 +395,7 @@ static void drawredlines(const DVector2& cpos, const DVector2& cangvect, const D
double z1 = sector[i].ceilingz; double z1 = sector[i].ceilingz;
double z2 = sector[i].floorz; double z2 = sector[i].floorz;
for (auto& wal : wallsofsector(i)) for (auto& wal : sector[i].walls)
{ {
if (!wal.twoSided()) continue; if (!wal.twoSided()) continue;
@ -426,7 +426,7 @@ static void drawwhitelines(const DVector2& cpos, const DVector2& cangvect, const
{ {
if (!gFullMap && !show2dsector[i] && !isSWALL()) continue; if (!gFullMap && !show2dsector[i] && !isSWALL()) continue;
for (auto& wal : wallsofsector(i)) for (auto& wal : sector[i].walls)
{ {
if (wal.nextwall >= 0) continue; if (wal.nextwall >= 0) continue;
if (!gFullMap && !tileGetTexture(wal.picnum)->isValid()) continue; if (!gFullMap && !tileGetTexture(wal.picnum)->isValid()) continue;

View file

@ -180,7 +180,7 @@ double SquareDistToSector(double px, double py, const sectortype* sect, DVector2
double bestdist = DBL_MAX; double bestdist = DBL_MAX;
DVector2 bestpt = { px, py }; DVector2 bestpt = { px, py };
for (auto& wal : wallsofsector(sect)) for (auto& wal : sect->walls)
{ {
DVector2 pt; DVector2 pt;
auto dist = SquareDistToWall(px, py, &wal, &pt); auto dist = SquareDistToWall(px, py, &wal, &pt);
@ -383,7 +383,7 @@ void checkRotatedWalls()
bool sectorsConnected(int sect1, int sect2) bool sectorsConnected(int sect1, int sect2)
{ {
for (auto& wal : wallsofsector(sect1)) for (auto& wal : sector[sect1].walls)
{ {
if (wal.nextsector == sect2) return true; if (wal.nextsector == sect2) return true;
} }
@ -428,7 +428,7 @@ int inside(double x, double y, const sectortype* sect)
if (sect) if (sect)
{ {
int64_t acc = 1; int64_t acc = 1;
for (auto& wal : wallsofsector(sect)) for (auto& wal : sect->walls)
{ {
acc ^= checkforinside(x, y, wal.pos, wal.point2Wall()->pos); acc ^= checkforinside(x, y, wal.pos, wal.point2Wall()->pos);
} }
@ -469,7 +469,7 @@ sectortype* nextsectorneighborzptr(sectortype* sectp, double startz, int flags)
const auto planez = (flags & Find_Ceiling)? &sectortype::ceilingz : &sectortype::floorz; const auto planez = (flags & Find_Ceiling)? &sectortype::ceilingz : &sectortype::floorz;
startz *= factor; startz *= factor;
for(auto& wal : wallsofsector(sectp)) for(auto& wal : sectp->walls)
{ {
if (wal.twoSided()) if (wal.twoSided())
{ {
@ -506,7 +506,7 @@ bool cansee(const DVector3& start, sectortype* sect1, const DVector3& end, secto
while (auto sec = search.GetNext()) while (auto sec = search.GetNext())
{ {
for (auto& wal : wallsofsector(sec)) for (auto& wal : sec->walls)
{ {
double factor = InterceptLineSegments(start.X, start.Y, delta.X, delta.Y, wal.pos.X, wal.pos.Y, wal.delta().X, wal.delta().Y, nullptr, true); double factor = InterceptLineSegments(start.X, start.Y, delta.X, delta.Y, wal.pos.X, wal.pos.Y, wal.delta().X, wal.delta().Y, nullptr, true);
if (factor < 0 || factor >= 1) continue; if (factor < 0 || factor >= 1) continue;
@ -802,7 +802,7 @@ int hitscan(const DVector3& start, const sectortype* startsect, const DVector3&
} }
// check all walls in this sector // check all walls in this sector
for (auto& w : wallsofsector(sec)) for (auto& w : sec->walls)
{ {
hit = checkWallHit(&w, EWallFlags::FromInt(wallflags), start, vect, v, hitfactor); hit = checkWallHit(&w, EWallFlags::FromInt(wallflags), start, vect, v, hitfactor);
if (hit > 0) if (hit > 0)
@ -997,7 +997,7 @@ void getzrange(const DVector3& pos, sectortype* sect, double* ceilz, CollisionBa
BFSSectorSearch search(sect); BFSSectorSearch search(sect);
while (auto sec = search.GetNext()) while (auto sec = search.GetNext())
{ {
for (auto& wal : wallsofsector(sec)) for (auto& wal : sec->walls)
{ {
if (checkRangeOfWall(&wal, EWallFlags::FromInt(dawalclipmask), pos, maxdist + 1 / 16., theZs)) if (checkRangeOfWall(&wal, EWallFlags::FromInt(dawalclipmask), pos, maxdist + 1 / 16., theZs))
{ {
@ -1098,7 +1098,7 @@ void neartag(const DVector3& pos, sectortype* startsect, DAngle angle, HitInfoBa
while (auto sect = search.GetNext()) while (auto sect = search.GetNext())
{ {
for (auto& wal : wallsofsector(sect)) for (auto& wal : sect->walls)
{ {
const auto nextsect = wal.nextSector(); const auto nextsect = wal.nextSector();
@ -1217,10 +1217,10 @@ int pushmove(DVector3& pos, sectortype** pSect, double walldist, double ceildist
while (auto sec = search.GetNext()) while (auto sec = search.GetNext())
{ {
// this must go both forward and backward so we cannot use wallsofsector. Pity // this must go both forward and backward so we cannot use iterators. Pity
for (unsigned i = 0; i < sec->walls.Size(); i++) for (unsigned i = 0; i < sec->walls.Size(); i++)
{ {
auto wal = direction > 0 ? sec->firstWall() + i : sec->lastWall() - i; auto wal = direction > 0 ? &sec->walls[i] : &sec->walls[sec->walls.Size() - i];
if (IsCloseToWall(pos.XY(), wal, walldist - 0.25) == EClose::InFront) if (IsCloseToWall(pos.XY(), wal, walldist - 0.25) == EClose::InFront)
{ {

View file

@ -463,16 +463,6 @@ inline int I_GetBuildTime()
return I_GetTime(120); return I_GetTime(120);
} }
inline TArrayView<walltype> wallsofsector(const sectortype* sec)
{
return TArrayView<walltype>(sec->firstWall(), sec->walls.Size());
}
inline TArrayView<walltype> wallsofsector(int sec)
{
return wallsofsector(&sector[sec]);
}
// these are mainly meant as refactoring aids to mark function calls to work on. // these are mainly meant as refactoring aids to mark function calls to work on.
inline int wallindex(const walltype* wal) inline int wallindex(const walltype* wal)
{ {

View file

@ -212,7 +212,7 @@ void ClearMovementInterpolations()
void setsectinterpolate(sectortype* sect) void setsectinterpolate(sectortype* sect)
{ {
for (auto&wal : wallsofsector(sect)) for (auto&wal : sect->walls)
{ {
StartInterpolation(&wal, Interp_Wall_X); StartInterpolation(&wal, Interp_Wall_X);
StartInterpolation(&wal, Interp_Wall_Y); StartInterpolation(&wal, Interp_Wall_Y);
@ -230,7 +230,7 @@ void setsectinterpolate(sectortype* sect)
void clearsectinterpolate(sectortype* sect) void clearsectinterpolate(sectortype* sect)
{ {
for (auto& wal : wallsofsector(sect)) for (auto& wal : sect->walls)
{ {
StopInterpolation(&wal, Interp_Wall_X); StopInterpolation(&wal, Interp_Wall_X);
StopInterpolation(&wal, Interp_Wall_Y); StopInterpolation(&wal, Interp_Wall_Y);

View file

@ -251,11 +251,11 @@ static void ReadWallV5(FileReader& fr, walltype& wall)
static void SetWallPalV5() static void SetWallPalV5()
{ {
for (unsigned i = 0; i < sector.Size(); i++) for (auto& sect : sector)
{ {
for(auto& wal : wallsofsector(i)) for(auto& wal : sect.walls)
{ {
wal.pal = sector[i].floorpal; wal.pal = sect.floorpal;
} }
} }
} }
@ -806,7 +806,7 @@ void setWallSectors()
for(auto& sect: sector) for(auto& sect: sector)
{ {
sect.dirty = EDirty::AllDirty; sect.dirty = EDirty::AllDirty;
for (auto& wal : wallsofsector(&sect)) for (auto& wal : sect.walls)
{ {
if (wal.sector == -1) if (wal.sector == -1)
wal.sector = i; wal.sector = i;

View file

@ -58,7 +58,7 @@ static walltype* IsOnWall(tspritetype* tspr, int height, DVector2& outpos)
double tx = tspr->pos.X; double tx = tspr->pos.X;
double ty = tspr->pos.Y; double ty = tspr->pos.Y;
for(auto& wal : wallsofsector(sect)) for(auto& wal : sect->walls)
{ {
// Intentionally include two sided walls. Even on them the sprite should be projected onto the wall for better results. // Intentionally include two sided walls. Even on them the sprite should be projected onto the wall for better results.
auto d = wal.delta(); auto d = wal.delta();

View file

@ -59,7 +59,7 @@ void DoUpdateSector(double x, double y, double z, int* sectnum, double maxDistan
return; return;
} }
for (auto& wal : wallsofsector(lsect)) for (auto& wal : lsect->walls)
{ {
if (wal.twoSided() && !search.Check(wal.nextsector) && (iter == 0 || SquareDistToWall(x, y, &wal) <= maxDistSq)) if (wal.twoSided() && !search.Check(wal.nextsector) && (iter == 0 || SquareDistToWall(x, y, &wal) <= maxDistSq))
search.Add(wal.nextsector); search.Add(wal.nextsector);

View file

@ -554,7 +554,7 @@ BitArray GetClosestSpriteSectors(sectortype* pSector, const DVector2& pos, int n
while (auto pCurSector = search.GetNext()) while (auto pCurSector = search.GetNext())
{ {
for (auto& wal : wallsofsector(pCurSector)) for (auto& wal : pCurSector->walls)
{ {
if (!wal.twoSided()) continue; if (!wal.twoSided()) continue;
const auto pNextSector = wal.nextSector(); const auto pNextSector = wal.nextSector();

View file

@ -181,7 +181,7 @@ TArray<DBloodActor*> getSpritesNearWalls(sectortype* pSrcSect, double nDist)
{ {
TArray<DBloodActor*> out; TArray<DBloodActor*> out;
for(auto& wal : wallsofsector(pSrcSect)) for(auto& wal : pSrcSect->walls)
{ {
if (!wal.twoSided()) if (!wal.twoSided())
continue; continue;

View file

@ -155,7 +155,7 @@ void DoSectorLighting(void)
} }
if (pXSector->shadeWalls) if (pXSector->shadeWalls)
{ {
for (auto& wal : wallsofsector(pSector)) for (auto& wal : pSector->walls)
{ {
wal.shade -= v4; wal.shade -= v4;
if (pXSector->color) if (pXSector->color)
@ -197,7 +197,7 @@ void DoSectorLighting(void)
} }
if (pXSector->shadeWalls) if (pXSector->shadeWalls)
{ {
for (auto& wal : wallsofsector(pSector)) for (auto& wal : pSector->walls)
{ {
wal.shade = ClipRange(wal.shade + v4, -128, 127); wal.shade = ClipRange(wal.shade + v4, -128, 127);
if (pXSector->color && v4 != 0) if (pXSector->color && v4 != 0)
@ -249,7 +249,7 @@ void UndoSectorLighting(void)
} }
if (pXSector->shadeWalls) if (pXSector->shadeWalls)
{ {
for (auto& wal : wallsofsector(&sect)) for (auto& wal : sect.walls)
{ {
wal.shade -= v4; wal.shade -= v4;
if (pXSector->color) if (pXSector->color)

View file

@ -856,14 +856,14 @@ void TranslateSector(sectortype* pSector, double wave1, double wave2, const DVec
if (bAllWalls) if (bAllWalls)
{ {
for (auto& wal : wallsofsector(pSector)) for (auto& wal : pSector->walls)
{ {
rotatewall(&wal, ptang_w2, offset); rotatewall(&wal, ptang_w2, offset);
} }
} }
else else
{ {
for (auto& wal : wallsofsector(pSector)) for (auto& wal : pSector->walls)
{ {
auto p2Wall = wal.point2Wall(); auto p2Wall = wal.point2Wall();
if (wal.cstat & CSTAT_WALL_MOVE_FORWARD) if (wal.cstat & CSTAT_WALL_MOVE_FORWARD)
@ -2256,7 +2256,7 @@ static void UpdateBasePoints(sectortype* pSector)
} }
#endif #endif
for (auto& wal : wallsofsector(pSector)) for (auto& wal : pSector->walls)
{ {
wal.baseWall = wal.pos; wal.baseWall = wal.pos;
} }

View file

@ -291,7 +291,7 @@ void movesector(DDukeActor* const actor, int msindex, DAngle rotation)
//T1,T2 and T3 are used for all the sector moving stuff!!! //T1,T2 and T3 are used for all the sector moving stuff!!!
actor->spr.pos.XY() += actor->spr.angle.ToVector() * actor->vel.X; actor->spr.pos.XY() += actor->spr.angle.ToVector() * actor->vel.X;
for(auto& wal : wallsofsector(actor->sector())) for(auto& wal : actor->sector()->walls)
{ {
dragpoint(&wal, actor->spr.pos.XY() + mspos[msindex].Rotated(rotation)); dragpoint(&wal, actor->spr.pos.XY() + mspos[msindex].Rotated(rotation));
msindex++; msindex++;
@ -321,7 +321,7 @@ void movecyclers(void)
c->lotag += sect->extra; c->lotag += sect->extra;
if (c->state) if (c->state)
{ {
for (auto& wal : wallsofsector(sect)) for (auto& wal : sect->walls)
{ {
if (wal.hitag != 1) if (wal.hitag != 1)
{ {
@ -2865,7 +2865,7 @@ void handle_se03(DDukeActor *actor)
sc->ceilingshade = actor->temp_data[0]; sc->ceilingshade = actor->temp_data[0];
sc->floorshade = actor->temp_data[0]; sc->floorshade = actor->temp_data[0];
for(auto& wal : wallsofsector(sc)) for(auto& wal : sc->walls)
{ {
if (wal.hitag != 1) if (wal.hitag != 1)
{ {
@ -2914,7 +2914,7 @@ void handle_se04(DDukeActor *actor)
sc->floorshade = actor->temp_data[1]; sc->floorshade = actor->temp_data[1];
sc->ceilingshade = actor->temp_data[1]; sc->ceilingshade = actor->temp_data[1];
for (auto& wal : wallsofsector(sc)) for (auto& wal : sc->walls)
{ {
if (j) wal.pal = (palvals & 0xff); if (j) wal.pal = (palvals & 0xff);
else wal.pal = actor->spr.pal; else wal.pal = actor->spr.pal;
@ -3079,7 +3079,7 @@ void handle_se08(DDukeActor *actor, bool checkhitag1)
auto sect = ac->sector(); auto sect = ac->sector();
int minshade = ac->spr.shade; int minshade = ac->spr.shade;
for (auto& wal : wallsofsector(sect)) for (auto& wal : sect->walls)
{ {
if (wal.hitag != 1) if (wal.hitag != 1)
{ {
@ -3175,7 +3175,7 @@ void handle_se11(DDukeActor *actor)
if (actor->temp_data[4]) if (actor->temp_data[4])
{ {
for(auto& wal : wallsofsector(sc)) for(auto& wal : sc->walls)
{ {
DukeStatIterator it(STAT_ACTOR); DukeStatIterator it(STAT_ACTOR);
while (auto ac = it.Next()) while (auto ac = it.Next())
@ -3191,7 +3191,7 @@ void handle_se11(DDukeActor *actor)
movesector(actor, actor->temp_data[1], actor->temp_angle); movesector(actor, actor->temp_data[1], actor->temp_angle);
//SetActor(actor, actor->spr.pos); //SetActor(actor, actor->spr.pos);
for(auto& wal : wallsofsector(sc)) for(auto& wal : sc->walls)
{ {
DukeStatIterator it(STAT_PLAYER); DukeStatIterator it(STAT_PLAYER);
while (auto ac = it.Next()) while (auto ac = it.Next())
@ -3232,7 +3232,7 @@ void handle_se12(DDukeActor *actor, int planeonly)
sc->floorpal = 0; sc->floorpal = 0;
sc->ceilingpal = 0; sc->ceilingpal = 0;
for (auto& wal : wallsofsector(sc)) for (auto& wal : sc->walls)
{ {
if (wal.hitag != 1) if (wal.hitag != 1)
{ {
@ -3273,7 +3273,7 @@ void handle_se12(DDukeActor *actor, int planeonly)
if (planeonly != 2) sc->floorshade -= 2; if (planeonly != 2) sc->floorshade -= 2;
if (planeonly != 1) sc->ceilingshade -= 2; if (planeonly != 1) sc->ceilingshade -= 2;
for (auto& wal : wallsofsector(sc)) for (auto& wal : sc->walls)
{ {
if (wal.hitag != 1) if (wal.hitag != 1)
{ {
@ -3345,7 +3345,7 @@ void handle_se13(DDukeActor* actor)
if (actor->spr.intangle == 512) if (actor->spr.intangle == 512)
{ {
for (auto& wal : wallsofsector(sc)) for (auto& wal : sc->walls)
wal.shade = actor->spr.shade; wal.shade = actor->spr.shade;
sc->floorshade = actor->spr.shade; sc->floorshade = actor->spr.shade;
@ -3697,7 +3697,7 @@ void handle_se19(DDukeActor *actor, int BIGFORCE)
if (actor->temp_data[0] == 1) if (actor->temp_data[0] == 1)
{ {
actor->temp_data[0]++; actor->temp_data[0]++;
for (auto& wal : wallsofsector(sc)) for (auto& wal : sc->walls)
{ {
if (wal.overpicnum == BIGFORCE) if (wal.overpicnum == BIGFORCE)
{ {

View file

@ -284,7 +284,7 @@ void hitradius_d(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
} }
} }
for (auto& wal : wallsofsector(dasectp)) for (auto& wal : dasectp->walls)
{ {
if ((wal.pos - actor->spr.pos.XY()).Sum() < radius) if ((wal.pos - actor->spr.pos.XY()).Sum() < radius)
{ {

View file

@ -238,7 +238,7 @@ void dotorch(void)
sect->floorshade = shade; sect->floorshade = shade;
break; break;
} }
for (auto& wal : wallsofsector(sect)) for (auto& wal : sect->walls)
{ {
if (wal.lotag != 1) if (wal.lotag != 1)
{ {
@ -301,7 +301,7 @@ void dojaildoor(void)
} }
else else
{ {
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
{ {
DVector2 vec = wal.pos; DVector2 vec = wal.pos;
switch (jd.direction) switch (jd.direction)
@ -388,7 +388,7 @@ void moveminecart(void)
} }
else else
{ {
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
{ {
auto pos = wal.pos; auto pos = wal.pos;
switch (mc.direction) switch (mc.direction)
@ -415,7 +415,7 @@ void moveminecart(void)
auto csect = mc.childsect; auto csect = mc.childsect;
double max_x = INT32_MIN, max_y = INT32_MIN, min_x = INT32_MAX, min_y = INT32_MAX; double max_x = INT32_MIN, max_y = INT32_MIN, min_x = INT32_MAX, min_y = INT32_MAX;
for (auto& wal : wallsofsector(csect)) for (auto& wal : csect->walls)
{ {
double x = wal.pos.X; double x = wal.pos.X;
double y = wal.pos.Y; double y = wal.pos.Y;
@ -498,7 +498,7 @@ void thunder(void)
auto sectp = lightninsector[i]; auto sectp = lightninsector[i];
sectp->floorshade = (int8_t)lightninsectorshade[i]; sectp->floorshade = (int8_t)lightninsectorshade[i];
sectp->ceilingshade = (int8_t)lightninsectorshade[i]; sectp->ceilingshade = (int8_t)lightninsectorshade[i];
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
wal.shade = (int8_t)lightninsectorshade[i]; wal.shade = (int8_t)lightninsectorshade[i];
} }
} }
@ -520,7 +520,7 @@ void thunder(void)
auto sectp = lightninsector[i]; auto sectp = lightninsector[i];
sectp->floorshade = lightninsectorshade[i] - shade; sectp->floorshade = lightninsectorshade[i] - shade;
sectp->ceilingshade = lightninsectorshade[i] - shade; sectp->ceilingshade = lightninsectorshade[i] - shade;
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
wal.shade = lightninsectorshade[i] - shade; wal.shade = lightninsectorshade[i] - shade;
} }
} }

View file

@ -243,7 +243,7 @@ void hitradius_r(DDukeActor* actor, int r, int hp1, int hp2, int hp3, int h
} }
} }
for (auto& wal : wallsofsector(dasectp)) for (auto& wal : dasectp->walls)
{ {
if ((wal.pos - actor->spr.pos.XY()).Sum() < radius) if ((wal.pos - actor->spr.pos.XY()).Sum() < radius)
{ {

View file

@ -469,7 +469,7 @@ void prelevel_d(int g, TArray<DDukeActor*>& actors)
//Invalidate textures in sector behind mirror //Invalidate textures in sector behind mirror
for (i = 0; i < mirrorcnt; i++) for (i = 0; i < mirrorcnt; i++)
{ {
for (auto& wal : wallsofsector(mirrorsector[i])) for (auto& wal : mirrorsector[i]->walls)
{ {
wal.picnum = MIRROR; wal.picnum = MIRROR;
wal.overpicnum = MIRROR; wal.overpicnum = MIRROR;

View file

@ -753,7 +753,7 @@ void prelevel_r(int g, TArray<DDukeActor*>& actors)
//Invalidate textures in sector behind mirror //Invalidate textures in sector behind mirror
for (i = 0; i < mirrorcnt; i++) for (i = 0; i < mirrorcnt; i++)
{ {
for (auto& mwal : wallsofsector(mirrorsector[i])) for (auto& mwal : mirrorsector[i]->walls)
{ {
mwal.picnum = MIRROR; mwal.picnum = MIRROR;
mwal.overpicnum = MIRROR; mwal.overpicnum = MIRROR;

View file

@ -532,7 +532,7 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor)
//first find center point by averaging all points //first find center point by averaging all points
dax = 0, day = 0; dax = 0, day = 0;
for (auto& wal : wallsofsector(sptr)) for (auto& wal : sptr->walls)
{ {
dax += wal.pos.X; dax += wal.pos.X;
day += wal.pos.Y; day += wal.pos.Y;
@ -544,7 +544,7 @@ static void handle_st09(sectortype* sptr, DDukeActor* actor)
// as center (dax, day) - should be 2 points found. // as center (dax, day) - should be 2 points found.
wallfind[0] = nullptr; wallfind[0] = nullptr;
wallfind[1] = nullptr; wallfind[1] = nullptr;
for (auto& wal : wallsofsector(sptr)) for (auto& wal : sptr->walls)
// more precise checks won't work here. // more precise checks won't work here.
if (abs(wal.pos.X - dax) <= (1 / 32.) || abs(wal.pos.Y - day) <= (1 / 32.)) if (abs(wal.pos.X - dax) <= (1 / 32.) || abs(wal.pos.Y - day) <= (1 / 32.))
{ {
@ -997,7 +997,7 @@ void operatesectors(sectortype* sptr, DDukeActor *actor)
case 7: case 7:
if (!isRR()) break; if (!isRR()) break;
for (auto& wal : wallsofsector(sptr)) for (auto& wal : sptr->walls)
{ {
setanimation(sptr, anim_vertexx, &wal, wal.pos.X + 64, 1 / 4.); setanimation(sptr, anim_vertexx, &wal, wal.pos.X + 64, 1 / 4.);
if (wal.twoSided()) setanimation(sptr, anim_vertexx, wal.nextWall(), wal.nextWall()->pos.X + 64, 1 / 4.); if (wal.twoSided()) setanimation(sptr, anim_vertexx, wal.nextWall(), wal.nextWall()->pos.X + 64, 1 / 4.);

View file

@ -856,7 +856,7 @@ void checkhitwall_d(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw
if (!wal->twoSided()) return; if (!wal->twoSided()) return;
darkestwall = 0; darkestwall = 0;
for (auto& wl : wallsofsector(wal->nextSector())) for (auto& wl : wal->nextSector()->walls)
if (wl.shade > darkestwall) if (wl.shade > darkestwall)
darkestwall = wl.shade; darkestwall = wl.shade;

View file

@ -1082,7 +1082,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw
act->spriteextra++; act->spriteextra++;
if (act->spriteextra == 25) if (act->spriteextra == 25)
{ {
for(auto& wl : wallsofsector(act->sector())) for(auto& wl : act->sector()->walls)
{ {
if (wl.twoSided()) wl.nextSector()->lotag = 0; if (wl.twoSided()) wl.nextSector()->lotag = 0;
} }
@ -1338,7 +1338,7 @@ void checkhitwall_r(DDukeActor* spr, walltype* wal, const DVector3& pos, int atw
if (!wal->twoSided()) return; if (!wal->twoSided()) return;
darkestwall = 0; darkestwall = 0;
for (auto& wl : wallsofsector(wal->nextSector())) for (auto& wl : wal->nextSector()->walls)
if (wl.shade > darkestwall) if (wl.shade > darkestwall)
darkestwall = wl.shade; darkestwall = wl.shade;
@ -2718,7 +2718,7 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum)
if (movestep == 0) movestep = 4 * maptoworld; if (movestep == 0) movestep = 4 * maptoworld;
double max_x = INT32_MIN, max_y = INT32_MIN, min_x = INT32_MAX, min_y = INT32_MAX; double max_x = INT32_MIN, max_y = INT32_MIN, min_x = INT32_MAX, min_y = INT32_MAX;
for (auto& wal : wallsofsector(nextsect)) for (auto& wal : nextsect->walls)
{ {
double x = wal.pos.X; double x = wal.pos.X;
double y = wal.pos.Y; double y = wal.pos.Y;
@ -2744,7 +2744,7 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum)
!inside(min_x, max_y, sectp)) !inside(min_x, max_y, sectp))
pos_ok = 0; pos_ok = 0;
for (auto& wal : wallsofsector(nextsect)) for (auto& wal : nextsect->walls)
{ {
switch (wlwal->lotag) switch (wlwal->lotag)
{ {
@ -2764,7 +2764,7 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum)
{ {
if (S_CheckActorSoundPlaying(ps[snum].GetActor(), 389) == 0) if (S_CheckActorSoundPlaying(ps[snum].GetActor(), 389) == 0)
S_PlayActorSound(389, ps[snum].GetActor()); S_PlayActorSound(389, ps[snum].GetActor());
for(auto& wal : wallsofsector(nextsect)) for(auto& wal : nextsect->walls)
{ {
auto vec = wal.pos; auto vec = wal.pos;
switch (wlwal->lotag) switch (wlwal->lotag)
@ -2791,7 +2791,7 @@ void dofurniture(walltype* wlwal, sectortype* sectp, int snum)
else else
{ {
movestep -= 2 * maptoworld; movestep -= 2 * maptoworld;
for(auto& wal : wallsofsector(nextsect)) for(auto& wal : nextsect->walls)
{ {
auto vec = wal.pos; auto vec = wal.pos;
switch (wlwal->lotag) switch (wlwal->lotag)

View file

@ -668,7 +668,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
if (actor->spr.intangle == 512) if (actor->spr.intangle == 512)
{ {
for (auto& wl : wallsofsector(sectp)) for (auto& wl : sectp->walls)
{ {
if (wl.twoSided()) if (wl.twoSided())
{ {
@ -721,7 +721,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
walltype* closewall = nullptr; walltype* closewall = nullptr;
double maxdist = 0x7fffffff; double maxdist = 0x7fffffff;
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
{ {
double dist = (actor->spr.pos.XY() - wal.pos).LengthSquared(); double dist = (actor->spr.pos.XY() - wal.pos).LengthSquared();
if (dist < maxdist && &wal != actor->temp_walls[0]) if (dist < maxdist && &wal != actor->temp_walls[0])
@ -754,7 +754,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
//fix all the walls; //fix all the walls;
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
{ {
if (!(wal.hitag & 1)) if (!(wal.hitag & 1))
wal.shade = actor->spr.shade; wal.shade = actor->spr.shade;
@ -769,7 +769,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
// actor->temp_data[2] = actor->spr.hitag; // actor->temp_data[2] = actor->spr.hitag;
if (actor->spr.intangle != 1536) sectp->setfloorz(actor->spr.pos.Z); if (actor->spr.intangle != 1536) sectp->setfloorz(actor->spr.pos.Z);
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
if (wal.hitag == 0) wal.hitag = 9999; if (wal.hitag == 0) wal.hitag = 9999;
StartInterpolation(sectp, Interp_Sect_Floorz); StartInterpolation(sectp, Interp_Sect_Floorz);
@ -780,7 +780,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
actor->temp_data[2] = actor->spr.hitag; actor->temp_data[2] = actor->spr.hitag;
if (actor->spr.intangle != 1536) sectp->setceilingz(actor->spr.pos.Z); if (actor->spr.intangle != 1536) sectp->setceilingz(actor->spr.pos.Z);
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
if (wal.hitag == 0) wal.hitag = 9999; if (wal.hitag == 0) wal.hitag = 9999;
StartInterpolation(sectp, Interp_Sect_Ceilingz); StartInterpolation(sectp, Interp_Sect_Ceilingz);
@ -793,7 +793,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
actor->palvals = (sectp->ceilingpal << 8) | sectp->floorpal; actor->palvals = (sectp->ceilingpal << 8) | sectp->floorpal;
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
if (wal.shade > actor->temp_data[3]) if (wal.shade > actor->temp_data[3])
actor->temp_data[3] = wal.shade; actor->temp_data[3] = wal.shade;
@ -810,7 +810,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
actor->temp_data[0] = sectp->floorshade; actor->temp_data[0] = sectp->floorshade;
actor->temp_data[1] = sectp->ceilingshade; actor->temp_data[1] = sectp->ceilingshade;
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
if (wal.shade > actor->temp_data[2]) if (wal.shade > actor->temp_data[2])
actor->temp_data[2] = wal.shade; actor->temp_data[2] = wal.shade;
@ -825,7 +825,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
actor->temp_data[0] = sectp->floorshade; actor->temp_data[0] = sectp->floorshade;
actor->temp_data[1] = sectp->ceilingshade; actor->temp_data[1] = sectp->ceilingshade;
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
if (wal.shade > actor->temp_data[2]) if (wal.shade > actor->temp_data[2])
actor->temp_data[2] = wal.shade; actor->temp_data[2] = wal.shade;
@ -886,7 +886,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
} }
actor->temp_data[1] = mspos.Size(); actor->temp_data[1] = mspos.Size();
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
{ {
mspos.Push(wal.pos - actor->spr.pos); mspos.Push(wal.pos - actor->spr.pos);
} }
@ -900,7 +900,7 @@ void spawneffector(DDukeActor* actor, TArray<DDukeActor*>* actors)
sectp->hitagactor = actor; sectp->hitagactor = actor;
sectortype* s = nullptr; sectortype* s = nullptr;
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
{ {
if (wal.twoSided() && if (wal.twoSided() &&
wal.nextSector()->hitag == 0 && wal.nextSector()->hitag == 0 &&
@ -1078,7 +1078,7 @@ void spriteglass(DDukeActor* actor, int n)
void ceilingglass(DDukeActor* actor, sectortype* sectp, int n) void ceilingglass(DDukeActor* actor, sectortype* sectp, int n)
{ {
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
{ {
auto pos = wal.pos; auto pos = wal.pos;
auto delta = wal.delta() / (n + 1); auto delta = wal.delta() / (n + 1);

View file

@ -227,14 +227,14 @@ void InitNewGame()
void SnapSectors(sectortype* pSectorA, sectortype* pSectorB, int b) void SnapSectors(sectortype* pSectorA, sectortype* pSectorB, int b)
{ {
for(auto& wal1 : wallsofsector(pSectorA)) for(auto& wal1 : pSectorA->walls)
{ {
DVector2 bestxy = { 0x7FFFFFF, 0x7FFFFFF }; DVector2 bestxy = { 0x7FFFFFF, 0x7FFFFFF };
DVector2 w1pos = wal1.pos; DVector2 w1pos = wal1.pos;
walltype* bestwall = nullptr; walltype* bestwall = nullptr;
for(auto& wal2 : wallsofsector(pSectorB)) for(auto& wal2 : pSectorB->walls)
{ {
DVector2 thisxy = w1pos - wal2.pos; DVector2 thisxy = w1pos - wal2.pos;

View file

@ -271,7 +271,7 @@ void AddFlash(sectortype* pSector, const DVector3& pos, int val)
int var_14 = 0; int var_14 = 0;
for (auto& wal : wallsofsector(pSector)) for (auto& wal : pSector->walls)
{ {
sectortype *pNextSector = NULL; sectortype *pNextSector = NULL;
if (wal.twoSided()) if (wal.twoSided())
@ -618,7 +618,7 @@ void DoGlows()
pSector->ceilingshade += nShade; pSector->ceilingshade += nShade;
pSector->floorshade += nShade; pSector->floorshade += nShade;
for(auto& wal : wallsofsector(pSector)) for(auto& wal : pSector->walls)
{ {
wal.shade += nShade; wal.shade += nShade;
} }
@ -667,7 +667,7 @@ void DoFlickers()
pSector->ceilingshade += shade; pSector->ceilingshade += shade;
pSector->floorshade += shade; pSector->floorshade += shade;
for(auto& wal : wallsofsector(pSector)) for(auto& wal : pSector->walls)
{ {
wal.shade += shade; wal.shade += shade;
} }

View file

@ -169,7 +169,7 @@ int BelowNear(DExhumedActor* pActor, double walldist)
sectortype* pTempSect = nullptr; sectortype* pTempSect = nullptr;
while (auto pCurSector = search.GetNext()) while (auto pCurSector = search.GetNext())
{ {
for (auto& wal : wallsofsector(pCurSector)) for (auto& wal : pCurSector->walls)
{ {
if (wal.twoSided()) if (wal.twoSided())
{ {
@ -718,7 +718,7 @@ void CreatePushBlock(sectortype* pSector)
int nBlock = GrabPushBlock(); int nBlock = GrabPushBlock();
DVector2 sum(0, 0); DVector2 sum(0, 0);
for (auto& wal : wallsofsector(pSector)) for (auto& wal : pSector->walls)
{ {
sum += wal.pos; sum += wal.pos;
} }
@ -736,7 +736,7 @@ void CreatePushBlock(sectortype* pSector)
double mindist = 0; double mindist = 0;
for (auto& wal : wallsofsector(pSector)) for (auto& wal : pSector->walls)
{ {
double length = (avg - wal.pos).Length(); double length = (avg - wal.pos).Length();
@ -904,7 +904,7 @@ void MoveSector(sectortype* pSector, DAngle nAngle, DVector2& nVel)
} }
} }
for(auto& wal : wallsofsector(pSector)) for(auto& wal : pSector->walls)
{ {
dragpoint(&wal, vect + wal.pos); dragpoint(&wal, vect + wal.pos);
} }

View file

@ -405,7 +405,7 @@ DExhumedActor* FindWallSprites(sectortype* pSector)
double max_x = -DBL_MAX; double max_x = -DBL_MAX;
double max_y = -DBL_MAX; double max_y = -DBL_MAX;
for (auto& wal : wallsofsector(pSector)) for (auto& wal : pSector->walls)
{ {
if (wal.pos.X < min_x) { if (wal.pos.X < min_x) {
min_x = wal.pos.X; min_x = wal.pos.X;
@ -1010,7 +1010,7 @@ int BuildSlide(int nChannel, walltype* pStartWall, walltype* pWall1, walltype* p
PointList[nPoint].nNext = -1; PointList[nPoint].nNext = -1;
PointList[nPoint].pSector = pSector; PointList[nPoint].pSector = pSector;
for(auto& wal : wallsofsector(pSector)) for(auto& wal : pSector->walls)
{ {
int ax = SlideData[nSlide].nStart; int ax = SlideData[nSlide].nStart;
@ -1249,7 +1249,7 @@ int BuildTrap(DExhumedActor* pActor, int edx, int ebx, int ecx)
auto pSector = pActor->sector(); auto pSector = pActor->sector();
for(auto& wal : wallsofsector(pSector)) for(auto& wal : pSector->walls)
{ {
if (var_18 == wal.hitag) if (var_18 == wal.hitag)
{ {
@ -1526,7 +1526,7 @@ void DimLights()
if (sect.floorshade < 100) if (sect.floorshade < 100)
sect.floorshade++; sect.floorshade++;
for (auto& wal : wallsofsector(&sect)) for (auto& wal : sect.walls)
{ {
if (wal.shade < 100) if (wal.shade < 100)
wal.shade++; wal.shade++;
@ -1616,7 +1616,7 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector)
{ {
DVector2 apos(0, 0); DVector2 apos(0, 0);
for(auto& wal : wallsofsector(pSector)) for(auto& wal : pSector->walls)
{ {
apos += wal.pos; apos += wal.pos;
@ -1698,7 +1698,7 @@ void ExplodeEnergyBlock(DExhumedActor* pActor)
{ {
auto pSector = pActor->sector(); auto pSector = pActor->sector();
for(auto& wal : wallsofsector(pSector)) for(auto& wal : pSector->walls)
{ {
if (!wal.twoSided()) continue; if (!wal.twoSided()) continue;
auto nextwal = wal.nextWall(); auto nextwal = wal.nextWall();
@ -1775,7 +1775,7 @@ void ExplodeEnergyBlock(DExhumedActor* pActor)
sect.floorpal = 0; sect.floorpal = 0;
} }
for (auto& wal : wallsofsector(&sect)) for (auto& wal : sect.walls)
{ {
if (wal.pal == 1) { if (wal.pal == 1) {
wal.pal = 0; wal.pal = 0;
@ -2623,7 +2623,7 @@ void PostProcess()
sect.pSoundSect = &sect; sect.pSoundSect = &sect;
sect.Sound = StaticSound[kSound62]; sect.Sound = StaticSound[kSound62];
for(auto& wal : wallsofsector(&sect)) for(auto& wal : sect.walls)
{ {
if (wal.picnum == kTile3603) if (wal.picnum == kTile3603)
{ {

View file

@ -158,7 +158,7 @@ void InitSpiritHead()
void DimSector(sectortype* pSector) void DimSector(sectortype* pSector)
{ {
for(auto& wal : wallsofsector(pSector)) for(auto& wal : pSector->walls)
{ {
if (wal.shade < 40) { if (wal.shade < 40) {
wal.shade++; wal.shade++;

View file

@ -279,7 +279,7 @@ void so_addinterpolation(SECTOR_OBJECT* sop)
for (sectp = sop->sectp; *sectp; sectp++) for (sectp = sop->sectp; *sectp; sectp++)
{ {
for (auto& wal : wallsofsector(*sectp)) for (auto& wal : (*sectp)->walls)
{ {
so_setpointinterpolation(interp, wallindex(&wal) | soi_wallx); so_setpointinterpolation(interp, wallindex(&wal) | soi_wallx);
so_setpointinterpolation(interp, wallindex(&wal) | soi_wally); so_setpointinterpolation(interp, wallindex(&wal) | soi_wally);

View file

@ -389,7 +389,7 @@ void JS_InitMirrors(void)
// Invalidate textures in sector behind mirror // Invalidate textures in sector behind mirror
for (i = 0; i < mirrorcnt; i++) for (i = 0; i < mirrorcnt; i++)
{ {
for (auto& wal : wallsofsector(mirror[i].mirrorSector)) for (auto& wal : mirror[i].mirrorSector->walls)
{ {
wal.picnum = MIRROR; wal.picnum = MIRROR;
wal.overpicnum = MIRROR; wal.overpicnum = MIRROR;

View file

@ -69,7 +69,7 @@ void SectorLightShade(DSWActor* actor, short intensity)
wall_shade = actor->user.WallShade.Data(); wall_shade = actor->user.WallShade.Data();
int wallcount = 0; int wallcount = 0;
for(auto &wal : wallsofsector(actor->sector())) for(auto &wal : actor->sector()->walls)
{ {
base_shade = wall_shade[wallcount]; base_shade = wall_shade[wallcount];
wal.shade = base_shade + intensity; wal.shade = base_shade + intensity;

View file

@ -2695,7 +2695,7 @@ void DoPlayerMoveVehicle(PLAYER* pp)
{ {
for (sectp = sop->sectp, wallcount = 0, j = 0; *sectp; sectp++, j++) for (sectp = sop->sectp, wallcount = 0, j = 0; *sectp; sectp++, j++)
{ {
for(auto& wal : wallsofsector(*sectp)) for(auto& wal : (*sectp)->walls)
{ {
if (wal.extra && (wal.extra & (WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY)) == WALLFX_LOOP_OUTER) if (wal.extra && (wal.extra & (WALLFX_LOOP_OUTER|WALLFX_LOOP_OUTER_SECONDARY)) == WALLFX_LOOP_OUTER)
{ {

View file

@ -915,7 +915,7 @@ void CollectPortals()
floordone.Set(i); floordone.Set(i);
for (unsigned ii = 0; ii < fp.sectors.Size(); ii++) for (unsigned ii = 0; ii < fp.sectors.Size(); ii++)
{ {
for (auto& wal : wallsofsector(fp.sectors[ii])) for (auto& wal : sector[fp.sectors[ii]].walls)
{ {
if (!wal.twoSided()) continue; if (!wal.twoSided()) continue;
auto nsec = wal.nextSector(); auto nsec = wal.nextSector();
@ -933,7 +933,7 @@ void CollectPortals()
ceilingdone.Set(i); ceilingdone.Set(i);
for (unsigned ii = 0; ii < fp.sectors.Size(); ii++) for (unsigned ii = 0; ii < fp.sectors.Size(); ii++)
{ {
for (auto& wal : wallsofsector(fp.sectors[ii])) for (auto& wal : sector[fp.sectors[ii]].walls)
{ {
if (!wal.twoSided()) continue; if (!wal.twoSided()) continue;
auto nsec = wal.nextSector(); auto nsec = wal.nextSector();

View file

@ -253,7 +253,7 @@ bool TestRotatorMatchActive(short match)
void DoRotatorSetInterp(DSWActor* actor) void DoRotatorSetInterp(DSWActor* actor)
{ {
for(auto& wal : wallsofsector(actor->sector())) for(auto& wal : actor->sector()->walls)
{ {
StartInterpolation(&wal, Interp_Wall_X); StartInterpolation(&wal, Interp_Wall_X);
StartInterpolation(&wal, Interp_Wall_Y); StartInterpolation(&wal, Interp_Wall_Y);
@ -275,7 +275,7 @@ void DoRotatorSetInterp(DSWActor* actor)
void DoRotatorStopInterp(DSWActor* actor) void DoRotatorStopInterp(DSWActor* actor)
{ {
for (auto& wal : wallsofsector(actor->sector())) for (auto& wal : actor->sector()->walls)
{ {
StopInterpolation(&wal, Interp_Wall_X); StopInterpolation(&wal, Interp_Wall_X);
StopInterpolation(&wal, Interp_Wall_Y); StopInterpolation(&wal, Interp_Wall_Y);
@ -394,7 +394,7 @@ int DoRotator(DSWActor* actor)
// move points // move points
ndx = 0; ndx = 0;
for(auto& wal : wallsofsector(actor->sector())) for(auto& wal : actor->sector()->walls)
{ {
auto nxy = rotatepoint(pivot->spr.pos, r->orig[ndx], DAngle::fromBuild(r->pos)); auto nxy = rotatepoint(pivot->spr.pos, r->orig[ndx], DAngle::fromBuild(r->pos));

View file

@ -639,7 +639,7 @@ DVector3 SectorMidPoint(sectortype* sectp)
{ {
DVector3 sum(0,0,0); DVector3 sum(0,0,0);
for (auto& wal : wallsofsector(sectp)) for (auto& wal : sectp->walls)
{ {
sum += wal.pos; sum += wal.pos;
} }
@ -704,7 +704,7 @@ void DoSpringBoardDown(void)
sectortype* FindNextSectorByTag(sectortype* sect, int tag) sectortype* FindNextSectorByTag(sectortype* sect, int tag)
{ {
for(auto& wal : wallsofsector(sect)) for(auto& wal : sect->walls)
{ {
if (wal.twoSided()) if (wal.twoSided())
{ {

View file

@ -1525,7 +1525,7 @@ void PreMapCombineFloors(void)
jActor->spr.pos += dv; jActor->spr.pos += dv;
} }
for (auto& wal : wallsofsector(dasect)) for (auto& wal : dasect->walls)
{ {
wal.move(wal.pos + dv); wal.move(wal.pos + dv);
@ -2198,7 +2198,7 @@ void SpriteSetup(void)
actor->user.rotator->orig_speed = actor->user.rotator->speed; actor->user.rotator->orig_speed = actor->user.rotator->speed;
wallcount = 0; wallcount = 0;
for(auto& wal : wallsofsector(actor->sector())) for(auto& wal : actor->sector()->walls)
{ {
actor->user.rotator->orig[wallcount] = wal.pos; actor->user.rotator->orig[wallcount] = wal.pos;
wallcount++; wallcount++;
@ -2378,7 +2378,7 @@ void SpriteSetup(void)
LIGHT_CeilingShade(actor) = actor->sector()->ceilingshade; LIGHT_CeilingShade(actor) = actor->sector()->ceilingshade;
// count walls of sector // count walls of sector
for(auto& wal : wallsofsector(actor->sector())) for(auto& wal : actor->sector()->walls)
{ {
wallcount++; wallcount++;
if (TEST_BOOL5(actor)) if (TEST_BOOL5(actor))
@ -2394,7 +2394,7 @@ void SpriteSetup(void)
wall_shade = actor->user.WallShade.Data(); wall_shade = actor->user.WallShade.Data();
// save off original wall shades // save off original wall shades
for(auto& wal : wallsofsector(actor->sector())) for(auto& wal : actor->sector()->walls)
{ {
wall_shade[wallcount] = wal.shade; wall_shade[wallcount] = wal.shade;
wallcount++; wallcount++;
@ -2427,7 +2427,7 @@ void SpriteSetup(void)
LIGHT_CeilingShade(actor) = actor->sector()->ceilingshade; LIGHT_CeilingShade(actor) = actor->sector()->ceilingshade;
// count walls of sector // count walls of sector
for (auto& wal : wallsofsector(actor->sector())) for (auto& wal : actor->sector()->walls)
{ {
wallcount++; wallcount++;
if (TEST_BOOL5(actor)) if (TEST_BOOL5(actor))
@ -2445,7 +2445,7 @@ void SpriteSetup(void)
wall_shade = actor->user.WallShade.Data(); wall_shade = actor->user.WallShade.Data();
// save off original wall shades // save off original wall shades
for (auto& wal : wallsofsector(actor->sector())) for (auto& wal : actor->sector()->walls)
{ {
wall_shade[wallcount] = wal.shade; wall_shade[wallcount] = wal.shade;
wallcount++; wallcount++;

View file

@ -718,7 +718,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
SectorInBounds = true; SectorInBounds = true;
for(auto& wal : wallsofsector(sect)) for(auto& wal : sect->walls)
{ {
// all walls have to be in bounds to be in sector object // all walls have to be in bounds to be in sector object
if (!(wal.pos.X > vlow.X && wal.pos.X < vhigh.X && wal.pos.Y > vlow.Y && wal.pos.Y < vhigh.Y)) if (!(wal.pos.X > vlow.X && wal.pos.X < vhigh.X && wal.pos.Y > vlow.Y && wal.pos.Y < vhigh.Y))
@ -764,7 +764,7 @@ void SectorObjectSetupBounds(SECTOR_OBJECT* sop)
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++) for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
{ {
// move all walls in sectors // move all walls in sectors
for(auto& wal : wallsofsector(*sectp)) for(auto& wal : (*sectp)->walls)
{ {
// for morph point - tornado style // for morph point - tornado style
if (wal.lotag == TAG_WALL_ALIGN_SLOPE_TO_POINT) if (wal.lotag == TAG_WALL_ALIGN_SLOPE_TO_POINT)
@ -1357,7 +1357,7 @@ void PlaceSectorObjectsOnTracks(void)
{ {
// move all walls in sectors // move all walls in sectors
for (auto& wal : wallsofsector(sop->sectp[j])) for (auto& wal : sop->sectp[j]->walls)
{ {
sop->orig[sop->num_walls] = sop->pmid - wal.pos; sop->orig[sop->num_walls] = sop->pmid - wal.pos;
sop->num_walls++; sop->num_walls++;
@ -1567,7 +1567,7 @@ void MovePoints(SECTOR_OBJECT* sop, DAngle deltaangle, const DVector2& move)
goto PlayerPart; goto PlayerPart;
// move all walls in sectors // move all walls in sectors
for(auto& wal : wallsofsector(*sectp)) for(auto& wal : (*sectp)->walls)
{ {
if ((wal.extra & (WALLFX_LOOP_DONT_SPIN | WALLFX_DONT_MOVE))) if ((wal.extra & (WALLFX_LOOP_DONT_SPIN | WALLFX_DONT_MOVE)))
continue; continue;
@ -1782,7 +1782,7 @@ void RefreshPoints(SECTOR_OBJECT* sop, const DVector2& move, bool dynamic)
if (!(sop->flags & SOBJ_SPRITE_OBJ)) if (!(sop->flags & SOBJ_SPRITE_OBJ))
{ {
// move all walls in sectors back to the original position // move all walls in sectors back to the original position
for (auto& wal : wallsofsector(*sectp)) for (auto& wal : (*sectp)->walls)
{ {
if (!(wal.extra && (wal.extra & WALLFX_DONT_MOVE))) if (!(wal.extra && (wal.extra & WALLFX_DONT_MOVE)))
{ {
@ -1924,7 +1924,7 @@ SECTOR_OBJECT* DetectSectorObjectByWall(walltype* wph)
int j; int j;
for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++) for (sectp = sop->sectp, j = 0; *sectp; sectp++, j++)
{ {
for (auto& wal : wallsofsector(*sectp)) for (auto& wal : (*sectp)->walls)
{ {
// if outer wall check the NEXTWALL also // if outer wall check the NEXTWALL also
if ((wal.extra & WALLFX_LOOP_OUTER)) if ((wal.extra & WALLFX_LOOP_OUTER))
@ -1955,7 +1955,7 @@ void CollapseSectorObject(SECTOR_OBJECT* sop, const DVector2& pos)
if (!(sop->flags & SOBJ_SPRITE_OBJ)) if (!(sop->flags & SOBJ_SPRITE_OBJ))
{ {
// move all walls in sectors back to the original position // move all walls in sectors back to the original position
for (auto& wal : wallsofsector(*sectp)) for (auto& wal : (*sectp)->walls)
{ {
if ((wal.extra & WALLFX_DONT_MOVE)) if ((wal.extra & WALLFX_DONT_MOVE))
continue; continue;
@ -2095,7 +2095,7 @@ void CallbackSOsink(ANIM* ap, void *data)
// Take out any blocking walls // Take out any blocking walls
for(auto& wal : wallsofsector(destsect)) for(auto& wal : destsect->walls)
{ {
wal.cstat &= ~(CSTAT_WALL_BLOCK); wal.cstat &= ~(CSTAT_WALL_BLOCK);
} }

View file

@ -59,7 +59,7 @@ void SOwallmove(SECTOR_OBJECT* sop, DSWActor* actor, walltype* find_wallp, doubl
{ {
// move all walls in sectors back to the original position // move all walls in sectors back to the original position
for (auto& wal : wallsofsector(*sectp)) for (auto& wal : (*sectp)->walls)
{ {
// find the one wall we want to adjust // find the one wall we want to adjust
if (&wal == find_wallp) if (&wal == find_wallp)

View file

@ -7296,7 +7296,7 @@ int DoFlamesDamageTest(DSWActor* actor)
walltype* PrevWall(walltype* wall_num) walltype* PrevWall(walltype* wall_num)
{ {
for(auto&wal : wallsofsector(wall_num->sectorp())) for(auto&wal : wall_num->sectorp()->walls)
{ {
if (wal.point2Wall() == wall_num) return &wal; if (wal.point2Wall() == wall_num) return &wal;
} }
@ -7333,7 +7333,7 @@ void TraverseBreakableWalls(sectortype* start_sect, const DVector3& pos, DAngle
BFSSectorSearch search(start_sect); BFSSectorSearch search(start_sect);
while (auto sect = search.GetNext()) while (auto sect = search.GetNext())
{ {
for(auto& wal : wallsofsector(sect)) for(auto& wal : sect->walls)
{ {
// see if this wall should be broken // see if this wall should be broken
if (wal.lotag == TAG_WALL_BREAK) if (wal.lotag == TAG_WALL_BREAK)