From 4e849da06d9e68f5fb7da5df3123f7c620ad886b Mon Sep 17 00:00:00 2001 From: D G Turner Date: Sat, 7 Dec 2013 00:16:56 +0000 Subject: FULLPIPE: Add debug console. --- engines/fullpipe/console.cpp | 31 +++++++++++++++++++++++++++++++ engines/fullpipe/console.h | 40 ++++++++++++++++++++++++++++++++++++++++ engines/fullpipe/fullpipe.cpp | 10 ++++++++++ engines/fullpipe/fullpipe.h | 6 ++++++ engines/fullpipe/module.mk | 1 + 5 files changed, 88 insertions(+) create mode 100644 engines/fullpipe/console.cpp create mode 100644 engines/fullpipe/console.h (limited to 'engines/fullpipe') 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 \ -- cgit v1.2.3