diff options
Diffstat (limited to 'engines/sherlock/resources.cpp')
-rw-r--r-- | engines/sherlock/resources.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/sherlock/resources.cpp b/engines/sherlock/resources.cpp index 4cdf688676..c4093048bd 100644 --- a/engines/sherlock/resources.cpp +++ b/engines/sherlock/resources.cpp @@ -64,7 +64,7 @@ void Cache::load(const Common::String &name, Common::SeekableReadStream &stream) // Check whether the file is compressed if (signature == MKTAG('L', 'Z', 'V', 26)) { - // It's compressed, so decompress the file and store it's data in the cache entry + // It's compressed, so decompress the file and store its data in the cache entry Common::SeekableReadStream *decompressed = _vm->_res->decompress(stream); cacheEntry.resize(decompressed->size()); decompressed->read(&cacheEntry[0], decompressed->size()); @@ -200,7 +200,7 @@ Common::SeekableReadStream *Resources::load(const Common::String &filename, cons // Open up the library for access Common::SeekableReadStream *libStream = load(libraryFile); - // Check if the library has already had it's index read, and if not, load it + // Check if the library has already had its index read, and if not, load it if (!_indexes.contains(libraryFile)) loadLibraryIndex(libraryFile, libStream, false); LibraryIndex &libIndex = _indexes[libraryFile]; @@ -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 |