diff --git a/Source/debug.cpp b/Source/debug.cpp index 45566b02c..c18e295a2 100644 --- a/Source/debug.cpp +++ b/Source/debug.cpp @@ -20,6 +20,7 @@ namespace devilution { std::optional pSquareCel; bool DebugGodMode = false; +bool DebugVision = false; namespace { @@ -197,6 +198,14 @@ std::string DebugCmdGodMode(const std::string_view parameter) return "You are mortal, beware of the darkness."; } +std::string DebugCmdVision(const std::string_view parameter) +{ + DebugVision = !DebugVision; + if (DebugVision) + return "You see as i do."; + return "My path is set."; +} + std::string DebugCmdLevelUp(const std::string_view parameter) { int levels = std::max(1, atoi(parameter.data())); @@ -265,8 +274,7 @@ std::vector DebugCmdList = { void LoadDebugGFX() { - if (visiondebug) - pSquareCel = LoadCel("Data\\Square.CEL", 64); + pSquareCel = LoadCel("Data\\Square.CEL", 64); } void FreeDebugGFX() diff --git a/Source/debug.h b/Source/debug.h index 6932bcda6..a9ed007bd 100644 --- a/Source/debug.h +++ b/Source/debug.h @@ -15,6 +15,7 @@ namespace devilution { extern std::optional pSquareCel; extern bool DebugGodMode; +extern bool DebugVision; void FreeDebugGFX(); void LoadDebugGFX(); diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 40ef8b853..5e34306c1 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -101,7 +101,6 @@ bool gbForceWindowed = false; bool monstdebug = false; _monster_id DebugMonsters[10]; int debugmonsttypes = 0; -bool visiondebug = false; int questdebug = -1; bool debug_mode_key_inverted_v = false; bool debug_mode_key_i = false; @@ -858,7 +857,6 @@ void RunGameLoop(interface_mode uMsg) #ifdef _DEBUG printInConsole("\nDebug options:\n"); printInConsole(" %-20s %-30s\n", "-^", "Enable debug tools"); - printInConsole(" %-20s %-30s\n", "-v", "Highlight visibility"); printInConsole(" %-20s %-30s\n", "-i", "Ignore network timeout"); printInConsole(" %-20s %-30s\n", "-j <##>", "Mausoleum warps to given level"); printInConsole(" %-20s %-30s\n", "-m <##>", "Add debug monster, up to 10 allowed"); @@ -929,8 +927,6 @@ void DiabloParseFlags(int argc, char **argv) questdebug = SDL_atoi(argv[++i]); } else if (strcasecmp("-r", argv[i]) == 0) { setseed = SDL_atoi(argv[++i]); - } else if (strcasecmp("-v", argv[i]) == 0) { - visiondebug = true; #endif } else { printInConsole("%s", fmt::format(_("unrecognized option '{:s}'\n"), argv[i]).c_str()); diff --git a/Source/diablo.h b/Source/diablo.h index bb5119e22..262ede3ae 100644 --- a/Source/diablo.h +++ b/Source/diablo.h @@ -105,7 +105,6 @@ extern bool gbForceWindowed; extern bool monstdebug; extern _monster_id DebugMonsters[10]; extern int debugmonsttypes; -extern bool visiondebug; extern int questdebug; extern bool debug_mode_key_inverted_v; extern bool debug_mode_key_i; diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index acaa41efc..5ac8c9082 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -824,7 +824,7 @@ void DrawDungeon(const Surface &out, int sx, int sy, int dx, int dy) negMon = dMonster[sx][sy - 1]; #ifdef _DEBUG - if (visiondebug && (bFlag & BFLAG_LIT) != 0) { + if (DebugVision && (bFlag & BFLAG_LIT) != 0) { CelClippedDrawTo(out, { dx, dy }, *pSquareCel, 1); } #endif