From abeaa75c5f4891aba6f776ca7ad8f0fc43cf0522 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 30 Apr 2019 21:11:45 +0200 Subject: [PATCH] Clean up automap.cpp --- Source/automap.cpp | 46 ++++++++++++++++++++++------------------------ Source/automap.h | 18 +++++++++--------- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/Source/automap.cpp b/Source/automap.cpp index ed9829473..e32cf790c 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -4,17 +4,17 @@ WORD automaptype[512]; static int MapX; static int MapY; -BOOL automapflag; // idb +BOOL automapflag; char AmShiftTab[32]; // [31]? unsigned char automapview[DMAXX][DMAXY]; -int AutoMapScale; // idb -int AutoMapXOfs; // weak -int AutoMapYOfs; // weak -int AutoMapPosBits; // weak -int AutoMapXPos; // weak -int AutoMapYPos; // weak -int AMPlayerX; // weak -int AMPlayerY; // weak +int AutoMapScale; +int AutoMapXOfs; +int AutoMapYOfs; +int AutoMapPosBits; +int AutoMapXPos; +int AutoMapYPos; +int AMPlayerX; +int AMPlayerY; // color used to draw the player's arrow #define COLOR_PLAYER (PAL8_ORANGE + 1) @@ -47,10 +47,10 @@ void InitAutomapOnce() void InitAutomap() { - unsigned char b1, b2; - unsigned int dwTiles; + BYTE b1, b2; + DWORD dwTiles; int x, y; - unsigned char *pAFile, *pTmp; + BYTE *pAFile, *pTmp; int i, j; int d; @@ -115,26 +115,26 @@ void StartAutomap() void AutomapUp() { - --AutoMapXOfs; - --AutoMapYOfs; + AutoMapXOfs--; + AutoMapYOfs--; } void AutomapDown() { - ++AutoMapXOfs; - ++AutoMapYOfs; + AutoMapXOfs++; + AutoMapYOfs++; } void AutomapLeft() { - --AutoMapXOfs; - ++AutoMapYOfs; + AutoMapXOfs--; + AutoMapYOfs++; } void AutomapRight() { - ++AutoMapXOfs; - --AutoMapYOfs; + AutoMapXOfs++; + AutoMapYOfs--; } void AutomapZoomIn() @@ -245,8 +245,6 @@ void DrawAutomap() DrawAutomapPlr(); DrawAutomapGame(); } -// 4B8968: using guessed type int sbookflag; -// 69CF0C: using guessed type int gpBufEnd; void DrawAutomapType(int sx, int sy, WORD automap_type) { @@ -536,8 +534,8 @@ WORD GetAutomapType(int x, int y, BOOL view) rv = automaptype[(BYTE)dungeon[x][y]]; if (rv == 7 - && GetAutomapType(x - 1, y, FALSE) & (MAPFLAG_HORZARCH << 8) - && GetAutomapType(x, y - 1, FALSE) & (MAPFLAG_VERTARCH << 8)) { + && GetAutomapType(x - 1, y, FALSE) & (MAPFLAG_HORZARCH << 8) + && GetAutomapType(x, y - 1, FALSE) & (MAPFLAG_VERTARCH << 8)) { rv = 1; } return rv; diff --git a/Source/automap.h b/Source/automap.h index 5f7b6cb0b..0d8a1e374 100644 --- a/Source/automap.h +++ b/Source/automap.h @@ -3,17 +3,17 @@ #define __AUTOMAP_H__ extern WORD automaptype[512]; -extern BOOL automapflag; // idb +extern BOOL automapflag; extern char AmShiftTab[32]; extern unsigned char automapview[DMAXX][DMAXY]; -extern int AutoMapScale; // idb -extern int AutoMapXOfs; // weak -extern int AutoMapYOfs; // weak -extern int AutoMapPosBits; // weak -extern int AutoMapXPos; // weak -extern int AutoMapYPos; // weak -extern int AMPlayerX; // weak -extern int AMPlayerY; // weak +extern int AutoMapScale; +extern int AutoMapXOfs; +extern int AutoMapYOfs; +extern int AutoMapPosBits; +extern int AutoMapXPos; +extern int AutoMapYPos; +extern int AMPlayerX; +extern int AMPlayerY; void InitAutomapOnce(); void InitAutomap();