aboutsummaryrefslogtreecommitdiff
path: root/engines/cine
diff options
context:
space:
mode:
authorDavid Turner2010-11-07 15:02:41 +0000
committerDavid Turner2010-11-07 15:02:41 +0000
commit0119a659b5352ba284a7bff0afefa4d2bf054ac3 (patch)
tree8bfd821b8a6a18a713839d0c39a7c144b836aed7 /engines/cine
parentf452fe82ad107039ca578b86c97fc781e73f2761 (diff)
downloadscummvm-rg350-0119a659b5352ba284a7bff0afefa4d2bf054ac3.tar.gz
scummvm-rg350-0119a659b5352ba284a7bff0afefa4d2bf054ac3.tar.bz2
scummvm-rg350-0119a659b5352ba284a7bff0afefa4d2bf054ac3.zip
CINE: Added basic debugging console to engine
Since CINE uses Debug Channels, this allows for the interactive setting of debugflags as well as providing a base for adding further debugging commands. svn-id: r54115
Diffstat (limited to 'engines/cine')
-rw-r--r--engines/cine/cine.cpp3
-rw-r--r--engines/cine/cine.h6
-rw-r--r--engines/cine/console.cpp43
-rw-r--r--engines/cine/console.h50
-rw-r--r--engines/cine/main_loop.cpp6
-rw-r--r--engines/cine/module.mk1
6 files changed, 109 insertions, 0 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index 5c2119c1e4..38a0eda13e 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -56,6 +56,7 @@ CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Eng
DebugMan.addDebugChannel(kCineDebugScript, "Script", "Script debug level");
DebugMan.addDebugChannel(kCineDebugPart, "Part", "Part debug level");
DebugMan.addDebugChannel(kCineDebugSound, "Sound", "Sound debug level");
+ _console = new CineConsole(this);
// Setup mixer
_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
@@ -74,7 +75,9 @@ CineEngine::~CineEngine() {
if (getGameType() == Cine::GType_OS) {
freeErrmessDat();
}
+
DebugMan.clearAllDebugChannels();
+ delete _console;
}
Common::Error CineEngine::run() {
diff --git a/engines/cine/cine.h b/engines/cine/cine.h
index cab6b92a5d..dd00d9b206 100644
--- a/engines/cine/cine.h
+++ b/engines/cine/cine.h
@@ -49,6 +49,7 @@
#include "cine/anim.h"
#include "cine/bg_list.h"
#include "cine/various.h"
+#include "cine/console.h"
//#define DUMP_SCRIPTS
@@ -99,6 +100,8 @@ struct SeqListElement;
typedef Common::HashMap<Common::String, const char *> StringPtrHashMap;
+class CineConsole;
+
class CineEngine : public Engine {
protected:
@@ -137,6 +140,8 @@ public:
StringPtrHashMap _volumeEntriesMap;
TextHandler _textHandler;
+ GUI::Debugger *getDebugger() { return _console; }
+
bool _restartRequested;
private:
@@ -151,6 +156,7 @@ private:
void mainLoop(int bootScriptIdx);
void readVolCnf();
+ CineConsole *_console;
bool _preLoad;
int _timerDelayMultiplier;
diff --git a/engines/cine/console.cpp b/engines/cine/console.cpp
new file mode 100644
index 0000000000..87633a2644
--- /dev/null
+++ b/engines/cine/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 "cine/console.h"
+#include "cine/cine.h"
+
+namespace Cine {
+
+CineConsole::CineConsole(CineEngine *vm) : GUI::Debugger(), _vm(vm) {
+}
+
+CineConsole::~CineConsole() {
+}
+
+void CineConsole::preEnter() {
+}
+
+void CineConsole::postEnter() {
+}
+
+} // End of namespace Cine
diff --git a/engines/cine/console.h b/engines/cine/console.h
new file mode 100644
index 0000000000..256ec16ce6
--- /dev/null
+++ b/engines/cine/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 CINE_CONSOLE_H
+#define CINE_CONSOLE_H
+
+#include "gui/debugger.h"
+
+namespace Cine {
+
+class CineEngine;
+
+class CineConsole : public GUI::Debugger {
+public:
+ CineConsole(CineEngine *vm);
+ virtual ~CineConsole(void);
+
+protected:
+ virtual void preEnter();
+ virtual void postEnter();
+
+private:
+ CineEngine *_vm;
+};
+
+} // End of namespace Cine
+
+#endif
diff --git a/engines/cine/main_loop.cpp b/engines/cine/main_loop.cpp
index 3d280c20ef..644744d3ed 100644
--- a/engines/cine/main_loop.cpp
+++ b/engines/cine/main_loop.cpp
@@ -161,6 +161,12 @@ static void processEvent(Common::Event &event) {
case Common::KEYCODE_KP3:
moveUsingKeyboard(+1, -1); // Down & Right
break;
+ case Common::KEYCODE_d:
+ if (event.kbd.hasFlags(Common::KBD_CTRL)) {
+ g_cine->getDebugger()->attach();
+ g_cine->getDebugger()->onFrame();
+ }
+ // No Break to allow fallthrough to process 'd' without CTRL
default:
lastKeyStroke = event.kbd.keycode;
break;
diff --git a/engines/cine/module.mk b/engines/cine/module.mk
index 2260524dcb..6e77449c59 100644
--- a/engines/cine/module.mk
+++ b/engines/cine/module.mk
@@ -4,6 +4,7 @@ MODULE_OBJS := \
anim.o \
bg.o \
bg_list.o \
+ console.o \
cine.o \
detection.o \
gfx.o \