aboutsummaryrefslogtreecommitdiff
path: root/engines/fullpipe
diff options
context:
space:
mode:
authorD G Turner2013-12-07 00:16:56 +0000
committerD G Turner2013-12-07 00:16:56 +0000
commit4e849da06d9e68f5fb7da5df3123f7c620ad886b (patch)
tree358f282848bbfee514734060462a3df3fa80dc80 /engines/fullpipe
parent907c053fcab39b0601d9f92b33d994a4503de9a6 (diff)
downloadscummvm-rg350-4e849da06d9e68f5fb7da5df3123f7c620ad886b.tar.gz
scummvm-rg350-4e849da06d9e68f5fb7da5df3123f7c620ad886b.tar.bz2
scummvm-rg350-4e849da06d9e68f5fb7da5df3123f7c620ad886b.zip
FULLPIPE: Add debug console.
Diffstat (limited to 'engines/fullpipe')
-rw-r--r--engines/fullpipe/console.cpp31
-rw-r--r--engines/fullpipe/console.h40
-rw-r--r--engines/fullpipe/fullpipe.cpp10
-rw-r--r--engines/fullpipe/fullpipe.h6
-rw-r--r--engines/fullpipe/module.mk1
5 files changed, 88 insertions, 0 deletions
diff --git a/engines/fullpipe/console.cpp b/engines/fullpipe/console.cpp
new file mode 100644
index 0000000000..587f3dc6e6
--- /dev/null
+++ b/engines/fullpipe/console.cpp
@@ -0,0 +1,31 @@
+/* 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.
+ *
+ */
+
+#include "fullpipe/fullpipe.h"
+
+namespace Fullpipe {
+
+Console::Console(FullpipeEngine *vm) : GUI::Debugger() {
+ _vm = vm;
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/console.h b/engines/fullpipe/console.h
new file mode 100644
index 0000000000..9c03081b2b
--- /dev/null
+++ b/engines/fullpipe/console.h
@@ -0,0 +1,40 @@
+/* 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.
+ *
+ */
+
+#ifndef FULLPIPE_CONSOLE_H
+#define FULLPIPE_CONSOLE_H
+
+namespace Fullpipe {
+
+class FullpipeEngine;
+
+class Console : public GUI::Debugger {
+public:
+ Console(FullpipeEngine *vm);
+
+private:
+ FullpipeEngine *_vm;
+};
+
+} // End of namespace Fullpipe
+
+#endif /* FULLPIPE_CONSOLE_H */
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 7dedaf3109..a254ea642d 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -35,6 +35,7 @@
#include "fullpipe/input.h"
#include "fullpipe/scenes.h"
#include "fullpipe/floaters.h"
+#include "fullpipe/console.h"
namespace Fullpipe {
@@ -51,6 +52,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
_rnd = new Common::RandomSource("fullpipe");
+ _console = 0;
_gameProjectVersion = 0;
_pictureScale = 8;
@@ -152,6 +154,7 @@ FullpipeEngine::FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc)
FullpipeEngine::~FullpipeEngine() {
delete _rnd;
+ delete _console;
delete _globalMessageQueueList;
}
@@ -174,6 +177,8 @@ Common::Error FullpipeEngine::run() {
_backgroundSurface.create(800, 600, format);
+ _console = new Console(this);
+
initialize();
_isSaveAllowed = false;
@@ -272,6 +277,11 @@ void FullpipeEngine::updateEvents() {
return;
break;
default:
+ if (event.kbd.keycode == Common::KEYCODE_d && event.kbd.hasFlags(Common::KBD_CTRL)) {
+ // Start the debugger
+ getDebugger()->attach();
+ getDebugger()->onFrame();
+ }
ex = new ExCommand(0, 17, 36, 0, 0, 0, 1, 0, 0, 0);
ex->_keyCode = event.kbd.keycode;
ex->_excFlags |= 3;
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h
index 84354e5353..ca025a48a2 100644
--- a/engines/fullpipe/fullpipe.h
+++ b/engines/fullpipe/fullpipe.h
@@ -36,6 +36,9 @@
#include "engines/engine.h"
+#include "gui/debugger.h"
+#include "fullpipe/console.h"
+
struct ADGameDescription;
namespace Fullpipe {
@@ -80,6 +83,9 @@ public:
FullpipeEngine(OSystem *syst, const ADGameDescription *gameDesc);
virtual ~FullpipeEngine();
+ Console *_console;
+ GUI::Debugger *getDebugger() { return _console; }
+
void initialize();
void setMusicAllowed(int val) { _musicAllowed = val; }
diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk
index 88e3ac5d02..bd948b7ab4 100644
--- a/engines/fullpipe/module.mk
+++ b/engines/fullpipe/module.mk
@@ -2,6 +2,7 @@ MODULE := engines/fullpipe
MODULE_OBJS = \
behavior.o \
+ console.o \
detection.o \
floaters.o \
fullpipe.o \