aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Turner2010-11-08 12:24:18 +0000
committerDavid Turner2010-11-08 12:24:18 +0000
commit71d0526834f5903c28b83942d4cd50d413183c9b (patch)
treec3980143344d2c007bb6735114afe82ad4866137
parentcb734285a50af24dd0453ab292855f038e936acf (diff)
downloadscummvm-rg350-71d0526834f5903c28b83942d4cd50d413183c9b.tar.gz
scummvm-rg350-71d0526834f5903c28b83942d4cd50d413183c9b.tar.bz2
scummvm-rg350-71d0526834f5903c28b83942d4cd50d413183c9b.zip
TUCKER: Added basic debugging console to engine
Tucker does not currently use Debug Channels, but this does provide a base for adding them along with any other debugging commands. svn-id: r54141
-rw-r--r--engines/tucker/console.cpp43
-rw-r--r--engines/tucker/console.h50
-rw-r--r--engines/tucker/module.mk1
-rw-r--r--engines/tucker/tucker.cpp8
-rw-r--r--engines/tucker/tucker.h5
5 files changed, 107 insertions, 0 deletions
diff --git a/engines/tucker/console.cpp b/engines/tucker/console.cpp
new file mode 100644
index 0000000000..f06fd8fddb
--- /dev/null
+++ b/engines/tucker/console.cpp
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "tucker/console.h"
+#include "tucker/tucker.h"
+
+namespace Tucker {
+
+TuckerConsole::TuckerConsole(TuckerEngine *vm) : GUI::Debugger(), _vm(vm) {
+}
+
+TuckerConsole::~TuckerConsole() {
+}
+
+void TuckerConsole::preEnter() {
+}
+
+void TuckerConsole::postEnter() {
+}
+
+} // End of namespace Tucker
diff --git a/engines/tucker/console.h b/engines/tucker/console.h
new file mode 100644
index 0000000000..2449fa3279
--- /dev/null
+++ b/engines/tucker/console.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef TUCKER_CONSOLE_H
+#define TUCKER_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Tucker {
+
+class TuckerEngine;
+
+class TuckerConsole : public GUI::Debugger {
+public:
+ TuckerConsole(TuckerEngine *vm);
+ virtual ~TuckerConsole(void);
+
+protected:
+ virtual void preEnter();
+ virtual void postEnter();
+
+private:
+ TuckerEngine *_vm;
+};
+
+} // End of namespace Tucker
+
+#endif
diff --git a/engines/tucker/module.mk b/engines/tucker/module.mk
index 4847fdc3ec..d11c68b746 100644
--- a/engines/tucker/module.mk
+++ b/engines/tucker/module.mk
@@ -1,6 +1,7 @@
MODULE := engines/tucker
MODULE_OBJS := \
+ console.o \
detection.o \
graphics.o \
locations.o \
diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp
index c86991ab1b..2b9b4edee4 100644
--- a/engines/tucker/tucker.cpp
+++ b/engines/tucker/tucker.cpp
@@ -38,9 +38,11 @@ namespace Tucker {
TuckerEngine::TuckerEngine(OSystem *system, Common::Language language, uint32 flags)
: Engine(system), _gameLang(language), _gameFlags(flags) {
+ _console = new TuckerConsole(this);
}
TuckerEngine::~TuckerEngine() {
+ delete _console;
}
bool TuckerEngine::hasFeature(EngineFeature f) const {
@@ -628,6 +630,12 @@ void TuckerEngine::parseEvents() {
case Common::KEYCODE_ESCAPE:
_inputKeys[kInputKeyEscape] = true;
break;
+ case Common::KEYCODE_d:
+ if (ev.kbd.hasFlags(Common::KBD_CTRL)) {
+ this->getDebugger()->attach();
+ this->getDebugger()->onFrame();
+ }
+ break;
default:
break;
}
diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h
index de7042386b..a7d7f1cdd4 100644
--- a/engines/tucker/tucker.h
+++ b/engines/tucker/tucker.h
@@ -39,6 +39,8 @@
#include "engines/engine.h"
+#include "tucker/console.h"
+
/**
* This is the namespace of the Tucker engine.
*
@@ -275,6 +277,7 @@ public:
virtual Common::Error run();
virtual bool hasFeature(EngineFeature f) const;
virtual void syncSoundSettings();
+ GUI::Debugger *getDebugger() { return _console; }
protected:
@@ -566,6 +569,8 @@ protected:
virtual bool canLoadGameStateCurrently();
virtual bool canSaveGameStateCurrently();
+ TuckerConsole *_console;
+
void handleIntroSequence();
void handleCreditsSequence();
void handleCongratulationsSequence();