aboutsummaryrefslogtreecommitdiff
path: root/engines/made
diff options
context:
space:
mode:
authorDavid Turner2010-11-08 12:17:19 +0000
committerDavid Turner2010-11-08 12:17:19 +0000
commitc76f0c6c022766a2db7e96e3e68260d3b9bd7a25 (patch)
tree53274d387959460cd089424c8be63c2328f29970 /engines/made
parent416025cda90f23ea5b94c88dcea0c202df279223 (diff)
downloadscummvm-rg350-c76f0c6c022766a2db7e96e3e68260d3b9bd7a25.tar.gz
scummvm-rg350-c76f0c6c022766a2db7e96e3e68260d3b9bd7a25.tar.bz2
scummvm-rg350-c76f0c6c022766a2db7e96e3e68260d3b9bd7a25.zip
MADE: Added basic debugging console to engine
MADE does not currently use Debug Channels, but this does provide a base for adding them along with any other debugging commands. svn-id: r54139
Diffstat (limited to 'engines/made')
-rw-r--r--engines/made/console.cpp43
-rw-r--r--engines/made/console.h50
-rw-r--r--engines/made/made.cpp9
-rw-r--r--engines/made/made.h4
-rw-r--r--engines/made/module.mk1
5 files changed, 107 insertions, 0 deletions
diff --git a/engines/made/console.cpp b/engines/made/console.cpp
new file mode 100644
index 0000000000..ee85c465e8
--- /dev/null
+++ b/engines/made/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 "made/console.h"
+#include "made/made.h"
+
+namespace Made {
+
+MadeConsole::MadeConsole(MadeEngine *vm) : GUI::Debugger(), _vm(vm) {
+}
+
+MadeConsole::~MadeConsole() {
+}
+
+void MadeConsole::preEnter() {
+}
+
+void MadeConsole::postEnter() {
+}
+
+} // End of namespace Made
diff --git a/engines/made/console.h b/engines/made/console.h
new file mode 100644
index 0000000000..9f4632b986
--- /dev/null
+++ b/engines/made/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 MADE_CONSOLE_H
+#define MADE_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Made {
+
+class MadeEngine;
+
+class MadeConsole : public GUI::Debugger {
+public:
+ MadeConsole(MadeEngine *vm);
+ virtual ~MadeConsole(void);
+
+protected:
+ virtual void preEnter();
+ virtual void postEnter();
+
+private:
+ MadeEngine *_vm;
+};
+
+} // End of namespace Made
+
+#endif
diff --git a/engines/made/made.cpp b/engines/made/made.cpp
index 51cdd83b2a..1fc3982d1e 100644
--- a/engines/made/made.cpp
+++ b/engines/made/made.cpp
@@ -79,6 +79,8 @@ MadeEngine::MadeEngine(OSystem *syst, const MadeGameDescription *gameDesc) : Eng
_rnd = new Common::RandomSource();
g_eventRec.registerRandomSource(*_rnd, "made");
+ _console = new MadeConsole(this);
+
int cd_num = ConfMan.getInt("cdrom");
if (cd_num >= 0)
_system->openCD(cd_num);
@@ -133,6 +135,7 @@ MadeEngine::~MadeEngine() {
AudioCD.stop();
delete _rnd;
+ delete _console;
delete _pmvPlayer;
delete _res;
delete _screen;
@@ -234,6 +237,12 @@ void MadeEngine::handleEvents() {
if (_eventKey == Common::KEYCODE_BACKSPACE)
_eventKey = 9;
_eventNum = 5;
+
+ // Check for Debugger Activation
+ if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_d) {
+ this->getDebugger()->attach();
+ this->getDebugger()->onFrame();
+ }
break;
default:
diff --git a/engines/made/made.h b/engines/made/made.h
index ed391562c3..290e3e648a 100644
--- a/engines/made/made.h
+++ b/engines/made/made.h
@@ -47,6 +47,7 @@
#include "engines/engine.h"
#include "made/sound.h"
+#include "made/console.h"
/**
* This is the namespace of the Made engine.
@@ -101,6 +102,8 @@ public:
virtual bool hasFeature(EngineFeature f) const;
virtual void syncSoundSettings();
+ GUI::Debugger *getDebugger() { return _console; }
+
int getGameId() {
return _gameId;
}
@@ -113,6 +116,7 @@ public:
Common::Platform getPlatform() const;
private:
+ MadeConsole *_console;
public:
PmvPlayer *_pmvPlayer;
ResourceReader *_res;
diff --git a/engines/made/module.mk b/engines/made/module.mk
index 78c906b288..d8c0c9eeb5 100644
--- a/engines/made/module.mk
+++ b/engines/made/module.mk
@@ -1,6 +1,7 @@
MODULE := engines/made
MODULE_OBJS := \
+ console.o \
database.o \
detection.o \
graphics.o \