[Scummvm-cvs-logs] scummvm master -> b11530d87c1c2648dd68f9b9669aa24fe785264c
eriktorbjorn
eriktorbjorn at telia.com
Sun Aug 30 00:43:26 CEST 2015
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
b11530d87c SHERLOCK: Finish implementation of song / songs debugger commands
Commit: b11530d87c1c2648dd68f9b9669aa24fe785264c
https://github.com/scummvm/scummvm/commit/b11530d87c1c2648dd68f9b9669aa24fe785264c
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2015-08-30T00:41:48+02:00
Commit Message:
SHERLOCK: Finish implementation of song / songs debugger commands
This adds support for Rose Tattoo and 3DO version of Serrated
Scalpel.
Changed paths:
engines/sherlock/music.cpp
engines/sherlock/resources.cpp
engines/sherlock/resources.h
diff --git a/engines/sherlock/music.cpp b/engines/sherlock/music.cpp
index 10796e4..7802bf5 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 8432c07..c409304 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 8275703..99d58a5 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);
More information about the Scummvm-git-logs
mailing list