COMPOSER: Always check resources before loading them
Fixes checking for resources in libraries - bug #10861
This commit is contained in:
parent
ef8b7cf5f3
commit
e45dd70654
1 changed files with 8 additions and 2 deletions
|
@ -92,10 +92,12 @@ void ComposerEngine::loadAnimation(Animation *&anim, uint16 animId, int16 x, int
|
||||||
Pipe *pipe = *j;
|
Pipe *pipe = *j;
|
||||||
if (!pipe->hasResource(ID_ANIM, animId))
|
if (!pipe->hasResource(ID_ANIM, animId))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
stream = pipe->getResource(ID_ANIM, animId, false);
|
stream = pipe->getResource(ID_ANIM, animId, false);
|
||||||
|
|
||||||
// When loading from savegame, make sure we have the correct stream
|
// 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;
|
stream = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -107,10 +109,14 @@ void ComposerEngine::loadAnimation(Animation *&anim, uint16 animId, int16 x, int
|
||||||
}
|
}
|
||||||
Common::List<Library>::iterator j;
|
Common::List<Library>::iterator j;
|
||||||
for (j = _libraries.begin(); j != _libraries.end(); j++) {
|
for (j = _libraries.begin(); j != _libraries.end(); j++) {
|
||||||
|
if (!j->_archive->hasResource(ID_ANIM, animId))
|
||||||
|
continue;
|
||||||
|
|
||||||
stream = j->_archive->getResource(ID_ANIM, animId);
|
stream = j->_archive->getResource(ID_ANIM, animId);
|
||||||
|
|
||||||
// When loading from savegame, make sure we have the correct stream
|
// 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;
|
stream = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue