diff options
-rw-r--r-- | engines/titanic/debugger.cpp | 20 | ||||
-rw-r--r-- | engines/titanic/debugger.h | 5 |
2 files changed, 25 insertions, 0 deletions
diff --git a/engines/titanic/debugger.cpp b/engines/titanic/debugger.cpp index e0c0207ee4..bd42c95568 100644 --- a/engines/titanic/debugger.cpp +++ b/engines/titanic/debugger.cpp @@ -36,6 +36,7 @@ Debugger::Debugger(TitanicEngine *vm) : GUI::Debugger(), _vm(vm) { registerCmd("pet", WRAP_METHOD(Debugger, cmdPET)); registerCmd("item", WRAP_METHOD(Debugger, cmdItem)); registerCmd("movie", WRAP_METHOD(Debugger, cmdMovie)); + registerCmd("sound", WRAP_METHOD(Debugger, cmdSound)); } int Debugger::strToInt(const char *s) { @@ -294,4 +295,23 @@ bool Debugger::cmdMovie(int argc, const char **argv) { return false; } +bool Debugger::cmdSound(int argc, const char **argv) { + if (argc == 2) { + Common::String name = argv[1]; + const char *ch = strchr(argv[1], '!'); + if (ch) + name.setChar('#', ch - argv[1]); + if (!name.contains("#")) + name = "z#" + name; + + CGameManager *gameManager = g_vm->_window->_gameManager; + CProximity prox; + gameManager->_sound.playSound(name, prox); + return false; + } else { + debugPrintf("sound <name>\n"); + return true; + } +} + } // End of namespace Titanic diff --git a/engines/titanic/debugger.h b/engines/titanic/debugger.h index 919d6c5358..a9610d1555 100644 --- a/engines/titanic/debugger.h +++ b/engines/titanic/debugger.h @@ -94,6 +94,11 @@ private: * Shows a movie */ bool cmdMovie(int argc, const char **argv); + + /** + * Play a sound + */ + bool cmdSound(int argc, const char **argv); protected: TitanicEngine *_vm; public: |