mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-23 20:51:14 +00:00
add the view/set debug level command 'level' from the old debugger
svn-id: r6496
This commit is contained in:
parent
3faa561c47
commit
d591eb77f7
@ -17,6 +17,8 @@
|
||||
#define Debug_Printf printf
|
||||
#endif
|
||||
|
||||
extern uint16 _debugLevel;
|
||||
|
||||
ScummDebugger::ScummDebugger()
|
||||
{
|
||||
_s = 0;
|
||||
@ -62,6 +64,8 @@ void ScummDebugger::attach(Scumm *s)
|
||||
|
||||
DCmd_Register("loadgame", &ScummDebugger::Cmd_LoadGame);
|
||||
DCmd_Register("savegame", &ScummDebugger::Cmd_SaveGame);
|
||||
|
||||
DCmd_Register("level", &ScummDebugger::Cmd_DebugLevel);
|
||||
}
|
||||
}
|
||||
|
||||
@ -355,6 +359,30 @@ bool ScummDebugger::Cmd_PrintActor(int argc, const char **argv) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScummDebugger::Cmd_DebugLevel(int argc, const char **argv) {
|
||||
int level;
|
||||
|
||||
if (argc == 1) {
|
||||
if (_s->_debugMode == false)
|
||||
Debug_Printf("Debugging is not enabled at this time\n");
|
||||
else
|
||||
Debug_Printf("Debugging is currently set at level %d\n", _debugLevel);
|
||||
} else { // set level
|
||||
int level = atoi(argv[1]);
|
||||
_debugLevel = level;
|
||||
if (level > 0) {
|
||||
_s->_debugMode = true;
|
||||
Debug_Printf("Debug level set to level %d\n", level);
|
||||
} else if (level == 0) {
|
||||
_s->_debugMode = false;
|
||||
Debug_Printf("Debugging is now disabled\n");
|
||||
} else
|
||||
Debug_Printf("Not a valid debug level\n");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ScummDebugger::Cmd_PrintBox(int argc, const char **argv) {
|
||||
int num, i = 0;
|
||||
num = _s->getNumBoxes();
|
||||
|
@ -77,8 +77,10 @@ protected:
|
||||
bool Cmd_PrintBox(int argc, const char **argv);
|
||||
bool Cmd_Actor(int argc, const char **argv);
|
||||
|
||||
void printBox(int box);
|
||||
bool Cmd_DebugLevel(int argc, const char **argv);
|
||||
|
||||
void printBox(int box);
|
||||
|
||||
#ifdef USE_CONSOLE
|
||||
static bool debuggerInputCallback(ConsoleDialog *console, const char *input, void *refCon);
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user