Skip to content

Commit

Permalink
- MarkSectorSeen
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Dec 5, 2021
1 parent 83295b4 commit 963837d
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 19 deletions.
23 changes: 11 additions & 12 deletions source/core/automap.cpp
Expand Up @@ -293,21 +293,20 @@ void ClearAutomap()
//
//---------------------------------------------------------------------------

void MarkSectorSeen(int i)
void MarkSectorSeen(sectortype* sec)
{
if (validSectorIndex(i))
if (sec)
{
show2dsector.Set(i);
auto wal = &wall[sector[i].wallptr];
for (int j = sector[i].wallnum; j > 0; j--, wal++)
show2dsector.Set(sectnum(sec));
for (auto& wal : wallsofsector(sec))
{
i = wal->nextsector;
if (i < 0) continue;
if (wal->cstat & 0x0071) continue;
if (wal->nextWall()->cstat & 0x0071) continue;
if (sector[i].lotag == 32767) continue;
if (sector[i].ceilingz >= sector[i].floorz) continue;
show2dsector.Set(i);
if (!wal.twoSided()) continue;
if (wal.cstat & 0x0071) continue;
if (wal.nextWall()->cstat & 0x0071) continue;
auto osec = wal.nextSector();
if (osec->lotag == 32767) continue;
if (osec->ceilingz >= osec->floorz) continue;
show2dsector.Set(sectnum(osec));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/core/automap.h
Expand Up @@ -15,7 +15,7 @@ extern BitArray show2dwall;

void SerializeAutomap(FSerializer& arc);
void ClearAutomap();
void MarkSectorSeen(int sect);
void MarkSectorSeen(sectortype* sect);
void DrawOverheadMap(int x, int y, int ang, double const smoothratio);
bool AM_Responder(event_t* ev, bool last);
void drawlinergb(int32_t x1, int32_t y1, int32_t x2, int32_t y2, PalEntry p);
Expand Down
2 changes: 1 addition & 1 deletion source/games/duke/src/game_misc.cpp
Expand Up @@ -238,7 +238,7 @@ void drawoverlays(double smoothratio)
else
videoclearFade();

MarkSectorSeen(sectnum(pp->cursector));
MarkSectorSeen(pp->cursector);

if (ud.cameraactor == nullptr)
{
Expand Down
7 changes: 3 additions & 4 deletions source/games/exhumed/src/map.cpp
Expand Up @@ -32,16 +32,15 @@ bool bShowTowers = false;

void GrabMap()
{
for (int i = 0; i < numsectors; i++) {
MarkSectorSeen(i);
}
for(auto&sec : sectors())
MarkSectorSeen(&sec);
}


void UpdateMap()
{
if (initsectp->ceilingpal != 3 || (PlayerList[nLocalPlayer].nTorch != 0)) {
MarkSectorSeen(sectnum(initsectp));
MarkSectorSeen(initsectp);
}
}

Expand Down
2 changes: 1 addition & 1 deletion source/games/sw/src/draw.cpp
Expand Up @@ -1580,7 +1580,7 @@ drawscreen(PLAYERp pp, double smoothratio)
}


MarkSectorSeen(sectnum(pp->cursector));
MarkSectorSeen(pp->cursector);

if ((automapMode != am_off) && pp == Player+myconnectindex)
{
Expand Down

0 comments on commit 963837d

Please sign in to comment.