diff options
author | Bendegúz Nagy | 2016-08-10 11:10:56 +0200 |
---|---|---|
committer | Bendegúz Nagy | 2016-08-26 23:02:22 +0200 |
commit | 50c5b39887288b34fd5c9eb25ade633bf43dff4d (patch) | |
tree | 4ecd79bb29fb35c071dfc021991dc2aa49c8f935 | |
parent | 1be1728c951e4f81755e870e7a95811a85351fd4 (diff) | |
download | scummvm-rg350-50c5b39887288b34fd5c9eb25ade633bf43dff4d.tar.gz scummvm-rg350-50c5b39887288b34fd5c9eb25ade633bf43dff4d.tar.bz2 scummvm-rg350-50c5b39887288b34fd5c9eb25ade633bf43dff4d.zip |
DM: Add debugger console
-rw-r--r-- | engines/dm/console.cpp | 35 | ||||
-rw-r--r-- | engines/dm/console.h | 42 | ||||
-rw-r--r-- | engines/dm/dm.h | 13 | ||||
-rw-r--r-- | engines/dm/eventman.cpp | 4 | ||||
-rw-r--r-- | engines/dm/gfx.cpp | 1 | ||||
-rw-r--r-- | engines/dm/module.mk | 1 |
6 files changed, 87 insertions, 9 deletions
diff --git a/engines/dm/console.cpp b/engines/dm/console.cpp new file mode 100644 index 0000000000..e2618507f9 --- /dev/null +++ b/engines/dm/console.cpp @@ -0,0 +1,35 @@ +/* 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. +* +*/ + +/* +* Based on the Reverse Engineering work of Christophe Fontanel, +* maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/) +*/ + +#include "console.h" + + +namespace DM { + +Console::Console(DM::DMEngine* vm) : _vm(vm) {} + +}
\ No newline at end of file diff --git a/engines/dm/console.h b/engines/dm/console.h new file mode 100644 index 0000000000..eab2a32e68 --- /dev/null +++ b/engines/dm/console.h @@ -0,0 +1,42 @@ +/* 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. +* +*/ + +/* +* Based on the Reverse Engineering work of Christophe Fontanel, +* maintainer of the Dungeon Master Encyclopaedia (http://dmweb.free.fr/) +*/ + +#include "gui/debugger.h" + + + +namespace DM { + +class DMEngine; + +class Console : public GUI::Debugger { + DMEngine *_vm; +public: + explicit Console(DM::DMEngine *vm); + virtual ~Console(void) {} +}; +} diff --git a/engines/dm/dm.h b/engines/dm/dm.h index d254f3d95a..ae16e13e60 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -30,16 +30,16 @@ #include "common/random.h" #include "engines/engine.h" -#include "gui/debugger.h" #include "common/savefile.h" #include "common/str.h" #include "engines/savestate.h" +#include "console.h" + namespace DM { -class Console; class DisplayMan; class DungeonMan; class EventManager; @@ -241,6 +241,7 @@ public: explicit DMEngine(OSystem *syst); ~DMEngine(); virtual bool hasFeature(EngineFeature f) const; + GUI::Debugger *getDebugger() { return _console; } void f22_delay(uint16 verticalBlank); // @ F0022_MAIN_Delay uint16 f30_getScaledProduct(uint16 val, uint16 scale, uint16 vale2); // @ F0030_MAIN_GetScaledProduct @@ -266,7 +267,6 @@ private: int16 _g528_saveFormat; // @ G0528_i_Format int16 _g527_platform; // @ G0527_i_Platform uint16 _g526_dungeonId; // @ G0526_ui_DungeonID - Console *_console; byte *_g562_entranceDoorAnimSteps[10]; // @ G0562_apuc_Bitmap_EntranceDoorAnimationSteps byte *_g564_interfaceCredits; // @ G0564_puc_Graphic5_InterfaceCredits Common::RandomSource *_rnd; @@ -274,6 +274,7 @@ private: Common::Queue<PendingSound> _pendingSounds; byte *_savedScreenForOpenEntranceDoors; // ad-hoc HACK public: + Console *_console; DisplayMan *_displayMan; DungeonMan *_dungeonMan; EventManager *_eventMan; @@ -317,12 +318,6 @@ public: int16 _g318_waitForInputMaxVerticalBlankCount; // @ G0318_i_WaitForInputMaximumVerticalBlankCount }; -class Console : public GUI::Debugger { -public: - explicit Console(DMEngine *vm) {} - virtual ~Console(void) {} -}; - } // End of namespace DM #endif diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp index 8258ef0d62..af875a94e5 100644 --- a/engines/dm/eventman.cpp +++ b/engines/dm/eventman.cpp @@ -531,6 +531,10 @@ Common::EventType EventManager::processInput(Common::Event *grabKey, Common::Eve if (event.synthetic) break; + if (event.kbd.keycode == Common::KEYCODE_d && event.kbd.hasFlags(Common::KBD_CTRL)) { + _vm->_console->attach(); + } + if (grabKey) { *grabKey = event; return event.type; diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp index fa2b44278a..41fb147a1b 100644 --- a/engines/dm/gfx.cpp +++ b/engines/dm/gfx.cpp @@ -1211,6 +1211,7 @@ byte* DisplayMan::f114_getExplosionBitmap(uint16 explosionAspIndex, uint16 scale void DisplayMan::updateScreen() { _vm->_system->copyRectToScreen(_g348_bitmapScreen, _screenWidth, 0, 0, _screenWidth, _screenHeight); + _vm->_console->onFrame(); _vm->_system->updateScreen(); } diff --git a/engines/dm/module.mk b/engines/dm/module.mk index bf1cef8694..559ebf1707 100644 --- a/engines/dm/module.mk +++ b/engines/dm/module.mk @@ -30,6 +30,7 @@ MODULE := engines/dm MODULE_OBJS := \ champion.o \ + console.o \ detection.o \ dialog.o \ dm.o \ |