aboutsummaryrefslogtreecommitdiff
path: root/engines
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
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')
-rw-r--r--engines/titanic/debugger.cpp20
-rw-r--r--engines/titanic/debugger.h5
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: