- cleaned out the remaining parts of automap handling in Duke and Exhumed.

This commit is contained in:
Christoph Oelckers 2020-09-06 10:42:39 +02:00
parent df6d480519
commit 8f6f368445
7 changed files with 11 additions and 57 deletions

View file

@ -56,7 +56,13 @@ void CONFIG_ReadCombatMacros();
int GameMain(); int GameMain();
int GetAutomapZoom(int gZoom); 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 DrawCrosshair(int deftile, int health, double xdelta, double scale, PalEntry color = 0xffffffff);
void updatePauseStatus(); void updatePauseStatus();
void DeferedStartGame(MapRecord* map, int skill); void DeferedStartGame(MapRecord* map, int skill);

View file

@ -136,8 +136,8 @@ static bool SnakeCheat(cheatseq_t* c)
static bool SphereCheat(cheatseq_t* c) static bool SphereCheat(cheatseq_t* c)
{ {
Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_FULLMAP")); Printf(PRINT_NOTIFY, "%s\n", GStrings("TXT_EX_FULLMAP"));
GrabMap(); gFullMap = !gFullMap; // only set the cheat flag so it can be toggled.
bShowTowers = true; bShowTowers = gFullMap;
return true; return true;
} }

View file

@ -105,9 +105,7 @@ extern short nPalDiff;
// map // map
extern short bShowTowers; extern short bShowTowers;
extern int ldMapZoom;
void InitMap();
void GrabMap(); void GrabMap();
void UpdateMap(); void UpdateMap();
void DrawMap(); void DrawMap();

View file

@ -102,7 +102,7 @@ uint8_t LoadLevel(int nMap)
InitSnakes(); InitSnakes();
InitFishes(); InitFishes();
InitLights(); InitLights();
InitMap(); ClearAutomap();
InitBubbles(); InitBubbles();
InitObjects(); InitObjects();
InitLava(); InitLava();

View file

@ -27,19 +27,6 @@ BEGIN_PS_NS
short bShowTowers = false; 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() 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() void UpdateMap()
{ {

View file

@ -220,11 +220,9 @@ void V_AddBlend (float r, float g, float b, float a, float v_blend[4])
void drawoverlays(double smoothratio) 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; unsigned char fader = 0, fadeg = 0, fadeb = 0, fadef = 0, tintr = 0, tintg = 0, tintb = 0, tintf = 0, dotint = 0;
struct player_struct* pp; struct player_struct* pp;
walltype* wal;
int cposx, cposy, cang; int cposx, cposy, cang;
pp = &ps[screenpeek]; pp = &ps[screenpeek];
@ -247,20 +245,7 @@ void drawoverlays(double smoothratio)
else else
videoclearFade(); videoclearFade();
i = pp->cursectnum; MarkSectorSeen(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);
}
if (ud.camerasprite == -1) if (ud.camerasprite == -1)
{ {

View file

@ -688,10 +688,6 @@ void prelevel_common(int g)
// RRRA E2L1 fog handling. // RRRA E2L1 fog handling.
fogactive = 0; fogactive = 0;
show2dsector.Zero();
memset(show2dwall, 0, sizeof(show2dwall));
memset(show2dsprite, 0, sizeof(show2dsprite));
resetprestat(0, g); resetprestat(0, g);
numclouds = 0; numclouds = 0;