mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-16 01:11:44 +00:00
- iterator loops in sectorfx.cpp.
This commit is contained in:
parent
b3bf1bc037
commit
c54137766c
1 changed files with 18 additions and 25 deletions
|
@ -138,14 +138,12 @@ void DoSectorLighting(void)
|
|||
}
|
||||
if (pXSector->shadeWalls)
|
||||
{
|
||||
int nStartWall = pSector->wallptr;
|
||||
int nEndWall = nStartWall + pSector->wallnum;
|
||||
for (int j = nStartWall; j < nEndWall; j++)
|
||||
for(auto& wal : wallsofsector(pSector))
|
||||
{
|
||||
wall[j].shade -= v4;
|
||||
wal.shade -= v4;
|
||||
if (pXSector->color)
|
||||
{
|
||||
wall[j].pal = pSector->floorpal;
|
||||
wal.pal = pSector->floorpal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -182,14 +180,12 @@ void DoSectorLighting(void)
|
|||
}
|
||||
if (pXSector->shadeWalls)
|
||||
{
|
||||
int nStartWall = pSector->wallptr;
|
||||
int nEndWall = nStartWall + pSector->wallnum;
|
||||
for (int j = nStartWall; j < nEndWall; j++)
|
||||
for (auto& wal : wallsofsector(pSector))
|
||||
{
|
||||
wall[j].shade = ClipRange(wall[j].shade+v4, -128, 127);
|
||||
wal.shade = ClipRange(wal.shade+v4, -128, 127);
|
||||
if (pXSector->color && v4 != 0)
|
||||
{
|
||||
wall[j].pal = pSector->floorpal;
|
||||
wal.pal = pSector->floorpal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -200,45 +196,42 @@ void DoSectorLighting(void)
|
|||
|
||||
void UndoSectorLighting(void)
|
||||
{
|
||||
for (int i = 0; i < numsectors; i++)
|
||||
for (auto& sect : sectors())
|
||||
{
|
||||
int nXSprite = sector[i].extra;
|
||||
if (nXSprite > 0)
|
||||
if (sect.hasX())
|
||||
{
|
||||
XSECTOR *pXSector = &xsector[i];
|
||||
XSECTOR *pXSector = §.xs();
|
||||
if (pXSector->shade)
|
||||
{
|
||||
int v4 = pXSector->shade;
|
||||
if (pXSector->shadeFloor)
|
||||
{
|
||||
sector[i].floorshade -= v4;
|
||||
sect.floorshade -= v4;
|
||||
if (pXSector->color)
|
||||
{
|
||||
int nTemp = pXSector->floorpal;
|
||||
pXSector->floorpal = sector[i].floorpal;
|
||||
sector[i].floorpal = nTemp;
|
||||
pXSector->floorpal = sect.floorpal;
|
||||
sect.floorpal = nTemp;
|
||||
}
|
||||
}
|
||||
if (pXSector->shadeCeiling)
|
||||
{
|
||||
sector[i].ceilingshade -= v4;
|
||||
sect.ceilingshade -= v4;
|
||||
if (pXSector->color)
|
||||
{
|
||||
int nTemp = pXSector->ceilpal;
|
||||
pXSector->ceilpal = sector[i].ceilingpal;
|
||||
sector[i].ceilingpal = nTemp;
|
||||
pXSector->ceilpal = sect.ceilingpal;
|
||||
sect.ceilingpal = nTemp;
|
||||
}
|
||||
}
|
||||
if (pXSector->shadeWalls)
|
||||
{
|
||||
int nStartWall = sector[i].wallptr;
|
||||
int nEndWall = nStartWall + sector[i].wallnum;
|
||||
for (int j = nStartWall; j < nEndWall; j++)
|
||||
for(auto& wal : wallsofsector(§))
|
||||
{
|
||||
wall[j].shade -= v4;
|
||||
wal.shade -= v4;
|
||||
if (pXSector->color)
|
||||
{
|
||||
wall[j].pal = sector[i].floorpal;
|
||||
wal.pal = sect.floorpal;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue