diff options
-rw-r--r-- | engines/sword25/console.cpp | 43 | ||||
-rw-r--r-- | engines/sword25/console.h | 50 | ||||
-rw-r--r-- | engines/sword25/input/inputengine.cpp | 6 | ||||
-rw-r--r-- | engines/sword25/module.mk | 1 | ||||
-rw-r--r-- | engines/sword25/sword25.cpp | 4 | ||||
-rw-r--r-- | engines/sword25/sword25.h | 5 |
6 files changed, 109 insertions, 0 deletions
diff --git a/engines/sword25/console.cpp b/engines/sword25/console.cpp new file mode 100644 index 0000000000..014c748182 --- /dev/null +++ b/engines/sword25/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 "sword25/console.h" +#include "sword25/sword25.h" + +namespace Sword25 { + +Sword25Console::Sword25Console(Sword25Engine *vm) : GUI::Debugger(), _vm(vm) { +} + +Sword25Console::~Sword25Console() { +} + +void Sword25Console::preEnter() { +} + +void Sword25Console::postEnter() { +} + +} // End of namespace Sword25 diff --git a/engines/sword25/console.h b/engines/sword25/console.h new file mode 100644 index 0000000000..dd053c19f6 --- /dev/null +++ b/engines/sword25/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 SWORD25_CONSOLE_H +#define SWORD25_CONSOLE_H + +#include "gui/debugger.h" + +namespace Sword25 { + +class Sword25Engine; + +class Sword25Console : public GUI::Debugger { +public: + Sword25Console(Sword25Engine *vm); + virtual ~Sword25Console(void); + +protected: + virtual void preEnter(); + virtual void postEnter(); + +private: + Sword25Engine *_vm; +}; + +} // End of namespace Sword25 + +#endif diff --git a/engines/sword25/input/inputengine.cpp b/engines/sword25/input/inputengine.cpp index 8dc98ba3fb..82d5cad588 100644 --- a/engines/sword25/input/inputengine.cpp +++ b/engines/sword25/input/inputengine.cpp @@ -121,6 +121,12 @@ void InputEngine::update() { case Common::EVENT_KEYDOWN: case Common::EVENT_KEYUP: + // FIXME - Need to work out how to expose getDebugger() to this module + //if (event.kbd.hasFlags(Common::KBD_CTRL) && event.kbd.keycode == Common::KEYCODE_d && event.type == Common::EVENT_KEYDOWN) { + // _vm->getDebugger()->attach(); + // _vm->getDebugger()->onFrame(); + //} + alterKeyboardState(event.kbd.keycode, (event.type == Common::EVENT_KEYDOWN) ? 0x80 : 0); break; diff --git a/engines/sword25/module.mk b/engines/sword25/module.mk index f10c6be5a9..944e2c49c3 100644 --- a/engines/sword25/module.mk +++ b/engines/sword25/module.mk @@ -1,6 +1,7 @@ MODULE := engines/sword25 MODULE_OBJS := \ + console.o \ detection.o \ sword25.o \ fmv/movieplayer.o \ diff --git a/engines/sword25/sword25.cpp b/engines/sword25/sword25.cpp index 5864057423..4c188fe7ea 100644 --- a/engines/sword25/sword25.cpp +++ b/engines/sword25/sword25.cpp @@ -61,9 +61,13 @@ Sword25Engine::Sword25Engine(OSystem *syst, const ADGameDescription *gameDesc): DebugMan.addDebugChannel(kDebugScript, "Script", "Script debug level"); DebugMan.addDebugChannel(kDebugScript, "Scripts", "Script debug level"); DebugMan.addDebugChannel(kDebugSound, "Sound", "Sound debug level"); + + _console = new Sword25Console(this); } Sword25Engine::~Sword25Engine() { + DebugMan.clearAllDebugChannels(); + delete _console; } Common::Error Sword25Engine::run() { diff --git a/engines/sword25/sword25.h b/engines/sword25/sword25.h index 2d93e2267c..91b62cba09 100644 --- a/engines/sword25/sword25.h +++ b/engines/sword25/sword25.h @@ -32,6 +32,7 @@ #include "engines/engine.h" #include "sword25/kernel/log.h" +#include "sword25/console.h" struct ADGameDescription; @@ -70,6 +71,8 @@ private: bool loadPackages(); + Sword25Console *_console; + protected: virtual Common::Error run(); bool hasFeature(EngineFeature f) const; @@ -80,6 +83,8 @@ protected: // bool canLoadGameStateCurrently(); // TODO: Implement this? // bool canSaveGameStateCurrently(); // TODO: Implement this? + GUI::Debugger *getDebugger() { return _console; } + void shutdown(); public: |