- all wall loops using point2.

This commit is contained in:
Christoph Oelckers 2021-11-24 20:33:47 +01:00
parent 7e6de45e46
commit 9f9c01284b
3 changed files with 22 additions and 26 deletions

View file

@ -183,9 +183,9 @@ void so_addinterpolation(SECTOR_OBJECTp sop)
if (wal.twoSided())
{
auto nextWall = wal.nextWall();
so_setpointinterpolation(interp, nextWall->point2 | soi_wallx);
so_setpointinterpolation(interp, nextWall->point2 | soi_wally);
auto nextWall = wal.nextWall()->point2Wall();
so_setpointinterpolation(interp, wallnum(nextWall) | soi_wallx);
so_setpointinterpolation(interp, wallnum(nextWall) | soi_wally);
}
}

View file

@ -121,7 +121,6 @@ bool FAF_Sector(sectortype* sectnum)
void SetWallWarpHitscan(short sectnum)
{
short start_wall, wall_num;
DSWActor* sp_warp;
if (!WarpSectorInfo(sectnum, &sp_warp))
@ -130,31 +129,29 @@ void SetWallWarpHitscan(short sectnum)
if (!sp_warp)
return;
// move the the next wall
wall_num = start_wall = sector[sectnum].wallptr;
auto start_wall = sector[sectnum].firstWall();
auto wall_num = start_wall;
// Travel all the way around loop setting wall bits
do
{
if (validWallIndex(wall[wall_num].nextwall))
SET(wall[wall_num].cstat, CSTAT_WALL_WARP_HITSCAN);
wall_num = wall[wall_num].point2;
if (validWallIndex(wall_num->nextwall))
SET(wall_num->cstat, CSTAT_WALL_WARP_HITSCAN);
wall_num = wall_num->point2Wall();
}
while (wall_num != start_wall);
}
void ResetWallWarpHitscan(short sectnum)
{
short start_wall, wall_num;
// move the the next wall
wall_num = start_wall = sector[sectnum].wallptr;
auto start_wall = sector[sectnum].firstWall();
auto wall_num = start_wall;
// Travel all the way around loop setting wall bits
do
{
RESET(wall[wall_num].cstat, CSTAT_WALL_WARP_HITSCAN);
wall_num = wall[wall_num].point2;
RESET(wall_num->cstat, CSTAT_WALL_WARP_HITSCAN);
wall_num = wall_num->point2Wall();
}
while (wall_num != start_wall);
}

View file

@ -90,23 +90,22 @@ SPRING_BOARD SpringBoard[20];
void SetSectorWallBits(short sectnum, int bit_mask, bool set_sectwall, bool set_nextwall)
{
short wall_num, start_wall;
wall_num = start_wall = sector[sectnum].wallptr;
auto start_wall = sector[sectnum].firstWall();
auto wall_num = start_wall;
do
{
if (set_sectwall)
SET(wall[wall_num].extra, bit_mask);
SET(wall_num->extra, bit_mask);
if (set_nextwall)
{
uint16_t const nextwall = wall[wall_num].nextwall;
uint16_t const nextwall = wall_num->nextwall;
if (validWallIndex(nextwall))
SET(wall[nextwall].extra, bit_mask);
}
wall_num = wall[wall_num].point2;
wall_num = wall_num->point2Wall();
}
while (wall_num != start_wall);
@ -151,12 +150,12 @@ static void WallSetupLoop(WALLp wp, int16_t lotag, int16_t extra)
}
// Travel all the way around loop setting wall bits
for (uint16_t wall_num = wp->point2;
wall[wall_num].lotag != lotag;
wall_num = wall[wall_num].point2)
for (auto wall_num = wp->point2Wall();
wall_num->lotag != lotag;
wall_num = wall_num->point2Wall())
{
SET(wall[wall_num].extra, extra);
uint16_t const nextwall = wall[wall_num].nextwall;
SET(wall_num->extra, extra);
uint16_t const nextwall = wall_num->nextwall;
if (validWallIndex(nextwall))
SET(wall[nextwall].extra, extra);
}