diff options
-rw-r--r-- | engines/titanic/debugger.cpp | 19 | ||||
-rw-r--r-- | engines/titanic/debugger.h | 5 |
2 files changed, 24 insertions, 0 deletions
diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp index 15d098a99a..a8b580b636 100644 --- a/engines/titanic/debugger.cpp +++ b/engines/titanic/debugger.cpp @@ -44,6 +44,7 @@ Debugger::Debugger(TitanicEngine *vm) : GUI::Debugger(), _vm(vm) { registerCmd("movie", WRAP_METHOD(Debugger, cmdMovie)); registerCmd("sound", WRAP_METHOD(Debugger, cmdSound)); registerCmd("cheat", WRAP_METHOD(Debugger, cmdCheat)); + registerCmd("frame", WRAP_METHOD(Debugger, cmdFrame)); } int Debugger::strToInt(const char *s) { @@ -346,4 +347,22 @@ bool Debugger::cmdCheat(int argc, const char **argv) { return false; } +bool Debugger::cmdFrame(int argc, const char **argv) { + if (argc == 3) { + CGameObject *obj = dynamic_cast<CGameObject *>( + g_vm->_window->_project->findByName(argv[1])); + + if (obj) { + obj->loadFrame(strToInt(argv[2])); + return false; + } else { + debugPrintf("Object not found\n"); + return true; + } + } else { + debugPrintf("frame <object> <frame number>"); + return true; + } +} + } // End of namespace Titanic diff --git a/engines/titanic/debugger.h b/engines/titanic/debugger.h index 3e53feec2a..cd9da2b2ab 100644 --- a/engines/titanic/debugger.h +++ b/engines/titanic/debugger.h @@ -115,6 +115,11 @@ private: * Change to the cheat room */ bool cmdCheat(int argc, const char **argv); + + /** + * Set the movie frame for a given object + */ + bool cmdFrame(int argc, const char **argv); protected: TitanicEngine *_vm; public: |