diff options
Diffstat (limited to 'engines/sherlock/debugger.cpp')
-rw-r--r-- | engines/sherlock/debugger.cpp | 42 |
1 files changed, 35 insertions, 7 deletions
diff --git a/engines/sherlock/debugger.cpp b/engines/sherlock/debugger.cpp index 2813a7eb69..39f8da3806 100644 --- a/engines/sherlock/debugger.cpp +++ b/engines/sherlock/debugger.cpp @@ -23,12 +23,13 @@ #include "sherlock/debugger.h" #include "sherlock/sherlock.h" #include "sherlock/music.h" -#include "sherlock/scalpel/3do/movie_decoder.h" +#include "sherlock/scalpel/scalpel.h" #include "sherlock/scalpel/scalpel_debugger.h" #include "sherlock/tattoo/tattoo_debugger.h" #include "audio/mixer.h" #include "audio/decoders/aiff.h" #include "audio/decoders/wave.h" +#include "common/str-array.h" namespace Sherlock { @@ -45,13 +46,15 @@ Debugger::Debugger(SherlockEngine *vm) : GUI::Debugger(), _vm(vm) { registerCmd("continue", WRAP_METHOD(Debugger, cmdExit)); registerCmd("scene", WRAP_METHOD(Debugger, cmdScene)); registerCmd("song", WRAP_METHOD(Debugger, cmdSong)); + registerCmd("songs", WRAP_METHOD(Debugger, cmdListSongs)); + registerCmd("listfiles", WRAP_METHOD(Debugger, cmdListFiles)); registerCmd("dumpfile", WRAP_METHOD(Debugger, cmdDumpFile)); - registerCmd("locations", WRAP_METHOD(Debugger, cmdLocations)); + registerCmd("locations", WRAP_METHOD(Debugger, cmdLocations)); } void Debugger::postEnter() { if (!_3doPlayMovieFile.empty()) { - Scalpel3DOMoviePlay(_3doPlayMovieFile.c_str(), Common::Point(0, 0)); + static_cast<Scalpel::ScalpelEngine *>(_vm)->play3doMovie(_3doPlayMovieFile, Common::Point(0, 0)); _3doPlayMovieFile.clear(); } @@ -87,15 +90,40 @@ bool Debugger::cmdScene(int argc, const char **argv) { bool Debugger::cmdSong(int argc, const char **argv) { if (argc != 2) { - debugPrintf("Format: song <room>\n"); + debugPrintf("Format: song <name>\n"); return true; } - if (!_vm->_music->loadSong(strToInt(argv[1]))) { - debugPrintf("Invalid song number.\n"); + Common::StringArray songs; + _vm->_music->getSongNames(songs); + + for (uint i = 0; i < songs.size(); i++) { + if (songs[i].equalsIgnoreCase(argv[1])) { + _vm->_music->loadSong(songs[i]); + return false; + } + } + + debugPrintf("Invalid song. Use the 'songs' command to see which ones are available.\n"); + return true; +} + +bool Debugger::cmdListSongs(int argc, const char **argv) { + Common::StringArray songs; + _vm->_music->getSongNames(songs); + debugPrintColumns(songs); + return true; +} + +bool Debugger::cmdListFiles(int argc, const char **argv) { + if (argc != 2) { + debugPrintf("Format: listfiles <resource file>\n"); return true; } - return false; + Common::StringArray files; + _vm->_res->getResourceNames(Common::String(argv[1]), files); + debugPrintColumns(files); + return true; } bool Debugger::cmdDumpFile(int argc, const char **argv) { |