aboutsummaryrefslogtreecommitdiff
path: root/engines/simon
diff options
context:
space:
mode:
authorMax Horn2006-09-16 16:58:27 +0000
committerMax Horn2006-09-16 16:58:27 +0000
commit919092e5fcd0389b4cbd862e9e8cceab202e6741 (patch)
tree7d9c8f643191812bb1eb24f2e7cc2e67586149d5 /engines/simon
parent1add07becae0179e026a90924b419b74ffb1078f (diff)
downloadscummvm-rg350-919092e5fcd0389b4cbd862e9e8cceab202e6741.tar.gz
scummvm-rg350-919092e5fcd0389b4cbd862e9e8cceab202e6741.tar.bz2
scummvm-rg350-919092e5fcd0389b4cbd862e9e8cceab202e6741.zip
Overhaul of the debugger code
* Moved Common::Debuggger to GUI::Debugger (mainly to satisfy linker restrictions) * Change the base Debugger class to *not* be a template class anymore; instead, a thin (template based) wrapper class is used to hook up debugger commands * Removed duplicate Cmd_Exit and Cmd_Help methods in favor of a single version of each in GUI::Debugger * New Cmd_Help doesn't word wrap after 39/78 chars, but rather queries the console to determine when to wrap * Debugger::preEnter and postEnter aren't pure virtual anymore svn-id: r23890
Diffstat (limited to 'engines/simon')
-rw-r--r--engines/simon/debugger.cpp48
-rw-r--r--engines/simon/debugger.h6
2 files changed, 11 insertions, 43 deletions
diff --git a/engines/simon/debugger.cpp b/engines/simon/debugger.cpp
index 5f3ac44be8..7e2694966a 100644
--- a/engines/simon/debugger.cpp
+++ b/engines/simon/debugger.cpp
@@ -24,7 +24,6 @@
#include "common/stdafx.h"
#include "common/config-manager.h"
-#include "common/debugger.cpp"
#include "simon/debugger.h"
#include "simon/simon.h"
@@ -32,20 +31,17 @@
namespace Simon {
Debugger::Debugger(SimonEngine *vm)
- : Common::Debugger<Debugger>() {
+ : GUI::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);
- DCmd_Register("bit", &Debugger::Cmd_SetBit);
- DCmd_Register("var", &Debugger::Cmd_SetVar);
- DCmd_Register("sub", &Debugger::Cmd_StartSubroutine);
+ DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit));
+ DCmd_Register("level", WRAP_METHOD(Debugger, Cmd_DebugLevel));
+ DCmd_Register("music", WRAP_METHOD(Debugger, Cmd_PlayMusic));
+ DCmd_Register("sound", WRAP_METHOD(Debugger, Cmd_PlaySound));
+ DCmd_Register("voice", WRAP_METHOD(Debugger, Cmd_PlayVoice));
+ DCmd_Register("bit", WRAP_METHOD(Debugger, Cmd_SetBit));
+ DCmd_Register("var", WRAP_METHOD(Debugger, Cmd_SetVar));
+ DCmd_Register("sub", WRAP_METHOD(Debugger, Cmd_StartSubroutine));
}
@@ -60,32 +56,6 @@ void Debugger::postEnter() {
}
-bool Debugger::Cmd_Exit(int argc, const char **argv) {
- _detach_now = true;
- return false;
-}
-
-bool Debugger::Cmd_Help(int argc, const char **argv) {
- // console normally has 39 line width
- // wrap around nicely
- int width = 0, size, i;
-
- DebugPrintf("Commands are:\n");
- for (i = 0 ; i < _dcmd_count ; i++) {
- size = strlen(_dcmds[i].name) + 1;
-
- if ((width + size) >= 39) {
- DebugPrintf("\n");
- width = size;
- } else
- width += size;
-
- DebugPrintf("%s ", _dcmds[i].name);
- }
- DebugPrintf("\n");
- return true;
-}
-
bool Debugger::Cmd_DebugLevel(int argc, const char **argv) {
if (argc == 1) {
if (_vm->_debugMode == false)
diff --git a/engines/simon/debugger.h b/engines/simon/debugger.h
index bfb2183e13..2c8e28d20e 100644
--- a/engines/simon/debugger.h
+++ b/engines/simon/debugger.h
@@ -24,13 +24,13 @@
#ifndef SIMON_DEBUGGER_H
#define SIMON_DEBUGGER_H
-#include "common/debugger.h"
+#include "gui/debugger.h"
namespace Simon {
class SimonEngine;
-class Debugger : public Common::Debugger<Debugger> {
+class Debugger : public GUI::Debugger {
public:
Debugger(SimonEngine *vm);
virtual ~Debugger() {} // we need this for __SYMBIAN32__ archaic gcc/UIQ
@@ -41,8 +41,6 @@ protected:
virtual void preEnter();
virtual void postEnter();
- 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);