diff options
author | Jonathan Gray | 2003-01-18 14:51:06 +0000 |
---|---|---|
committer | Jonathan Gray | 2003-01-18 14:51:06 +0000 |
commit | d591eb77f7f9dea14c56f0e28a9f7adda8550877 (patch) | |
tree | ce654a8d1eeb713f0d157faadfe1cc91ba1e5fe3 /scumm/debugger.cpp | |
parent | 3faa561c47088cb7678ae6ed35c1e7005122af61 (diff) | |
download | scummvm-rg350-d591eb77f7f9dea14c56f0e28a9f7adda8550877.tar.gz scummvm-rg350-d591eb77f7f9dea14c56f0e28a9f7adda8550877.tar.bz2 scummvm-rg350-d591eb77f7f9dea14c56f0e28a9f7adda8550877.zip |
add the view/set debug level command 'level' from the old debugger
svn-id: r6496
Diffstat (limited to 'scumm/debugger.cpp')
-rw-r--r-- | scumm/debugger.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 1495ecf528..847f6a8d29 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -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(); |