diff options
Diffstat (limited to 'engines/chewy')
-rw-r--r-- | engines/chewy/console.cpp | 40 | ||||
-rw-r--r-- | engines/chewy/console.h | 3 |
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 |