aboutsummaryrefslogtreecommitdiff
path: root/engines/chewy
diff options
context:
space:
mode:
authorFilippos Karapetis2016-09-20 10:56:47 +0300
committerFilippos Karapetis2016-10-03 00:33:24 +0300
commit676fa15c193bbd2a7fc2962d0c2bc26e260efd6a (patch)
treed6c9ef7aa699d3cb6fbed1876d1540a98712df69 /engines/chewy
parent078cbf0b089588836784513a558cb7dc99b4758b (diff)
downloadscummvm-rg350-676fa15c193bbd2a7fc2962d0c2bc26e260efd6a.tar.gz
scummvm-rg350-676fa15c193bbd2a7fc2962d0c2bc26e260efd6a.tar.bz2
scummvm-rg350-676fa15c193bbd2a7fc2962d0c2bc26e260efd6a.zip
CHEWY: Add methods for playing sound, speech and music to the debugger
Diffstat (limited to 'engines/chewy')
-rw-r--r--engines/chewy/console.cpp40
-rw-r--r--engines/chewy/console.h3
2 files changed, 43 insertions, 0 deletions
diff --git a/engines/chewy/console.cpp b/engines/chewy/console.cpp
index 386654ba16..b610dddf65 100644
--- a/engines/chewy/console.cpp
+++ b/engines/chewy/console.cpp
@@ -26,12 +26,16 @@
#include "chewy/console.h"
#include "chewy/graphics.h"
#include "chewy/resource.h"
+#include "chewy/sound.h"
namespace Chewy {
Console::Console(ChewyEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("dump", WRAP_METHOD(Console, Cmd_Dump));
registerCmd("draw", WRAP_METHOD(Console, Cmd_Draw));
+ registerCmd("play_sound", WRAP_METHOD(Console, Cmd_PlaySound));
+ registerCmd("play_speech", WRAP_METHOD(Console, Cmd_PlaySpeech));
+ registerCmd("play_music", WRAP_METHOD(Console, Cmd_PlayMusic));
}
Console::~Console() {
@@ -84,4 +88,40 @@ bool Console::Cmd_Draw(int argc, const char **argv) {
return false;
}
+bool Console::Cmd_PlaySound(int argc, const char **argv) {
+ if (argc < 2) {
+ debugPrintf("Usage: play_sound <number>\n");
+ return true;
+ }
+
+ int resNum = atoi(argv[1]);
+ _vm->_sound->playSound(resNum);
+
+ return true;
+}
+
+bool Console::Cmd_PlaySpeech(int argc, const char **argv) {
+ if (argc < 2) {
+ debugPrintf("Usage: play_speech <number>\n");
+ return true;
+ }
+
+ int resNum = atoi(argv[1]);
+ _vm->_sound->playSpeech(resNum);
+
+ return true;
+}
+
+bool Console::Cmd_PlayMusic(int argc, const char **argv) {
+ if (argc < 2) {
+ debugPrintf("Usage: play_music <number>\n");
+ return true;
+ }
+
+ int resNum = atoi(argv[1]);
+ _vm->_sound->playMusic(resNum);
+
+ return true;
+}
+
} // End of namespace Chewy
diff --git a/engines/chewy/console.h b/engines/chewy/console.h
index 352847455d..9877824fff 100644
--- a/engines/chewy/console.h
+++ b/engines/chewy/console.h
@@ -39,6 +39,9 @@ private:
bool Cmd_Dump(int argc, const char **argv);
bool Cmd_Draw(int argc, const char **argv);
+ bool Cmd_PlaySound(int argc, const char **argv);
+ bool Cmd_PlaySpeech(int argc, const char **argv);
+ bool Cmd_PlayMusic(int argc, const char **argv);
};
} // End of namespace Chewy