diff options
author | Torbjörn Andersson | 2015-06-03 22:12:11 +0200 |
---|---|---|
committer | Torbjörn Andersson | 2015-06-03 22:12:53 +0200 |
commit | 405914d6553a713b207809034d1b305a23f2be39 (patch) | |
tree | ebf1a24b196826dcc3ea1500fcd2f1f78692aacc /engines/sherlock | |
parent | 7b9455c24286737f6d57344cb7e6bf48b57b0a63 (diff) | |
download | scummvm-rg350-405914d6553a713b207809034d1b305a23f2be39.tar.gz scummvm-rg350-405914d6553a713b207809034d1b305a23f2be39.tar.bz2 scummvm-rg350-405914d6553a713b207809034d1b305a23f2be39.zip |
SHERLOCK: Add "song" debugger command
It could be more user-friendly, but should work well enough for now.
Diffstat (limited to 'engines/sherlock')
-rw-r--r-- | engines/sherlock/debugger.cpp | 15 | ||||
-rw-r--r-- | engines/sherlock/debugger.h | 5 |
2 files changed, 20 insertions, 0 deletions
diff --git a/engines/sherlock/debugger.cpp b/engines/sherlock/debugger.cpp index d8db5950b9..27f4441dd0 100644 --- a/engines/sherlock/debugger.cpp +++ b/engines/sherlock/debugger.cpp @@ -22,6 +22,7 @@ #include "sherlock/debugger.h" #include "sherlock/sherlock.h" +#include "sherlock/music.h" #include "sherlock/scalpel/3do/movie_decoder.h" @@ -31,6 +32,7 @@ Debugger::Debugger(SherlockEngine *vm) : GUI::Debugger(), _vm(vm) { registerCmd("continue", WRAP_METHOD(Debugger, cmdExit)); registerCmd("scene", WRAP_METHOD(Debugger, cmdScene)); registerCmd("3do_playmovie", WRAP_METHOD(Debugger, cmd3DO_PlayMovie)); + registerCmd("song", WRAP_METHOD(Debugger, cmdSong)); } void Debugger::postEnter() { @@ -82,4 +84,17 @@ bool Debugger::cmd3DO_PlayMovie(int argc, const char **argv) { return cmdExit(0, 0); } +bool Debugger::cmdSong(int argc, const char **argv) { + if (argc != 2) { + debugPrintf("Format: song <number>\n"); + return true; + } + + if (!_vm->_music->loadSong(strToInt(argv[1]))) { + debugPrintf("Invalid song number.\n"); + return true; + } + return false; +} + } // End of namespace Sherlock diff --git a/engines/sherlock/debugger.h b/engines/sherlock/debugger.h index c394c52cd5..39866d0cd3 100644 --- a/engines/sherlock/debugger.h +++ b/engines/sherlock/debugger.h @@ -55,6 +55,11 @@ private: */ bool cmd3DO_PlayMovie(int argc, const char **argv); + /** + * Plays a song + */ + bool cmdSong(int argc, const char **argv); + private: Common::String _3doPlayMovieFile; }; |