From 5798fa067f6f2226dcb74b3b8a3aaef2c38b8da3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 15 Nov 2022 15:33:35 +0100 Subject: [PATCH] - cleaned up all -> accesses through firstWall(). --- source/core/rendering/scene/hw_portal.cpp | 2 +- source/core/sectorgeometry.cpp | 12 ++++++------ source/games/blood/src/actor.cpp | 6 +++--- source/games/blood/src/nnexts.cpp | 2 +- source/games/duke/src/actors.cpp | 2 +- source/games/duke/src/actors_d.cpp | 2 +- source/games/duke/src/premap.cpp | 2 +- source/games/exhumed/src/object.cpp | 6 +++--- source/games/sw/src/player.cpp | 2 +- source/games/sw/src/rooms.cpp | 2 +- source/games/sw/src/track.cpp | 4 ++-- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/source/core/rendering/scene/hw_portal.cpp b/source/core/rendering/scene/hw_portal.cpp index 595813a0d..02b849d2f 100644 --- a/source/core/rendering/scene/hw_portal.cpp +++ b/source/core/rendering/scene/hw_portal.cpp @@ -480,7 +480,7 @@ int HWLinePortal::ClipSector(sectortype *sub) // this seg is completely behind the mirror for (unsigned i = 0; iwalls.Size(); i++) { - if (PointOnLineSide(sub->firstWall()->pos, line) == 0) return PClip_Inside; + if (PointOnLineSide(sub->walls[0].pos, line) == 0) return PClip_Inside; } return PClip_InFront; } diff --git a/source/core/sectorgeometry.cpp b/source/core/sectorgeometry.cpp index 27e7d1778..208ba950c 100644 --- a/source/core/sectorgeometry.cpp +++ b/source/core/sectorgeometry.cpp @@ -369,8 +369,8 @@ bool SectionGeometry::ValidateSection(Section* section, int plane) ((sec->floorstat ^ compare->floorstat) & (CSTAT_SECTOR_ALIGN | CSTAT_SECTOR_YFLIP | CSTAT_SECTOR_XFLIP | CSTAT_SECTOR_TEXHALF | CSTAT_SECTOR_SWAPXY)) == 0 && sec->floorxpan_ == compare->floorxpan_ && sec->floorypan_ == compare->floorypan_ && - sec->firstWall()->pos == sdata.poscompare[0] && - sec->firstWall()->point2Wall()->pos == sdata.poscompare2[0] && + sec->walls[0].pos == sdata.poscompare[0] && + sec->walls[0].point2Wall()->pos == sdata.poscompare2[0] && !(section->dirty & EDirty::FloorDirty) && sdata.planes[plane].vertices.Size() ) return true; section->dirty &= ~EDirty::FloorDirty; @@ -382,15 +382,15 @@ bool SectionGeometry::ValidateSection(Section* section, int plane) ((sec->ceilingstat ^ compare->ceilingstat) & (CSTAT_SECTOR_ALIGN | CSTAT_SECTOR_YFLIP | CSTAT_SECTOR_XFLIP | CSTAT_SECTOR_TEXHALF | CSTAT_SECTOR_SWAPXY)) == 0 && sec->ceilingxpan_ == compare->ceilingxpan_ && sec->ceilingypan_ == compare->ceilingypan_ && - sec->firstWall()->pos == sdata.poscompare[1] && - sec->firstWall()->point2Wall()->pos == sdata.poscompare2[1] && + sec->walls[0].pos == sdata.poscompare[1] && + sec->walls[0].point2Wall()->pos == sdata.poscompare2[1] && !(section->dirty & EDirty::CeilingDirty) && sdata.planes[1].vertices.Size()) return true; section->dirty &= ~EDirty::CeilingDirty; } compare->copy(sec); - sdata.poscompare[plane] = sec->firstWall()->pos; - sdata.poscompare2[plane] = sec->firstWall()->point2Wall()->pos; + sdata.poscompare[plane] = sec->walls[0].pos; + sdata.poscompare2[plane] = sec->walls[0].point2Wall()->pos; return false; } diff --git a/source/games/blood/src/actor.cpp b/source/games/blood/src/actor.cpp index a25618851..9bfd280a6 100644 --- a/source/games/blood/src/actor.cpp +++ b/source/games/blood/src/actor.cpp @@ -2611,7 +2611,7 @@ DVector4 actFloorBounceVector(DBloodActor* actor, double oldz, sectortype* pSect } DVector3 p(actor->vel.XY(), oldz); - DAngle angle = pSector->firstWall()->delta().Angle() + DAngle90; + DAngle angle = pSector->walls[0].delta().Angle() + DAngle90; auto t2 = pSector->floorheinum * (1. / SLOPEVAL_FACTOR); auto t3 = DVector2(-1, t2).Length(); auto t4 = DVector3(angle.ToVector() * (t2 / t3), -1 / t3); @@ -5631,7 +5631,7 @@ static void actCheckThings() speed = pXSector->panVel / 128.; if (!pXSector->panAlways && pXSector->busy) speed *= FixedToFloat(pXSector->busy); } - if (pSector->floorstat & CSTAT_SECTOR_ALIGN) angle += pSector->firstWall()->normalAngle(); + if (pSector->floorstat & CSTAT_SECTOR_ALIGN) angle += pSector->walls[0].normalAngle(); actor->vel += angle.ToVector() * speed; } @@ -6044,7 +6044,7 @@ static void actCheckDudes() speed *= FixedToFloat(pXSector->busy); } if (pSector->floorstat & CSTAT_SECTOR_ALIGN) - angle += pSector->firstWall()->normalAngle(); + angle += pSector->walls[0].normalAngle(); actor->vel += angle.ToVector() * speed; } } diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index ff2b56e0f..c4e6606a5 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -1307,7 +1307,7 @@ void nnExtProcessSuperSprites() speed *= FixedToFloat(pXSector->busy); } if (debrisactor->sector()->floorstat & CSTAT_SECTOR_ALIGN) - angle += debrisactor->sector()->firstWall()->normalAngle(); + angle += debrisactor->sector()->walls[0].normalAngle(); debrisactor->vel += angle.ToVector() * speed; } } diff --git a/source/games/duke/src/actors.cpp b/source/games/duke/src/actors.cpp index 410ef4053..80d150641 100644 --- a/source/games/duke/src/actors.cpp +++ b/source/games/duke/src/actors.cpp @@ -988,7 +988,7 @@ void bounce(DDukeActor* actor) auto sectp = actor->sector(); - DAngle daang = sectp->firstWall()->delta().Angle(); + DAngle daang = sectp->walls[0].delta().Angle(); double k; if (actor->spr.pos.Z < (actor->floorz + actor->ceilingz) * 0.5) diff --git a/source/games/duke/src/actors_d.cpp b/source/games/duke/src/actors_d.cpp index 029fd08b7..673be360a 100644 --- a/source/games/duke/src/actors_d.cpp +++ b/source/games/duke/src/actors_d.cpp @@ -3467,7 +3467,7 @@ void moveeffectors_d(void) //STATNUM 3 if (act->spr.lotag != SE_29_WAVES) continue; auto sc = act->sector(); if (sc->walls.Size() != 4) continue; - auto wal = sc->firstWall() + 2; + auto wal = &sc->walls[2]; if (wal->nextSector()) alignflorslope(act->sector(), DVector3(wal->pos, wal->nextSector()->floorz)); } } diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 5d3146045..d48ad20aa 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -738,7 +738,7 @@ void prelevel_common(int g) if (sectp->lotag == -1) { - ps[0].Exit = sectp->firstWall()->pos; + ps[0].Exit = sectp->walls[0].pos; continue; } } diff --git a/source/games/exhumed/src/object.cpp b/source/games/exhumed/src/object.cpp index 65d90ea38..0137ca03d 100644 --- a/source/games/exhumed/src/object.cpp +++ b/source/games/exhumed/src/object.cpp @@ -1633,7 +1633,7 @@ DExhumedActor* BuildEnergyBlock(sectortype* pSector) // GrabTimeSlot(3); - pActor->spr.pos.Z = pSector->firstWall()->nextSector()->floorz; + pActor->spr.pos.Z = pSector->walls[0].nextSector()->floorz; // CHECKME - name of this variable? int nRepeat = int(pActor->spr.pos.Z - pSector->floorz); @@ -2602,8 +2602,8 @@ void PostProcess() if (§ != §j && sectj.Speed && !(sect.Flag & kSectLava)) { - double xVal = abs(sect.firstWall()->pos.X - sectj.firstWall()->pos.X); - double yVal = abs(sect.firstWall()->pos.Y - sectj.firstWall()->pos.Y); + double xVal = abs(sect.walls[0].pos.X - sectj.walls[0].pos.X); + double yVal = abs(sect.walls[0].pos.Y - sectj.walls[0].pos.Y); if (xVal < 15000/16. && yVal < 15000/16. && (xVal + yVal < maxval)) { diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index 0be2aa489..09e70c65b 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -1670,7 +1670,7 @@ void SlipSlope(PLAYER* pp) if (!(sectu->flags & SECTFU_SLIDE_SECTOR) || !(pp->cursector->floorstat & CSTAT_SECTOR_SLOPE)) return; - DAngle ang = pp->cursector->firstWall()->delta().Angle() + DAngle90; + DAngle ang = pp->cursector->walls[0].delta().Angle() + DAngle90; pp->vect += ang.ToVector() * pp->cursector->floorheinum / (1 << (sectu->speed + 4)); // todo confirm scale } diff --git a/source/games/sw/src/rooms.cpp b/source/games/sw/src/rooms.cpp index 2c96d7518..9352ae7a5 100644 --- a/source/games/sw/src/rooms.cpp +++ b/source/games/sw/src/rooms.cpp @@ -198,7 +198,7 @@ void FAFhitscan(const DVector3& start, sectortype* sect, const DVector3& vect, H { if ((hit.hitSector->extra & SECTFX_WARP_SECTOR)) { - if ((hit.hitSector->firstWall()->cstat & CSTAT_WALL_WARP_HITSCAN)) + if ((hit.hitSector->walls[0].cstat & CSTAT_WALL_WARP_HITSCAN)) { // hit the floor of a sector that is a warping sector sectortype* newsect = nullptr; diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 98376c478..0d13b9031 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -1685,10 +1685,10 @@ PlayerPart: // IS part of a sector, sprite can do things based on the // current sector it is in - if ((actor->sector()->firstWall()->extra & WALLFX_LOOP_DONT_SPIN)) + if ((actor->sector()->walls[0].extra & WALLFX_LOOP_DONT_SPIN)) continue; - if ((actor->sector()->firstWall()->extra & WALLFX_LOOP_REVERSE_SPIN)) + if ((actor->sector()->walls[0].extra & WALLFX_LOOP_REVERSE_SPIN)) { actor->spr.pos.XY() = rotatepoint(sop->pmid.XY(), actor->spr.pos.XY(), -deltaangle); actor->spr.angle -= deltaangle;