mirror of
https://github.com/ZDoom/Raze.git
synced 2025-04-07 16:31:26 +00:00
- added a little utility that allows iterating over the walls of a sector with C++ for's.
This commit is contained in:
parent
4b0ffe5443
commit
59df3b0e19
2 changed files with 16 additions and 6 deletions
|
@ -160,3 +160,12 @@ inline int32_t getangle(walltype* wal)
|
|||
wall[wal->point2].y - wal->y);
|
||||
}
|
||||
|
||||
inline TArrayView<walltype> wallsofsector(sectortype* sec)
|
||||
{
|
||||
return TArrayView<walltype>(sec->firstWall(), sec->wallnum);
|
||||
}
|
||||
|
||||
inline TArrayView<walltype> wallsofsector(int sec)
|
||||
{
|
||||
return wallsofsector(§or[sec]);
|
||||
}
|
||||
|
|
|
@ -331,16 +331,17 @@ void movecyclers(void)
|
|||
c->lotag += sect->extra;
|
||||
if (c->state)
|
||||
{
|
||||
auto wal = sect->firstWall();
|
||||
for (int x = sect->wallnum; x > 0; x--, wal++)
|
||||
if (wal->hitag != 1)
|
||||
for (auto& wal : wallsofsector(sect))
|
||||
{
|
||||
if (wal.hitag != 1)
|
||||
{
|
||||
wal->shade = j;
|
||||
wal.shade = j;
|
||||
|
||||
if ((wal->cstat & CSTAT_WALL_BOTTOM_SWAP) && wal->nextwall >= 0)
|
||||
wal->nextWall()->shade = j;
|
||||
if ((wal.cstat & CSTAT_WALL_BOTTOM_SWAP) && wal.nextwall >= 0)
|
||||
wal.nextWall()->shade = j;
|
||||
|
||||
}
|
||||
}
|
||||
sect->floorshade = sect->ceilingshade = j;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue