aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/debugger.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2017-07-06 11:07:55 -0400
committerPaul Gilbert2017-07-06 11:07:55 -0400
commit6044ba16ceac190886c04412d07da341ac2757b9 (patch)
treeb19d082ef9a0118f1c961a6919122ffb1243e09f /engines/titanic/debugger.cpp
parent0b18b0b1b5791fc142a9527fcc13886710a4bd84 (diff)
downloadscummvm-rg350-6044ba16ceac190886c04412d07da341ac2757b9.tar.gz
scummvm-rg350-6044ba16ceac190886c04412d07da341ac2757b9.tar.bz2
scummvm-rg350-6044ba16ceac190886c04412d07da341ac2757b9.zip
TITANIC: Added sound command to debugger
Diffstat (limited to 'engines/titanic/debugger.cpp')
-rw-r--r--engines/titanic/debugger.cpp20
1 files changed, 20 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