diff --git a/engines/tucker/console.cpp b/engines/tucker/console.cpp new file mode 100644 index 00000000000..f06fd8fddbe --- /dev/null +++ b/engines/tucker/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 "tucker/console.h" +#include "tucker/tucker.h" + +namespace Tucker { + +TuckerConsole::TuckerConsole(TuckerEngine *vm) : GUI::Debugger(), _vm(vm) { +} + +TuckerConsole::~TuckerConsole() { +} + +void TuckerConsole::preEnter() { +} + +void TuckerConsole::postEnter() { +} + +} // End of namespace Tucker diff --git a/engines/tucker/console.h b/engines/tucker/console.h new file mode 100644 index 00000000000..2449fa3279f --- /dev/null +++ b/engines/tucker/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 TUCKER_CONSOLE_H +#define TUCKER_CONSOLE_H + +#include "gui/debugger.h" + +namespace Tucker { + +class TuckerEngine; + +class TuckerConsole : public GUI::Debugger { +public: + TuckerConsole(TuckerEngine *vm); + virtual ~TuckerConsole(void); + +protected: + virtual void preEnter(); + virtual void postEnter(); + +private: + TuckerEngine *_vm; +}; + +} // End of namespace Tucker + +#endif diff --git a/engines/tucker/module.mk b/engines/tucker/module.mk index 4847fdc3ec0..d11c68b746b 100644 --- a/engines/tucker/module.mk +++ b/engines/tucker/module.mk @@ -1,6 +1,7 @@ MODULE := engines/tucker MODULE_OBJS := \ + console.o \ detection.o \ graphics.o \ locations.o \ diff --git a/engines/tucker/tucker.cpp b/engines/tucker/tucker.cpp index c86991ab1bd..2b9b4edee41 100644 --- a/engines/tucker/tucker.cpp +++ b/engines/tucker/tucker.cpp @@ -38,9 +38,11 @@ namespace Tucker { TuckerEngine::TuckerEngine(OSystem *system, Common::Language language, uint32 flags) : Engine(system), _gameLang(language), _gameFlags(flags) { + _console = new TuckerConsole(this); } TuckerEngine::~TuckerEngine() { + delete _console; } bool TuckerEngine::hasFeature(EngineFeature f) const { @@ -628,6 +630,12 @@ void TuckerEngine::parseEvents() { case Common::KEYCODE_ESCAPE: _inputKeys[kInputKeyEscape] = true; break; + case Common::KEYCODE_d: + if (ev.kbd.hasFlags(Common::KBD_CTRL)) { + this->getDebugger()->attach(); + this->getDebugger()->onFrame(); + } + break; default: break; } diff --git a/engines/tucker/tucker.h b/engines/tucker/tucker.h index de7042386bb..a7d7f1cdd46 100644 --- a/engines/tucker/tucker.h +++ b/engines/tucker/tucker.h @@ -39,6 +39,8 @@ #include "engines/engine.h" +#include "tucker/console.h" + /** * This is the namespace of the Tucker engine. * @@ -275,6 +277,7 @@ public: virtual Common::Error run(); virtual bool hasFeature(EngineFeature f) const; virtual void syncSoundSettings(); + GUI::Debugger *getDebugger() { return _console; } protected: @@ -566,6 +569,8 @@ protected: virtual bool canLoadGameStateCurrently(); virtual bool canSaveGameStateCurrently(); + TuckerConsole *_console; + void handleIntroSequence(); void handleCreditsSequence(); void handleCongratulationsSequence();