- cleaned up all -> accesses through firstWall().

This commit is contained in:
Christoph Oelckers 2022-11-15 15:33:35 +01:00
parent af60408e63
commit 5798fa067f
11 changed files with 21 additions and 21 deletions

View file

@ -480,7 +480,7 @@ int HWLinePortal::ClipSector(sectortype *sub)
// this seg is completely behind the mirror
for (unsigned i = 0; i<sub->walls.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;
}

View file

@ -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;
}

View file

@ -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;
}
}

View file

@ -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;
}
}

View file

@ -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)

View file

@ -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));
}
}

View file

@ -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;
}
}

View file

@ -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 (&sect != &sectj && 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))
{

View file

@ -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
}

View file

@ -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;

View file

@ -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;