mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 08:52:00 +00:00
- sector wall access cleanup.
lastWall was only used twice and firstWall() + index can be done better now.
This commit is contained in:
parent
7d9a4ea70d
commit
af60408e63
6 changed files with 11 additions and 12 deletions
|
@ -428,7 +428,6 @@ struct sectortype
|
|||
int getfloorslope() const { return floorstat & CSTAT_SECTOR_SLOPE ? floorheinum : 0; }
|
||||
int getceilingslope() const { return ceilingstat & CSTAT_SECTOR_SLOPE ? ceilingheinum : 0; }
|
||||
walltype* firstWall() const { return walls.Data(); }
|
||||
walltype* lastWall() const { return &walls.Last(); }
|
||||
|
||||
|
||||
Blood::XSECTOR& xs() const { return *_xs; }
|
||||
|
|
|
@ -410,7 +410,7 @@ void HWDrawInfo::CreateScene(bool portal)
|
|||
auto sect = eff.geosectorwarp[i];
|
||||
for (unsigned w = 0; w < sect->walls.Size(); w++)
|
||||
{
|
||||
auto wal = sect->firstWall() + w;
|
||||
auto wal = §->walls[w];
|
||||
wal->pos.X += eff.geox[i];
|
||||
wal->pos.Y += eff.geoy[i];
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ void HWDrawInfo::CreateScene(bool portal)
|
|||
auto sect = eff.geosectorwarp[i];
|
||||
for (unsigned w = 0; w < sect->walls.Size(); w++)
|
||||
{
|
||||
auto wal = sect->firstWall() + w;
|
||||
auto wal = §->walls[w];
|
||||
wal->pos.X -= eff.geox[i];
|
||||
wal->pos.Y -= eff.geoy[i];
|
||||
}
|
||||
|
@ -442,7 +442,7 @@ void HWDrawInfo::CreateScene(bool portal)
|
|||
auto sect = eff.geosectorwarp2[i];
|
||||
for (unsigned w = 0; w < sect->walls.Size(); w++)
|
||||
{
|
||||
auto wal = sect->firstWall() + w;
|
||||
auto wal = §->walls[w];
|
||||
wal->pos.X += eff.geox2[i];
|
||||
wal->pos.Y += eff.geoy2[i];
|
||||
}
|
||||
|
@ -460,7 +460,7 @@ void HWDrawInfo::CreateScene(bool portal)
|
|||
auto sect = eff.geosectorwarp2[i];
|
||||
for (unsigned w = 0; w < sect->walls.Size(); w++)
|
||||
{
|
||||
auto wal = sect->firstWall() + w;
|
||||
auto wal = §->walls[w];
|
||||
wal->pos.X -= eff.geox2[i];
|
||||
wal->pos.Y -= eff.geoy2[i];
|
||||
}
|
||||
|
|
|
@ -2168,7 +2168,7 @@ void AlignSlopes(void)
|
|||
{
|
||||
if (sect.slopewallofs)
|
||||
{
|
||||
walltype* pWall = sect.firstWall() + sect.slopewallofs;
|
||||
walltype* pWall = §.walls[sect.slopewallofs];
|
||||
if (pWall->twoSided())
|
||||
{
|
||||
auto pNextSector = pWall->nextSector();
|
||||
|
|
|
@ -3386,7 +3386,7 @@ void moveeffectors_r(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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2609,7 +2609,7 @@ void DoSineWaveFloor(void)
|
|||
if (sect->walls.Size() == 4)
|
||||
{
|
||||
//Set wal to the wall on the opposite side of the sector
|
||||
wal = sect->firstWall() + 2;
|
||||
wal = §->walls[2];
|
||||
|
||||
//Pass (Sector, x, y, z)
|
||||
alignflorslope(sect,DVector3(wal->pos, wal->nextSector()->floorz));
|
||||
|
|
|
@ -248,8 +248,8 @@ void DoSlidorInterp(DSWActor* actor, INTERP_FUNC interp_func)
|
|||
auto sect = actor->sector();
|
||||
|
||||
// this code is just weird.
|
||||
auto startWall = sect->firstWall();
|
||||
auto endWall = sect->lastWall();
|
||||
auto startWall = §->walls[0];
|
||||
auto endWall = §->walls.Last();
|
||||
auto wal = startWall;
|
||||
do
|
||||
{
|
||||
|
@ -306,8 +306,8 @@ int DoSlidorMoveWalls(DSWActor* actor, double amt)
|
|||
auto sect = actor->sector();
|
||||
|
||||
// this code is just weird.
|
||||
auto startWall = sect->firstWall();
|
||||
auto endWall = sect->lastWall();
|
||||
auto startWall = §->walls[0];
|
||||
auto endWall = §->walls.Last();
|
||||
auto wal = startWall;
|
||||
walltype* pwal;
|
||||
|
||||
|
|
Loading…
Reference in a new issue