- premap_d

This commit is contained in:
Christoph Oelckers 2021-11-17 22:48:05 +01:00
parent 6b8e7b3fbc
commit 7a504e27d2

View file

@ -272,7 +272,7 @@ void cacheit_d(void)
void prelevel_d(int g)
{
int i, j, startwall, endwall, lotaglist;
int i, j, lotaglist;
short lotags[65];
prelevel_common(g);
@ -376,24 +376,21 @@ void prelevel_d(int g)
mirrorcnt = 0;
for (i = 0; i < numwalls; i++)
for (auto& wal : walls())
{
walltype* wal;
wal = &wall[i];
if (wal->overpicnum == MIRROR && (wal->cstat & 32) != 0)
if (wal.overpicnum == MIRROR && (wal.cstat & 32) != 0)
{
j = wal->nextsector;
auto sectp = &sector[j];
auto sectp = wal.nextSector();
if (mirrorcnt > 63)
I_Error("Too many mirrors (64 max.)");
if ((j >= 0) && sectp->ceilingpicnum != MIRROR)
if (sectp->ceilingpicnum != MIRROR)
{
assert(wallnum(&wal) > 0);
sectp->ceilingpicnum = MIRROR;
sectp->floorpicnum = MIRROR;
mirrorwall[mirrorcnt] = i;
mirrorsector[mirrorcnt] = j;
mirrorwall[mirrorcnt] = wallnum(&wal);
mirrorsector[mirrorcnt] = sectnum(sectp);
mirrorcnt++;
continue;
}
@ -405,55 +402,55 @@ void prelevel_d(int g)
animwall[numanimwalls].tag = 0;
animwall[numanimwalls].wallnum = 0;
switch (wal->overpicnum)
switch (wal.overpicnum)
{
case FANSHADOW:
case FANSPRITE:
wal->cstat |= 65;
animwall[numanimwalls].wallnum = i;
wal.cstat |= 65;
animwall[numanimwalls].wallnum = wallnum(&wal);
numanimwalls++;
break;
case W_FORCEFIELD:
for (j = 0; j < 3; j++)
for (int j = 0; j < 3; j++)
tloadtile(W_FORCEFIELD + j);
[[fallthrough]];
case W_FORCEFIELD + 1:
case W_FORCEFIELD + 2:
if (wal->shade > 31)
wal->cstat = 0;
else wal->cstat |= 85 + 256;
if (wal.shade > 31)
wal.cstat = 0;
else wal.cstat |= 85 + 256;
if (wal->lotag && wal->nextwall >= 0)
wal->nextWall()->lotag = wal->lotag;
if (wal.lotag && wal.nextwall >= 0)
wal.nextWall()->lotag = wal.lotag;
[[fallthrough]];
case BIGFORCE:
animwall[numanimwalls].wallnum = i;
animwall[numanimwalls].wallnum = wallnum(&wal);
numanimwalls++;
continue;
}
wal->extra = -1;
wal.extra = -1;
switch (wal->picnum)
switch (wal.picnum)
{
case W_TECHWALL1:
case W_TECHWALL2:
case W_TECHWALL3:
case W_TECHWALL4:
animwall[numanimwalls].wallnum = i;
animwall[numanimwalls].wallnum = wallnum(&wal);
// animwall[numanimwalls].tag = -1;
numanimwalls++;
break;
case SCREENBREAK6:
case SCREENBREAK7:
case SCREENBREAK8:
for (j = SCREENBREAK6; j < SCREENBREAK9; j++)
for (int j = SCREENBREAK6; j < SCREENBREAK9; j++)
tloadtile(j);
animwall[numanimwalls].wallnum = i;
animwall[numanimwalls].wallnum = wallnum(&wal);
animwall[numanimwalls].tag = -1;
numanimwalls++;
break;
@ -462,11 +459,11 @@ void prelevel_d(int g)
case FEMPIC2:
case FEMPIC3:
wal->extra = wal->picnum;
wal.extra = wal.picnum;
animwall[numanimwalls].tag = -1;
animwall[numanimwalls].wallnum = i;
animwall[numanimwalls].tag = wal->picnum;
animwall[numanimwalls].wallnum = wallnum(&wal);
animwall[numanimwalls].tag = wal.picnum;
numanimwalls++;
break;
@ -488,8 +485,8 @@ void prelevel_d(int g)
case SCREENBREAK18:
case SCREENBREAK19:
animwall[numanimwalls].wallnum = i;
animwall[numanimwalls].tag = wal->picnum;
animwall[numanimwalls].wallnum = wallnum(&wal);
animwall[numanimwalls].tag = wal.picnum;
numanimwalls++;
break;
}
@ -498,12 +495,10 @@ void prelevel_d(int g)
//Invalidate textures in sector behind mirror
for (i = 0; i < mirrorcnt; i++)
{
startwall = sector[mirrorsector[i]].wallptr;
endwall = startwall + sector[mirrorsector[i]].wallnum;
for (j = startwall; j < endwall; j++)
for (auto& wal : wallsofsector(mirrorsector[i]))
{
wall[j].picnum = MIRROR;
wall[j].overpicnum = MIRROR;
wal.picnum = MIRROR;
wal.overpicnum = MIRROR;
}
}
}