mirror of
https://github.com/DrBeef/Raze.git
synced 2024-11-15 17:01:51 +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)
|
if (pXSector->shadeWalls)
|
||||||
{
|
{
|
||||||
int nStartWall = pSector->wallptr;
|
for(auto& wal : wallsofsector(pSector))
|
||||||
int nEndWall = nStartWall + pSector->wallnum;
|
|
||||||
for (int j = nStartWall; j < nEndWall; j++)
|
|
||||||
{
|
{
|
||||||
wall[j].shade -= v4;
|
wal.shade -= v4;
|
||||||
if (pXSector->color)
|
if (pXSector->color)
|
||||||
{
|
{
|
||||||
wall[j].pal = pSector->floorpal;
|
wal.pal = pSector->floorpal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -182,14 +180,12 @@ void DoSectorLighting(void)
|
||||||
}
|
}
|
||||||
if (pXSector->shadeWalls)
|
if (pXSector->shadeWalls)
|
||||||
{
|
{
|
||||||
int nStartWall = pSector->wallptr;
|
for (auto& wal : wallsofsector(pSector))
|
||||||
int nEndWall = nStartWall + pSector->wallnum;
|
|
||||||
for (int j = nStartWall; j < nEndWall; j++)
|
|
||||||
{
|
{
|
||||||
wall[j].shade = ClipRange(wall[j].shade+v4, -128, 127);
|
wal.shade = ClipRange(wal.shade+v4, -128, 127);
|
||||||
if (pXSector->color && v4 != 0)
|
if (pXSector->color && v4 != 0)
|
||||||
{
|
{
|
||||||
wall[j].pal = pSector->floorpal;
|
wal.pal = pSector->floorpal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,45 +196,42 @@ void DoSectorLighting(void)
|
||||||
|
|
||||||
void UndoSectorLighting(void)
|
void UndoSectorLighting(void)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < numsectors; i++)
|
for (auto& sect : sectors())
|
||||||
{
|
{
|
||||||
int nXSprite = sector[i].extra;
|
if (sect.hasX())
|
||||||
if (nXSprite > 0)
|
|
||||||
{
|
{
|
||||||
XSECTOR *pXSector = &xsector[i];
|
XSECTOR *pXSector = §.xs();
|
||||||
if (pXSector->shade)
|
if (pXSector->shade)
|
||||||
{
|
{
|
||||||
int v4 = pXSector->shade;
|
int v4 = pXSector->shade;
|
||||||
if (pXSector->shadeFloor)
|
if (pXSector->shadeFloor)
|
||||||
{
|
{
|
||||||
sector[i].floorshade -= v4;
|
sect.floorshade -= v4;
|
||||||
if (pXSector->color)
|
if (pXSector->color)
|
||||||
{
|
{
|
||||||
int nTemp = pXSector->floorpal;
|
int nTemp = pXSector->floorpal;
|
||||||
pXSector->floorpal = sector[i].floorpal;
|
pXSector->floorpal = sect.floorpal;
|
||||||
sector[i].floorpal = nTemp;
|
sect.floorpal = nTemp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pXSector->shadeCeiling)
|
if (pXSector->shadeCeiling)
|
||||||
{
|
{
|
||||||
sector[i].ceilingshade -= v4;
|
sect.ceilingshade -= v4;
|
||||||
if (pXSector->color)
|
if (pXSector->color)
|
||||||
{
|
{
|
||||||
int nTemp = pXSector->ceilpal;
|
int nTemp = pXSector->ceilpal;
|
||||||
pXSector->ceilpal = sector[i].ceilingpal;
|
pXSector->ceilpal = sect.ceilingpal;
|
||||||
sector[i].ceilingpal = nTemp;
|
sect.ceilingpal = nTemp;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (pXSector->shadeWalls)
|
if (pXSector->shadeWalls)
|
||||||
{
|
{
|
||||||
int nStartWall = sector[i].wallptr;
|
for(auto& wal : wallsofsector(§))
|
||||||
int nEndWall = nStartWall + sector[i].wallnum;
|
|
||||||
for (int j = nStartWall; j < nEndWall; j++)
|
|
||||||
{
|
{
|
||||||
wall[j].shade -= v4;
|
wal.shade -= v4;
|
||||||
if (pXSector->color)
|
if (pXSector->color)
|
||||||
{
|
{
|
||||||
wall[j].pal = sector[i].floorpal;
|
wal.pal = sect.floorpal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue