diff options
author | Paul Gilbert | 2012-10-14 13:43:29 +1100 |
---|---|---|
committer | Paul Gilbert | 2012-10-14 13:43:29 +1100 |
commit | af2824da8247c699c29a566bce1facb76d4b5877 (patch) | |
tree | ead0cb739370a3b8108adad7d56dd9b721e8ffa1 | |
parent | e23f91472e6694087e3aee13139b84d227f7f7f1 (diff) | |
download | scummvm-rg350-af2824da8247c699c29a566bce1facb76d4b5877.tar.gz scummvm-rg350-af2824da8247c699c29a566bce1facb76d4b5877.tar.bz2 scummvm-rg350-af2824da8247c699c29a566bce1facb76d4b5877.zip |
HOPKINS: Added debugger skeleton
-rw-r--r-- | engines/hopkins/debugger.cpp | 38 | ||||
-rw-r--r-- | engines/hopkins/debugger.h | 45 | ||||
-rw-r--r-- | engines/hopkins/events.cpp | 10 | ||||
-rw-r--r-- | engines/hopkins/hopkins.cpp | 1 | ||||
-rw-r--r-- | engines/hopkins/hopkins.h | 2 | ||||
-rw-r--r-- | engines/hopkins/module.mk | 1 |
6 files changed, 97 insertions, 0 deletions
diff --git a/engines/hopkins/debugger.cpp b/engines/hopkins/debugger.cpp new file mode 100644 index 0000000000..fc70e93102 --- /dev/null +++ b/engines/hopkins/debugger.cpp @@ -0,0 +1,38 @@ +/* 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 "hopkins/debugger.h" +#include "hopkins/globals.h" +#include "hopkins/graphics.h" +#include "hopkins/hopkins.h" + +namespace Hopkins { + +Debugger::Debugger() : GUI::Debugger() { + DCmd_Register("continue", WRAP_METHOD(Debugger, Cmd_Exit)); +} + +void Debugger::setParent(HopkinsEngine *vm) { + _vm = vm; +} + +} // End of namespace Tony diff --git a/engines/hopkins/debugger.h b/engines/hopkins/debugger.h new file mode 100644 index 0000000000..7a2f44aafe --- /dev/null +++ b/engines/hopkins/debugger.h @@ -0,0 +1,45 @@ +/* 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 HOPKINS_DEBUGGER_H +#define HOPKINS_DEBUGGER_H + +#include "common/scummsys.h" +#include "gui/debugger.h" + +namespace Hopkins { + +class HopkinsEngine; + +class Debugger : public GUI::Debugger { +private: + HopkinsEngine *_vm; + +public: + Debugger(); + virtual ~Debugger() {} + void setParent(HopkinsEngine *vm); +}; + +} // End of namespace Hopkins + +#endif diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index 6c2cadf257..8f4d5eee5c 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -198,6 +198,9 @@ void EventsManager::checkForNextFrameCounter() { if ((milli - _priorFrameTime) >= GAME_FRAME_TIME) { _priorFrameTime = milli; g_system->updateScreen(); + + // Signal the ScummVM debugger + _vm->_debugger.onFrame(); } } @@ -222,6 +225,13 @@ void EventsManager::pollEvents() { case Common::EVENT_KEYDOWN: ESC_KEY = event.kbd.keycode == Common::KEYCODE_ESCAPE; + + // Check for debugger + if ((event.kbd.keycode == Common::KEYCODE_d) && (event.kbd.flags & Common::KBD_CTRL)) { + // Attach to the debugger + _vm->_debugger.attach(); + _vm->_debugger.onFrame(); + } return; case Common::EVENT_LBUTTONDOWN: diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp index 2608da5dbc..84836e2510 100644 --- a/engines/hopkins/hopkins.cpp +++ b/engines/hopkins/hopkins.cpp @@ -38,6 +38,7 @@ HopkinsEngine *g_vm; HopkinsEngine::HopkinsEngine(OSystem *syst, const HopkinsGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc), _randomSource("Hopkins"), _animationManager() { g_vm = this; + _debugger.setParent(this); _animationManager.setParent(this); _eventsManager.setParent(this); _fileManager.setParent(this); diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h index f58dfd7f14..06b87bdacb 100644 --- a/engines/hopkins/hopkins.h +++ b/engines/hopkins/hopkins.h @@ -32,6 +32,7 @@ #include "engines/engine.h" #include "graphics/surface.h" #include "hopkins/anim.h" +#include "hopkins/debugger.h" #include "hopkins/events.h" #include "hopkins/files.h" #include "hopkins/font.h" @@ -93,6 +94,7 @@ protected: virtual bool hasFeature(EngineFeature f) const; public: + Debugger _debugger; AnimationManager _animationManager; EventsManager _eventsManager; FontManager _fontManager; diff --git a/engines/hopkins/module.mk b/engines/hopkins/module.mk index 7fc92c5ea1..ff74626ea6 100644 --- a/engines/hopkins/module.mk +++ b/engines/hopkins/module.mk @@ -2,6 +2,7 @@ MODULE := engines/hopkins MODULE_OBJS := \ anim.o \ + debugger.o \ detection.o \ dialogs.o \ events.o \ |