- MarkSectorSeen

This commit is contained in:
Christoph Oelckers 2021-12-02 01:05:07 +01:00
parent f9b1164747
commit 5dfc79bdbe
5 changed files with 17 additions and 19 deletions

View file

@ -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));
}
}
}

View file

@ -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);

View file

@ -238,7 +238,7 @@ void drawoverlays(double smoothratio)
else
videoclearFade();
MarkSectorSeen(sectnum(pp->cursector));
MarkSectorSeen(pp->cursector);
if (ud.cameraactor == nullptr)
{

View file

@ -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);
}
}

View file

@ -1580,7 +1580,7 @@ drawscreen(PLAYERp pp, double smoothratio)
}
MarkSectorSeen(sectnum(pp->cursector));
MarkSectorSeen(pp->cursector);
if ((automapMode != am_off) && pp == Player+myconnectindex)
{