Port debug vision to a command
This commit is contained in:
parent
f931778b90
commit
4a1e4c599b
5 changed files with 12 additions and 8 deletions
|
|
@ -20,6 +20,7 @@ namespace devilution {
|
|||
|
||||
std::optional<CelSprite> 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<DebugCmdItem> DebugCmdList = {
|
|||
|
||||
void LoadDebugGFX()
|
||||
{
|
||||
if (visiondebug)
|
||||
pSquareCel = LoadCel("Data\\Square.CEL", 64);
|
||||
pSquareCel = LoadCel("Data\\Square.CEL", 64);
|
||||
}
|
||||
|
||||
void FreeDebugGFX()
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ namespace devilution {
|
|||
|
||||
extern std::optional<CelSprite> pSquareCel;
|
||||
extern bool DebugGodMode;
|
||||
extern bool DebugVision;
|
||||
|
||||
void FreeDebugGFX();
|
||||
void LoadDebugGFX();
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue