♻️Clean up automap code

Use Point for x,y pairs. Make helpers for drawing door and squares
This commit is contained in:
Anders Jenbo 2021-05-02 12:45:21 +02:00
commit 654a2b8834
17 changed files with 416 additions and 458 deletions

View file

@ -682,7 +682,7 @@ void DoVision(int nXPos, int nYPos, int nRadius, bool doautomap, bool visible)
if (nXPos >= 0 && nXPos <= MAXDUNX && nYPos >= 0 && nYPos <= MAXDUNY) {
if (doautomap) {
if (dFlags[nXPos][nYPos] >= 0) {
SetAutomapView(nXPos, nYPos);
SetAutomapView({ nXPos, nYPos });
}
dFlags[nXPos][nYPos] |= BFLAG_EXPLORED;
}
@ -743,7 +743,7 @@ void DoVision(int nXPos, int nYPos, int nRadius, bool doautomap, bool visible)
&& !nBlockTable[dPiece[x2adj + nCrawlX][y2adj + nCrawlY]])) {
if (doautomap) {
if (dFlags[nCrawlX][nCrawlY] >= 0) {
SetAutomapView(nCrawlX, nCrawlY);
SetAutomapView({ nCrawlX, nCrawlY });
}
dFlags[nCrawlX][nCrawlY] |= BFLAG_EXPLORED;
}