aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2019-03-10 04:51:39 +0200
committerFilippos Karapetis2019-03-10 04:51:39 +0200
commite45dd70654e6537b4873f1b6c7b7b1b924f21d84 (patch)
treedd7f3e3b0673dca369f7bf7f98b0c870c54df601
parentef8b7cf5f38594adf49709eb883dce83a6800764 (diff)
downloadscummvm-rg350-e45dd70654e6537b4873f1b6c7b7b1b924f21d84.tar.gz
scummvm-rg350-e45dd70654e6537b4873f1b6c7b7b1b924f21d84.tar.bz2
scummvm-rg350-e45dd70654e6537b4873f1b6c7b7b1b924f21d84.zip
COMPOSER: Always check resources before loading them
Fixes checking for resources in libraries - bug #10861
-rw-r--r--engines/composer/graphics.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/composer/graphics.cpp b/engines/composer/graphics.cpp
index 32b9812f32..b95a6bc567 100644
--- a/engines/composer/graphics.cpp
+++ b/engines/composer/graphics.cpp
@@ -92,10 +92,12 @@ void ComposerEngine::loadAnimation(Animation *&anim, uint16 animId, int16 x, int
Pipe *pipe = *j;
if (!pipe->hasResource(ID_ANIM, animId))
continue;
+
stream = pipe->getResource(ID_ANIM, animId, false);
// When loading from savegame, make sure we have the correct stream
- if ((!size) || (stream->size() >= size)) break;
+ if ((!size) || (stream->size() >= size))
+ break;
stream = NULL;
}
@@ -107,10 +109,14 @@ void ComposerEngine::loadAnimation(Animation *&anim, uint16 animId, int16 x, int
}
Common::List<Library>::iterator j;
for (j = _libraries.begin(); j != _libraries.end(); j++) {
+ if (!j->_archive->hasResource(ID_ANIM, animId))
+ continue;
+
stream = j->_archive->getResource(ID_ANIM, animId);
// When loading from savegame, make sure we have the correct stream
- if ((!size) || (stream->size() >= size)) break;
+ if ((!size) || (stream->size() >= size))
+ break;
stream = NULL;
}