SHERLOCK: Finish implementation of song / songs debugger commands
This adds support for Rose Tattoo and 3DO version of Serrated Scalpel.
This commit is contained in:
parent
0fa39d17ca
commit
b11530d87c
3 changed files with 39 additions and 2 deletions
|
@ -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());
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
@ -139,6 +140,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
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue