mirror of
https://github.com/DrBeef/Raze.git
synced 2025-01-31 21:20:39 +00:00
- got rid of most nextsector references.
This commit is contained in:
parent
612a9e258e
commit
d0eece244b
6 changed files with 27 additions and 38 deletions
|
@ -43,7 +43,7 @@ typedef struct
|
||||||
DSWActor* cameraActor; // Contains number of ST1 sprite used as a camera
|
DSWActor* cameraActor; // Contains number of ST1 sprite used as a camera
|
||||||
DSWActor* camspriteActor; // sprite pointing to campic
|
DSWActor* camspriteActor; // sprite pointing to campic
|
||||||
walltype* mirrorWall; // Wall number containing the mirror tile
|
walltype* mirrorWall; // Wall number containing the mirror tile
|
||||||
sectortype* mirrorSector; // nextsector used internally to draw mirror rooms
|
sectortype* mirrorSector; // used internally to draw mirror rooms
|
||||||
short campic; // Editart tile number to draw a screen to
|
short campic; // Editart tile number to draw a screen to
|
||||||
short numspawnspots; // Number of spawnspots used
|
short numspawnspots; // Number of spawnspots used
|
||||||
short spawnspots[MAXMIRRORMONSTERS]; // One spot for each possible skill level for a max of up to 4 coolie ghosts to spawn.
|
short spawnspots[MAXMIRRORMONSTERS]; // One spot for each possible skill level for a max of up to 4 coolie ghosts to spawn.
|
||||||
|
|
|
@ -3410,7 +3410,7 @@ void DoPlayerClimb(PLAYERp pp)
|
||||||
ny = MOVEy(100, lsp->ang);
|
ny = MOVEy(100, lsp->ang);
|
||||||
|
|
||||||
// set ladder sector
|
// set ladder sector
|
||||||
pp->LadderSector = wp->nextsector >= 0? wp->nextsector : wp->sector;
|
pp->LadderSector = wp->twoSided()? wp->nextsector : wp->sector;
|
||||||
|
|
||||||
// set players "view" distance from the ladder - needs to be farther than
|
// set players "view" distance from the ladder - needs to be farther than
|
||||||
// the sprite
|
// the sprite
|
||||||
|
@ -3804,15 +3804,7 @@ bool PlayerOnLadder(PLAYERp pp)
|
||||||
nx = MOVEx(100, lsp->ang);
|
nx = MOVEx(100, lsp->ang);
|
||||||
ny = MOVEy(100, lsp->ang);
|
ny = MOVEy(100, lsp->ang);
|
||||||
|
|
||||||
#if DEBUG
|
pp->LadderSector = wall[wal].twoSided() ? wall[wal].nextsector : wall[wal].sector;
|
||||||
if (wall[wal].nextsector < 0)
|
|
||||||
{
|
|
||||||
I_Error("Take out white wall ladder x = %d, y = %d",wall[wal].x, wall[wal].y);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
pp->LadderSector = wall[wal].nextsector >= 0 ? wall[wal].nextsector : wall[wal].sector;
|
|
||||||
//DSPRINTF(ds, "Ladder Sector %d", pp->LadderSector);
|
|
||||||
MONO_PRINT(ds);
|
MONO_PRINT(ds);
|
||||||
|
|
||||||
// set players "view" distance from the ladder - needs to be farther than
|
// set players "view" distance from the ladder - needs to be farther than
|
||||||
|
|
|
@ -2539,8 +2539,7 @@ void DoSineWaveFloor(void)
|
||||||
wal = &wall[sector[swf->sector].wallptr+2];
|
wal = &wall[sector[swf->sector].wallptr+2];
|
||||||
|
|
||||||
//Pass (Sector, x, y, z)
|
//Pass (Sector, x, y, z)
|
||||||
alignflorslope(swf->sector,wal->x,wal->y,
|
alignflorslope(swf->sector,wal->x,wal->y, wal->nextSector()->floorz);
|
||||||
sector[wal->nextsector].floorz);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1476,7 +1476,6 @@ void PreMapCombineFloors(void)
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
int base_offset;
|
int base_offset;
|
||||||
int dx, dy;
|
int dx, dy;
|
||||||
int startwall, endwall, nextsector;
|
|
||||||
short pnum;
|
short pnum;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
@ -1520,8 +1519,8 @@ void PreMapCombineFloors(void)
|
||||||
dx = BoundList[base_offset].offset->x - BoundList[i].offset->x;
|
dx = BoundList[base_offset].offset->x - BoundList[i].offset->x;
|
||||||
dy = BoundList[base_offset].offset->y - BoundList[i].offset->y;
|
dy = BoundList[base_offset].offset->y - BoundList[i].offset->y;
|
||||||
|
|
||||||
BFSSearch search(numsectors, BoundList[i].offset->sectnum);
|
BFSSectorSearch search(§or[BoundList[i].offset->sectnum]);
|
||||||
for (unsigned dasect; (dasect = search.GetNext()) != BFSSearch::EOL;)
|
while (auto dasect = search.GetNext())
|
||||||
{
|
{
|
||||||
SWSectIterator it(dasect);
|
SWSectIterator it(dasect);
|
||||||
while (auto jActor = it.Next())
|
while (auto jActor = it.Next())
|
||||||
|
@ -1535,18 +1534,17 @@ void PreMapCombineFloors(void)
|
||||||
wal.x += dx;
|
wal.x += dx;
|
||||||
wal.y += dy;
|
wal.y += dy;
|
||||||
|
|
||||||
nextsector = wal.nextsector;
|
if (wal.twoSided())
|
||||||
if (nextsector >= 0)
|
search.Add(wal.nextSector());
|
||||||
search.Add(nextsector);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TRAVERSE_CONNECT(pnum)
|
TRAVERSE_CONNECT(pnum)
|
||||||
{
|
{
|
||||||
PLAYERp pp = &Player[pnum];
|
PLAYERp pp = &Player[pnum];
|
||||||
unsigned dasect = pp->cursectnum;
|
auto dasect = pp->cursector();
|
||||||
search.Rewind();
|
search.Rewind();
|
||||||
for (unsigned itsect; (itsect = search.GetNext()) != BFSSearch::EOL;)
|
while (auto itsect = search.GetNext())
|
||||||
{
|
{
|
||||||
if (itsect == dasect)
|
if (itsect == dasect)
|
||||||
{
|
{
|
||||||
|
@ -1575,7 +1573,7 @@ void TraverseSectors(short start_sect)
|
||||||
{
|
{
|
||||||
int i, j, k;
|
int i, j, k;
|
||||||
short sectlist[M AXSECTORS];
|
short sectlist[M AXSECTORS];
|
||||||
short sectlistplc, sectlistend, sect, startwall, endwall, nextsector;
|
short sectlistplc, sectlistend, sect, startwall, endwall, nextSector;
|
||||||
|
|
||||||
sectlist[0] = start_sect;
|
sectlist[0] = start_sect;
|
||||||
sectlistplc = 0; sectlistend = 1;
|
sectlistplc = 0; sectlistend = 1;
|
||||||
|
@ -1588,21 +1586,21 @@ void TraverseSectors(short start_sect)
|
||||||
|
|
||||||
for (j=startwall; j<endwall; j++)
|
for (j=startwall; j<endwall; j++)
|
||||||
{
|
{
|
||||||
nextsector = wall[j].nextsector;
|
nextSector = wall[j].nextSector;
|
||||||
|
|
||||||
if (nextsector < 0)
|
if (nextSector < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// make sure its not on the list
|
// make sure its not on the list
|
||||||
for (k = sectlistend-1; k >= 0; k--)
|
for (k = sectlistend-1; k >= 0; k--)
|
||||||
{
|
{
|
||||||
if (sectlist[k] == nextsector)
|
if (sectlist[k] == nextSector)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if its not on the list add it to the end
|
// if its not on the list add it to the end
|
||||||
if (k < 0)
|
if (k < 0)
|
||||||
sectlist[sectlistend++] = nextsector;
|
sectlist[sectlistend++] = nextSector;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3509,16 +3509,20 @@ bool ActorTrackDecide(TRACK_POINTp tpoint, DSWActor* actor)
|
||||||
ActorLeaveTrack(actor);
|
ActorLeaveTrack(actor);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
auto wal = &wall[hit_wall];
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
if (wall[hit_wall].nextsector < 0)
|
if (wal->nextsector < 0)
|
||||||
{
|
{
|
||||||
I_Error("Take out white wall ladder x = %d, y = %d",wall[hit_wall].x, wall[hit_wall].y);
|
I_Error("Take out white wall ladder x = %d, y = %d",wal->x, wal->y);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// destination z for climbing
|
// destination z for climbing
|
||||||
u->sz = sector[wall[hit_wall].nextsector].floorz;
|
if (wal->twoSided())
|
||||||
|
u->sz = wal->nextSector()->floorz;
|
||||||
|
else
|
||||||
|
u->sz = wal->sectorp()->ceilingz; // don't crash on bad setups.
|
||||||
|
|
||||||
DoActorZrange(actor);
|
DoActorZrange(actor);
|
||||||
|
|
||||||
|
|
|
@ -7298,10 +7298,9 @@ short StatBreakList[] =
|
||||||
void TraverseBreakableWalls(short start_sect, int x, int y, int z, short ang, int radius)
|
void TraverseBreakableWalls(short start_sect, int x, int y, int z, short ang, int radius)
|
||||||
{
|
{
|
||||||
int k;
|
int k;
|
||||||
int sect, startwall, endwall, nextsector;
|
|
||||||
int xmid,ymid;
|
int xmid,ymid;
|
||||||
int dist;
|
int dist;
|
||||||
short break_count;
|
int break_count;
|
||||||
|
|
||||||
int sectnum;
|
int sectnum;
|
||||||
int wall_ang;
|
int wall_ang;
|
||||||
|
@ -7314,9 +7313,8 @@ void TraverseBreakableWalls(short start_sect, int x, int y, int z, short ang, in
|
||||||
|
|
||||||
break_count = 0;
|
break_count = 0;
|
||||||
|
|
||||||
|
BFSSectorSearch search(§or[start_sect]);
|
||||||
BFSSearch search(numsectors, start_sect);
|
while (auto sect = search.GetNext())
|
||||||
for (unsigned sect; (sect = search.GetNext()) != BFSSearch::EOL;)
|
|
||||||
{
|
{
|
||||||
for(auto& wal : wallsofsector(sect))
|
for(auto& wal : wallsofsector(sect))
|
||||||
{
|
{
|
||||||
|
@ -7348,10 +7346,8 @@ void TraverseBreakableWalls(short start_sect, int x, int y, int z, short ang, in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nextsector = wal.nextsector;
|
if (wal.twoSided())
|
||||||
|
search.Add(wal.nextSector());
|
||||||
if (nextsector >= 0)
|
|
||||||
search.Add(nextsector);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue