aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2004-01-28 02:42:23 +0000
committerTravis Howell2004-01-28 02:42:23 +0000
commit7dd78f11d3cc5f50b1684b9e03fa13ab04908a68 (patch)
tree24102e13595ceda9dc03c7433f9ce8afacff3bf0 /simon
parenta72e72696834924835449f8b20103cfb776ecd4a (diff)
downloadscummvm-rg350-7dd78f11d3cc5f50b1684b9e03fa13ab04908a68.tar.gz
scummvm-rg350-7dd78f11d3cc5f50b1684b9e03fa13ab04908a68.tar.bz2
scummvm-rg350-7dd78f11d3cc5f50b1684b9e03fa13ab04908a68.zip
Use a few form scumm
svn-id: r12649
Diffstat (limited to 'simon')
-rw-r--r--simon/debugger.cpp26
-rw-r--r--simon/debugger.h1
2 files changed, 27 insertions, 0 deletions
diff --git a/simon/debugger.cpp b/simon/debugger.cpp
index dbebe9f89e..9a080e6248 100644
--- a/simon/debugger.cpp
+++ b/simon/debugger.cpp
@@ -24,15 +24,19 @@
#include "simon/debugger.h"
#include "simon/simon.h"
+extern uint16 g_debugLevel;
+
namespace Simon {
Debugger::Debugger(SimonEngine *vm)
: Common::Debugger<Debugger>() {
_vm = vm;
+ DCmd_Register("continue", &Debugger::Cmd_Exit);
DCmd_Register("exit", &Debugger::Cmd_Exit);
DCmd_Register("help", &Debugger::Cmd_Help);
DCmd_Register("quit", &Debugger::Cmd_Exit);
+ DCmd_Register("level", &Debugger::Cmd_DebugLevel);
DCmd_Register("music", &Debugger::Cmd_PlayMusic);
DCmd_Register("sound", &Debugger::Cmd_PlaySound);
DCmd_Register("voice", &Debugger::Cmd_PlayVoice);
@@ -79,6 +83,28 @@ bool Debugger::Cmd_Help(int argc, const char **argv) {
return true;
}
+bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
+ if (argc == 1) {
+ if (_vm->_debugMode == false)
+ DebugPrintf("Debugging is not enabled at this time\n");
+ else
+ DebugPrintf("Debugging is currently set at level %d\n", g_debugLevel);
+ } else { // set level
+ int level = atoi(argv[1]);
+ g_debugLevel = level;
+ if (level > 0 && level < 10) {
+ _vm->_debugMode = true;
+ DebugPrintf("Debug level set to level %d\n", level);
+ } else if (level == 0) {
+ _vm->_debugMode = false;
+ DebugPrintf("Debugging is now disabled\n");
+ } else
+ DebugPrintf("Not a valid debug level (0 - 10)\n");
+ }
+
+ return true;
+}
+
bool Debugger::Cmd_PlayMusic(int argc, const char **argv) {
if (argc > 1) {
uint music = atoi(argv[1]);
diff --git a/simon/debugger.h b/simon/debugger.h
index 4e80ba5386..f40baff455 100644
--- a/simon/debugger.h
+++ b/simon/debugger.h
@@ -40,6 +40,7 @@ protected:
bool Cmd_Exit(int argc, const char **argv);
bool Cmd_Help(int argc, const char **argv);
+ bool Cmd_DebugLevel(int argc, const char **argv);
bool Cmd_PlayMusic(int argc, const char **argv);
bool Cmd_PlaySound(int argc, const char **argv);
bool Cmd_PlayVoice(int argc, const char **argv);