diff options
author | Johannes Schickel | 2007-09-24 20:02:08 +0000 |
---|---|---|
committer | Johannes Schickel | 2007-09-24 20:02:08 +0000 |
commit | 287bf608d4e387f7d5c802a0afe635d85398135f (patch) | |
tree | 6e922c027aa7629c8d3b4a10cbc1bb67ad084ad2 /engines | |
parent | 8e1e4b9079a96d5b48bc445fabd01c4067ba9635 (diff) | |
download | scummvm-rg350-287bf608d4e387f7d5c802a0afe635d85398135f.tar.gz scummvm-rg350-287bf608d4e387f7d5c802a0afe635d85398135f.tar.bz2 scummvm-rg350-287bf608d4e387f7d5c802a0afe635d85398135f.zip |
Added debugger support for kyra2.
svn-id: r29092
Diffstat (limited to 'engines')
-rw-r--r-- | engines/kyra/debugger.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/debugger.h | 10 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.cpp | 16 | ||||
-rw-r--r-- | engines/kyra/kyra_v2.h | 3 |
4 files changed, 33 insertions, 2 deletions
diff --git a/engines/kyra/debugger.cpp b/engines/kyra/debugger.cpp index 62b845011c..02cda261c9 100644 --- a/engines/kyra/debugger.cpp +++ b/engines/kyra/debugger.cpp @@ -28,6 +28,7 @@ #include "common/system.h" #include "kyra/debugger.h" #include "kyra/kyra_v1.h" +#include "kyra/kyra_v2.h" #include "kyra/screen.h" #include "kyra/timer.h" @@ -212,5 +213,10 @@ bool Debugger_v1::cmd_listBirthstones(int argc, const char **argv) { return true; } +#pragma mark - + +Debugger_v2::Debugger_v2(KyraEngine_v2 *vm) : Debugger(vm), _vm(vm) { +} + } // End of namespace Kyra diff --git a/engines/kyra/debugger.h b/engines/kyra/debugger.h index 3744979566..37df5b9a53 100644 --- a/engines/kyra/debugger.h +++ b/engines/kyra/debugger.h @@ -32,6 +32,7 @@ namespace Kyra { class KyraEngine; class KyraEngine_v1; +class KyraEngine_v2; class Debugger : public GUI::Debugger { public: @@ -66,6 +67,15 @@ protected: bool cmd_listBirthstones(int argc, const char **argv); }; +class Debugger_v2 : public Debugger { +public: + Debugger_v2(KyraEngine_v2 *vm); + virtual ~Debugger_v2() {} + +protected: + KyraEngine_v2 *_vm; +}; + } // End of namespace Kyra #endif diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp index e27f31b691..8d2a7714fe 100644 --- a/engines/kyra/kyra_v2.cpp +++ b/engines/kyra/kyra_v2.cpp @@ -32,6 +32,7 @@ #include "kyra/script.h" #include "kyra/text.h" #include "kyra/timer.h" +#include "kyra/debugger.h" #include "common/system.h" @@ -40,6 +41,8 @@ namespace Kyra { KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngine(system, flags) { memset(_defaultShapeTable, 0, sizeof(_defaultShapeTable)); _mouseSHPBuf = 0; + _debugger = 0; + _screen = 0; _gamePlayBuffer = 0; _cCodeBuffer = _optionsBuffer = _chapterBuffer = 0; @@ -66,6 +69,7 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags) : KyraEngi KyraEngine_v2::~KyraEngine_v2() { delete [] _mouseSHPBuf; delete _screen; + delete _debugger; } Movie *KyraEngine_v2::createWSAMovie() { @@ -79,6 +83,9 @@ int KyraEngine_v2::init() { error("_screen->init() failed"); KyraEngine::init(); + + _debugger = new Debugger_v2(this); + assert(_debugger); setupTimers(); @@ -475,6 +482,11 @@ int KyraEngine_v2::checkInput(void *p) { case Common::EVENT_KEYDOWN: if (event.kbd.keycode == Common::KEYCODE_RETURN) keys = 199; + + if (event.kbd.flags == Common::KBD_CTRL) { + if (event.kbd.keycode == 'd') + _debugger->attach(); + } break; case Common::EVENT_LBUTTONUP: @@ -489,8 +501,8 @@ int KyraEngine_v2::checkInput(void *p) { break; } - //if ( _debugger->isAttached()) - // _debugger->onFrame(); + if (_debugger->isAttached()) + _debugger->onFrame(); } _system->delayMillis(10); diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h index 9fc24cff26..a530d6c687 100644 --- a/engines/kyra/kyra_v2.h +++ b/engines/kyra/kyra_v2.h @@ -45,6 +45,7 @@ enum kSequences { class WSAMovieV2; class KyraEngine_v2; +class Debugger_v2; struct SequenceControl { int8 frameIndex; @@ -83,6 +84,7 @@ struct Sequence { }; class KyraEngine_v2 : public KyraEngine { +friend class Debugger_v2; public: KyraEngine_v2(OSystem *system, const GameFlags &flags); ~KyraEngine_v2(); @@ -133,6 +135,7 @@ protected: int go(); Screen_v2 *_screen; + Debugger_v2 *_debugger; ActiveWSA *_activeWSA; ActiveChat *_activeChat; |