aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-05-09 18:19:28 -0400
committerPaul Gilbert2015-05-09 18:19:28 -0400
commit6d110485bc2573db524ceb5aff9f4816d00460b2 (patch)
treef005b61a2b7b23b8f7577be69177a08fc1e5293e
parent13c6feae3538aab7f5bffe2253d34ca256ac8314 (diff)
downloadscummvm-rg350-6d110485bc2573db524ceb5aff9f4816d00460b2.tar.gz
scummvm-rg350-6d110485bc2573db524ceb5aff9f4816d00460b2.tar.bz2
scummvm-rg350-6d110485bc2573db524ceb5aff9f4816d00460b2.zip
SHERLOCK: Performance tweak for resource loading
-rw-r--r--engines/sherlock/map.cpp3
-rw-r--r--engines/sherlock/resources.cpp3
2 files changed, 4 insertions, 2 deletions
diff --git a/engines/sherlock/map.cpp b/engines/sherlock/map.cpp
index 5ef6b9220f..ef262aabd3 100644
--- a/engines/sherlock/map.cpp
+++ b/engines/sherlock/map.cpp
@@ -96,7 +96,8 @@ void Map::loadData() {
// Load the list of location names
Common::SeekableReadStream *txtStream = _vm->_res->load("chess.txt");
- while (txtStream->pos() < txtStream->size()) {
+ int streamSize = txtStream->size();
+ while (txtStream->pos() < streamSize) {
Common::String line;
char c;
while ((c = txtStream->readByte()) != '\0')
diff --git a/engines/sherlock/resources.cpp b/engines/sherlock/resources.cpp
index dd906ba132..3f74590386 100644
--- a/engines/sherlock/resources.cpp
+++ b/engines/sherlock/resources.cpp
@@ -293,7 +293,8 @@ ImageFile::~ImageFile() {
void ImageFile::load(Common::SeekableReadStream &stream, bool skipPalette, bool animImages) {
loadPalette(stream);
- while (stream.pos() < stream.size()) {
+ int streamSize = stream.size();
+ while (stream.pos() < streamSize) {
ImageFrame frame;
frame._width = stream.readUint16LE() + 1;
frame._height = stream.readUint16LE() + 1;