aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2018-05-05 14:36:14 -0400
committerPaul Gilbert2018-05-05 14:36:14 -0400
commitafc48cfb0ec2ce3e87b7121f5616bc01f6281284 (patch)
treec5eb4e891edd6fb2fc0a395868c0151f198a7dc0 /engines/sherlock
parentf2d80f4ae3bf2b529aa0af57b45c0023dfbf12e2 (diff)
downloadscummvm-rg350-afc48cfb0ec2ce3e87b7121f5616bc01f6281284.tar.gz
scummvm-rg350-afc48cfb0ec2ce3e87b7121f5616bc01f6281284.tar.bz2
scummvm-rg350-afc48cfb0ec2ce3e87b7121f5616bc01f6281284.zip
Revert "SHERLOCK: Disable cache for uncompressed resources"
This reverts commit 20d5a67f8b71c668ca304b85c1d8b91759922031.
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/resources.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/engines/sherlock/resources.cpp b/engines/sherlock/resources.cpp
index 9ed6951fbe..ec7d60a1a2 100644
--- a/engines/sherlock/resources.cpp
+++ b/engines/sherlock/resources.cpp
@@ -57,23 +57,24 @@ void Cache::load(const Common::String &name, Common::SeekableReadStream &stream)
int32 signature = stream.readUint32BE();
stream.seek(0);
-
- // Check whether the file is compressed
- if (signature == MKTAG('L', 'Z', 'V', 26)) {
- // Allocate a new cache entry
- _resources[name] = CacheEntry();
- CacheEntry &cacheEntry = _resources[name];
+ // Allocate a new cache entry
+ _resources[name] = CacheEntry();
+ CacheEntry &cacheEntry = _resources[name];
+ // Check whether the file is compressed
+ if (signature == MKTAG('L', 'Z', 'V', 26)) {
// 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());
delete decompressed;
-
+ } else {
+ // It's not, so read the raw data of the file into the cache entry
+ cacheEntry.resize(stream.size());
+ stream.read(&cacheEntry[0], stream.size());
}
-
}
Common::SeekableReadStream *Cache::get(const Common::String &filename) const {