diff options
author | Filippos Karapetis | 2013-07-03 05:49:25 +0300 |
---|---|---|
committer | Filippos Karapetis | 2013-07-03 05:49:25 +0300 |
commit | e457fc2a268be4ef5e32a51ec58f15aeb476ec8a (patch) | |
tree | b9dcf578d3363fe4db364befd9b2e3074d8ae2a7 /engines/neverhood/console.cpp | |
parent | 0146b00148631a36cfe9b89a7edaf88a571946eb (diff) | |
download | scummvm-rg350-e457fc2a268be4ef5e32a51ec58f15aeb476ec8a.tar.gz scummvm-rg350-e457fc2a268be4ef5e32a51ec58f15aeb476ec8a.tar.bz2 scummvm-rg350-e457fc2a268be4ef5e32a51ec58f15aeb476ec8a.zip |
NEVERHOOD: Add a new console command, "playsound"
Diffstat (limited to 'engines/neverhood/console.cpp')
-rw-r--r-- | engines/neverhood/console.cpp | 19 |
1 files changed, 19 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 |