aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorTorbjörn Andersson2015-08-30 00:41:48 +0200
committerTorbjörn Andersson2015-08-30 00:41:48 +0200
commitb11530d87c1c2648dd68f9b9669aa24fe785264c (patch)
tree064dda0f6e51b0ccbdd252ecd5c16c8f38412b31 /engines/sherlock
parent0fa39d17ca151114203c67bb725d63b49bea2272 (diff)
downloadscummvm-rg350-b11530d87c1c2648dd68f9b9669aa24fe785264c.tar.gz
scummvm-rg350-b11530d87c1c2648dd68f9b9669aa24fe785264c.tar.bz2
scummvm-rg350-b11530d87c1c2648dd68f9b9669aa24fe785264c.zip
SHERLOCK: Finish implementation of song / songs debugger commands
This adds support for Rose Tattoo and 3DO version of Serrated Scalpel.
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/music.cpp27
-rw-r--r--engines/sherlock/resources.cpp8
-rw-r--r--engines/sherlock/resources.h6
3 files changed, 39 insertions, 2 deletions
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 10796e47ea..7802bf5eeb 100644
--- a/engines/sherlock/music.cpp
+++ b/engines/sherlock/music.cpp
@@ -583,8 +583,31 @@ void Music::setMusicVolume(int volume) {
void Music::getSongNames(Common::StringArray &songs) {
songs.clear();
if (IS_SERRATED_SCALPEL) {
- for (int i = 0; i < ARRAYSIZE(SONG_NAMES); i++) {
- songs.push_back(SONG_NAMES[i]);
+ if (IS_3DO) {
+ Common::FSDirectory gameDirectory(ConfMan.get("path"));
+ Common::FSDirectory *musicDirectory = gameDirectory.getSubDirectory("music");
+ Common::ArchiveMemberList files;
+
+ musicDirectory->listMatchingMembers(files, "*_mw22.aifc");
+
+ for (Common::ArchiveMemberList::iterator i = files.begin(); i != files.end(); ++i) {
+ Common::String name = (*i)->getName();
+ name.erase(name.size() - 10);
+ songs.push_back(name);
+ }
+ } else {
+ for (int i = 0; i < ARRAYSIZE(SONG_NAMES); i++) {
+ songs.push_back(SONG_NAMES[i]);
+ }
+ }
+ } else {
+ Common::StringArray fileList;
+ _vm->_res->getResourceNames("music.lib", fileList);
+ for (Common::StringArray::iterator i = fileList.begin(); i != fileList.end(); ++i) {
+ if ((*i).matchString("*.XMI", true)) {
+ (*i).erase((*i).size() - 4);
+ songs.push_back(*i);
+ }
}
}
Common::sort(songs.begin(), songs.end());
diff --git a/engines/sherlock/resources.cpp b/engines/sherlock/resources.cpp
index 8432c071ba..c4093048bd 100644
--- a/engines/sherlock/resources.cpp
+++ b/engines/sherlock/resources.cpp
@@ -314,6 +314,14 @@ int Resources::resourceIndex() const {
return _resourceIndex;
}
+void Resources::getResourceNames(const Common::String &libraryFile, Common::StringArray &names) {
+ addToCache(libraryFile);
+ LibraryIndex &libIndex = _indexes[libraryFile];
+ for (LibraryIndex::iterator i = libIndex.begin(); i != libIndex.end(); ++i) {
+ names.push_back(i->_key);
+ }
+}
+
Common::SeekableReadStream *Resources::decompress(Common::SeekableReadStream &source) {
// This variation can't be used by Rose Tattoo, since compressed resources include the input size,
// not the output size. Which means their decompression has to be done via passed buffers
diff --git a/engines/sherlock/resources.h b/engines/sherlock/resources.h
index 8275703491..99d58a51b1 100644
--- a/engines/sherlock/resources.h
+++ b/engines/sherlock/resources.h
@@ -29,6 +29,7 @@
#include "common/hash-str.h"
#include "common/rect.h"
#include "common/str.h"
+#include "common/str-array.h"
#include "common/stream.h"
#include "graphics/surface.h"
@@ -140,6 +141,11 @@ public:
int resourceIndex() const;
/**
+ * Produces a list of all resource names within a file. Used by the debugger.
+ */
+ void getResourceNames(const Common::String &libraryFile, Common::StringArray &names);
+
+ /**
* Decompresses LZW compressed data
*/
Common::SeekableReadStream *decompress(Common::SeekableReadStream &source);