diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/neverhood/console.cpp | 19 | ||||
-rw-r--r-- | engines/neverhood/console.h | 1 |
2 files changed, 20 insertions, 0 deletions
diff --git a/engines/neverhood/console.cpp b/engines/neverhood/console.cpp index a4dd50ce4b..e676da3727 100644 --- a/engines/neverhood/console.cpp +++ b/engines/neverhood/console.cpp @@ -25,6 +25,7 @@ #include "neverhood/neverhood.h" #include "neverhood/gamemodule.h" #include "neverhood/scene.h" +#include "neverhood/sound.h" #include "neverhood/modules/module1600.h" namespace Neverhood { @@ -34,6 +35,7 @@ Console::Console(NeverhoodEngine *vm) : GUI::Debugger(), _vm(vm) { DCmd_Register("dumpvars", WRAP_METHOD(Console, Cmd_Dumpvars)); DCmd_Register("room", WRAP_METHOD(Console, Cmd_Room)); DCmd_Register("surfaces", WRAP_METHOD(Console, Cmd_Surfaces)); + DCmd_Register("playsound", WRAP_METHOD(Console, Cmd_PlaySound)); } Console::~Console() { @@ -169,4 +171,21 @@ bool Console::Cmd_Dumpvars(int argc, const char **argv) { return true; } +bool Console::Cmd_PlaySound(int argc, const char **argv) { + if (argc < 2) { + DebugPrintf("Usage: %s <sound hash>\n", argv[0]); + } else { + uint32 soundHash = strtol(argv[1], NULL, 0); + AudioResourceManSoundItem *soundItem = new AudioResourceManSoundItem(_vm, soundHash); + soundItem->setVolume(100); + soundItem->playSound(false); + while (soundItem->isPlaying()) { + _vm->_system->delayMillis(10); + } + delete soundItem; + } + + return true; +} + } // End of namespace Neverhood diff --git a/engines/neverhood/console.h b/engines/neverhood/console.h index 40c11b50e3..62d65bd693 100644 --- a/engines/neverhood/console.h +++ b/engines/neverhood/console.h @@ -41,6 +41,7 @@ private: bool Cmd_Surfaces(int argc, const char **argv); bool Cmd_Cheat(int argc, const char **argv); bool Cmd_Dumpvars(int argc, const char **argv); + bool Cmd_PlaySound(int argc, const char **argv); }; } // End of namespace Neverhood |