diff --git a/source/core/gamecontrol.h b/source/core/gamecontrol.h index b6458b232..5748649c5 100644 --- a/source/core/gamecontrol.h +++ b/source/core/gamecontrol.h @@ -56,7 +56,13 @@ void CONFIG_ReadCombatMacros(); int GameMain(); int GetAutomapZoom(int gZoom); -inline void DrawOverheadMap(int x, int y, int ang) {} // transitional helper inline. + +// transitional helper inlines to define the interface before rewriting the code. +inline void ClearAutomap() {} +inline void MarkSectorSeen(int sect) {} +inline void DrawOverheadMap(int x, int y, int ang) {} + + void DrawCrosshair(int deftile, int health, double xdelta, double scale, PalEntry color = 0xffffffff); void updatePauseStatus(); void DeferedStartGame(MapRecord* map, int skill); diff --git a/source/exhumed/src/cheats.cpp b/source/exhumed/src/cheats.cpp index a5cdfb495..06cb41dda 100644 --- a/source/exhumed/src/cheats.cpp +++ b/source/exhumed/src/cheats.cpp @@ -136,8 +136,8 @@ static bool SnakeCheat(cheatseq_t* c) static bool SphereCheat(cheatseq_t* c) { Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_FULLMAP")); - GrabMap(); - bShowTowers = true; + gFullMap = !gFullMap; // only set the cheat flag so it can be toggled. + bShowTowers = gFullMap; return true; } diff --git a/source/exhumed/src/engine.h b/source/exhumed/src/engine.h index 57c184641..54a2c64b5 100644 --- a/source/exhumed/src/engine.h +++ b/source/exhumed/src/engine.h @@ -105,9 +105,7 @@ extern short nPalDiff; // map extern short bShowTowers; -extern int ldMapZoom; -void InitMap(); void GrabMap(); void UpdateMap(); void DrawMap(); diff --git a/source/exhumed/src/init.cpp b/source/exhumed/src/init.cpp index 7a09fe99e..5912407bf 100644 --- a/source/exhumed/src/init.cpp +++ b/source/exhumed/src/init.cpp @@ -102,7 +102,7 @@ uint8_t LoadLevel(int nMap) InitSnakes(); InitFishes(); InitLights(); - InitMap(); + ClearAutomap(); InitBubbles(); InitObjects(); InitLava(); diff --git a/source/exhumed/src/map.cpp b/source/exhumed/src/map.cpp index a81764f17..3594b4c68 100644 --- a/source/exhumed/src/map.cpp +++ b/source/exhumed/src/map.cpp @@ -27,19 +27,6 @@ BEGIN_PS_NS short bShowTowers = false; -int ldMapZoom; - -void MarkSectorSeen(short nSector); - - -void InitMap() -{ - show2dsector.Zero(); - memset(show2dwall, 0, sizeof(show2dwall)); - memset(show2dsprite, 0, sizeof(show2dsprite)); - - ldMapZoom = 64; -} void GrabMap() { @@ -48,24 +35,6 @@ void GrabMap() } } -void MarkSectorSeen(short nSector) -{ - if (!show2dsector[nSector]) - { - show2dsector.Set(nSector); - - short startwall = sector[nSector].wallptr; - short nWalls = sector[nSector].wallnum; - short endwall = startwall + nWalls; - - while (startwall <= endwall) - { - show2dwall[startwall >> 3] = (1 << (startwall & 7)) | show2dwall[startwall >> 3]; - startwall++; - } - } -} - void UpdateMap() { diff --git a/source/games/duke/src/game_misc.cpp b/source/games/duke/src/game_misc.cpp index 21720d285..ddd5b4f44 100644 --- a/source/games/duke/src/game_misc.cpp +++ b/source/games/duke/src/game_misc.cpp @@ -220,11 +220,9 @@ void V_AddBlend (float r, float g, float b, float a, float v_blend[4]) void drawoverlays(double smoothratio) { - int i, j; unsigned char fader = 0, fadeg = 0, fadeb = 0, fadef = 0, tintr = 0, tintg = 0, tintb = 0, tintf = 0, dotint = 0; struct player_struct* pp; - walltype* wal; int cposx, cposy, cang; pp = &ps[screenpeek]; @@ -247,20 +245,7 @@ void drawoverlays(double smoothratio) else videoclearFade(); - i = pp->cursectnum; - - if (i >= 0) show2dsector.Set(i); - wal = &wall[sector[i].wallptr]; - for (j = sector[i].wallnum; j > 0; j--, wal++) - { - i = wal->nextsector; - if (i < 0) continue; - if (wal->cstat & 0x0071) continue; - if (wall[wal->nextwall].cstat & 0x0071) continue; - if (sector[i].lotag == 32767) continue; - if (sector[i].ceilingz >= sector[i].floorz) continue; - show2dsector.Set(i); - } + MarkSectorSeen(pp->cursectnum); if (ud.camerasprite == -1) { diff --git a/source/games/duke/src/premap.cpp b/source/games/duke/src/premap.cpp index 740321101..a54d49ddf 100644 --- a/source/games/duke/src/premap.cpp +++ b/source/games/duke/src/premap.cpp @@ -688,10 +688,6 @@ void prelevel_common(int g) // RRRA E2L1 fog handling. fogactive = 0; - show2dsector.Zero(); - memset(show2dwall, 0, sizeof(show2dwall)); - memset(show2dsprite, 0, sizeof(show2dsprite)); - resetprestat(0, g); numclouds = 0;