- quick global wall[] replacements.

This commit is contained in:
Christoph Oelckers 2021-11-07 08:46:15 +01:00
parent a594e6465c
commit b13398c268
7 changed files with 30 additions and 30 deletions

View file

@ -331,14 +331,14 @@ void movecyclers(void)
c->lotag += sect->extra;
if (c->state)
{
auto wal = &wall[sect->wallptr];
auto wal = sect->firstWall();
for (int x = sect->wallnum; x > 0; x--, wal++)
if (wal->hitag != 1)
{
wal->shade = j;
if ((wal->cstat & CSTAT_WALL_BOTTOM_SWAP) && wal->nextwall >= 0)
wall[wal->nextwall].shade = j;
wal->nextWall()->shade = j;
}
sect->floorshade = sect->ceilingshade = j;
@ -3314,7 +3314,7 @@ void handle_se03(DDukeActor *actor)
sc->ceilingshade = t[0];
sc->floorshade = t[0];
auto wal = &wall[sc->wallptr];
auto wal = sc->firstWall();
for (x = sc->wallnum; x > 0; x--, wal++)
{
@ -3323,7 +3323,7 @@ void handle_se03(DDukeActor *actor)
wal->shade = t[0];
if ((wal->cstat & 2) && wal->nextwall >= 0)
{
wall[wal->nextwall].shade = wal->shade;
wal->nextWall()->shade = wal->shade;
}
}
}
@ -3368,7 +3368,7 @@ void handle_se04(DDukeActor *actor)
sc->floorshade = t[1];
sc->ceilingshade = t[1];
auto wal = &wall[sc->wallptr];
auto wal = sc->firstWall();
for (int x = sc->wallnum; x > 0; x--, wal++)
{
@ -3379,7 +3379,7 @@ void handle_se04(DDukeActor *actor)
{
wal->shade = t[0];
if ((wal->cstat & 2) && wal->nextwall >= 0)
wall[wal->nextwall].shade = wal->shade;
wal->nextWall()->shade = wal->shade;
}
}
@ -3544,7 +3544,7 @@ void handle_se08(DDukeActor *actor, bool checkhitag1)
auto sect = ac->getSector();
int m = ac->s->shade;
auto wal = &wall[sect->wallptr];
auto wal = sect->firstWall();
for (int l = sect->wallnum; l > 0; l--, wal++)
{
@ -3558,8 +3558,8 @@ void handle_se08(DDukeActor *actor, bool checkhitag1)
wal->shade = ac->temp_data[2];
if (wal->nextwall >= 0)
if (wall[wal->nextwall].hitag != 1)
wall[wal->nextwall].shade = wal->shade;
if (wal->nextWall()->hitag != 1)
wal->nextWall()->shade = wal->shade;
}
}
@ -3718,7 +3718,7 @@ void handle_se12(DDukeActor *actor, int planeonly)
sc->floorpal = 0;
sc->ceilingpal = 0;
auto wal = &wall[sc->wallptr];
auto wal = sc->firstWall();
for (int j = sc->wallnum; j > 0; j--, wal++)
if (wal->hitag != 1)
{
@ -3759,7 +3759,7 @@ void handle_se12(DDukeActor *actor, int planeonly)
if (planeonly != 2) sc->floorshade -= 2;
if (planeonly != 1) sc->ceilingshade -= 2;
auto wal = &wall[sc->wallptr];
auto wal = sc->firstWall();
for (int j = sc->wallnum; j > 0; j--, wal++)
if (wal->hitag != 1)
{
@ -3833,7 +3833,7 @@ void handle_se13(DDukeActor* actor)
if (s->ang == 512)
{
auto wal = &wall[sc->wallptr];
auto wal = sc->firstWall();
for (j = sc->wallnum; j > 0; j--, wal++)
wal->shade = s->shade;
@ -4753,22 +4753,22 @@ void handle_se128(DDukeActor *actor)
wal->cstat |= 16;
if (wal->nextwall >= 0)
{
wall[wal->nextwall].cstat &= (255 - 32);
wall[wal->nextwall].cstat |= 16;
wal->nextWall()->cstat &= (255 - 32);
wal->nextWall()->cstat |= 16;
}
}
// else return;
wal->overpicnum++;
if (wal->nextwall >= 0)
wall[wal->nextwall].overpicnum++;
wal->nextWall()->overpicnum++;
if (t[0] < t[1]) t[0]++;
else
{
wal->cstat &= (128 + 32 + 8 + 4 + 2);
if (wal->nextwall >= 0)
wall[wal->nextwall].cstat &= (128 + 32 + 8 + 4 + 2);
wal->nextWall()->cstat &= (128 + 32 + 8 + 4 + 2);
deletesprite(actor);
}
}

View file

@ -487,7 +487,7 @@ static void shootweapon(DDukeActor *actor, int p, int sx, int sy, int sz, int sa
return;
}
if (wal->hitag != 0 || (wal->nextwall >= 0 && wall[wal->nextwall].hitag != 0))
if (wal->hitag != 0 || (wal->nextwall >= 0 && wal->nextWall()->hitag != 0))
goto SKIPBULLETHOLE;
if (hitsect >= 0 && sector[hitsect].lotag == 0)

View file

@ -387,7 +387,7 @@ static void shootweapon(DDukeActor* actor, int p, int sx, int sy, int sz, int sa
return;
}
if (wal->hitag != 0 || (wal->nextwall >= 0 && wall[wal->nextwall].hitag != 0))
if (wal->hitag != 0 || (wal->nextwall >= 0 && wal->nextWall()->hitag != 0))
goto SKIPBULLETHOLE;
if (hitsect >= 0 && sector[hitsect].lotag == 0)

View file

@ -426,7 +426,7 @@ void prelevel_d(int g)
else wal->cstat |= 85 + 256;
if (wal->lotag && wal->nextwall >= 0)
wall[wal->nextwall].lotag = wal->lotag;
wal->nextWall()->lotag = wal->lotag;
case BIGFORCE:

View file

@ -1091,7 +1091,7 @@ void operateactivators(int low, int plnum)
p->state = !p->state;
sect->floorshade = sect->ceilingshade = (int8_t)p->shade2;
wal = &wall[sect->wallptr];
wal = sect->firstWall();
for (j = sect->wallnum; j > 0; j--, wal++)
wal->shade = (int8_t)p->shade2;
}

View file

@ -701,8 +701,8 @@ void checkhitwall_d(DDukeActor* spr, int dawallnum, int x, int y, int z, int atw
wal->cstat &= 65535 - 65;
if (wal->nextwall >= 0)
{
wall[wal->nextwall].overpicnum = FANSPRITEBROKE;
wall[wal->nextwall].cstat &= 65535 - 65;
wal->nextWall()->overpicnum = FANSPRITEBROKE;
wal->nextWall()->cstat &= 65535 - 65;
}
S_PlayActorSound(VENT_BUST, spr);
S_PlayActorSound(GLASS_BREAKING, spr);
@ -716,7 +716,7 @@ void checkhitwall_d(DDukeActor* spr, int dawallnum, int x, int y, int z, int atw
wal->cstat = 0;
if (wal->nextwall >= 0)
wall[wal->nextwall].cstat = 0;
wal->nextWall()->cstat = 0;
auto spawned = EGS(sn, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, spr, 3);
spawned->s->lotag = 128;
@ -730,7 +730,7 @@ void checkhitwall_d(DDukeActor* spr, int dawallnum, int x, int y, int z, int atw
lotsofcolourglass(spr, dawallnum, 80);
wal->cstat = 0;
if (wal->nextwall >= 0)
wall[wal->nextwall].cstat = 0;
wal->nextWall()->cstat = 0;
S_PlayActorSound(VENT_BUST, spr);
S_PlayActorSound(GLASS_BREAKING, spr);
return;

View file

@ -1015,8 +1015,8 @@ void checkhitwall_r(DDukeActor* spr, int dawallnum, int x, int y, int z, int atw
wal->cstat &= 65535 - 65;
if (wal->nextwall >= 0)
{
wall[wal->nextwall].overpicnum = FANSPRITEBROKE;
wall[wal->nextwall].cstat &= 65535 - 65;
wal->nextWall()->overpicnum = FANSPRITEBROKE;
wal->nextWall()->cstat &= 65535 - 65;
}
S_PlayActorSound(VENT_BUST, spr);
S_PlayActorSound(GLASS_BREAKING, spr);
@ -1030,7 +1030,7 @@ void checkhitwall_r(DDukeActor* spr, int dawallnum, int x, int y, int z, int atw
wal->cstat = 0;
if (wal->nextwall >= 0)
wall[wal->nextwall].cstat = 0;
wal->nextWall()->cstat = 0;
auto spawned = EGS(sn, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, spr, 3);
spawned->s->lotag = 128;
@ -1047,7 +1047,7 @@ void checkhitwall_r(DDukeActor* spr, int dawallnum, int x, int y, int z, int atw
wal->cstat = 0;
if (wal->nextwall >= 0)
wall[wal->nextwall].cstat = 0;
wal->nextWall()->cstat = 0;
auto spawned = EGS(sn, x, y, z, SECTOREFFECTOR, 0, 0, 0, ps[0].angle.ang.asbuild(), 0, 0, spr, 3);
spawned->s->lotag = 128;
@ -1061,7 +1061,7 @@ void checkhitwall_r(DDukeActor* spr, int dawallnum, int x, int y, int z, int atw
lotsofcolourglass(spr, dawallnum, 80);
wal->cstat = 0;
if (wal->nextwall >= 0)
wall[wal->nextwall].cstat = 0;
wal->nextWall()->cstat = 0;
S_PlayActorSound(VENT_BUST, spr);
S_PlayActorSound(GLASS_BREAKING, spr);
return;
@ -1080,7 +1080,7 @@ void checkhitwall_r(DDukeActor* spr, int dawallnum, int x, int y, int z, int atw
int sect;
int unk = 0;
int startwall, endwall;
sect = wall[wal->nextwall].nextsector;
sect = wal->nextWall()->nextsector;
DukeSectIterator it(sect);
while (auto act = it.Next())
{