Skip to content

Commit

Permalink
DIRECTOR: Fix cast data reading
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry Iskrich authored and sev- committed Aug 3, 2016
1 parent fb6e062 commit 2e87ca4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions engines/director/score.cpp
Expand Up @@ -84,11 +84,10 @@ void Score::readVersion(uint32 rid) {
}

void Score::loadCastData(Common::SeekableReadStream &stream) {
for (uint16 id = _castArrayStart; id < _castArrayEnd; id++) {
for (uint16 id = _castArrayStart; id <= _castArrayEnd; id++) {
byte size = stream.readByte();
if (size == 0)
continue;

uint8 castType = stream.readByte();
switch (castType) {
case kCastBitmap:
Expand Down Expand Up @@ -410,6 +409,11 @@ void Frame::display(Archive &_movie, Graphics::ManagedSurface &surface, Common::
DIBDecoder img;
//TODO check cast type
uint32 imgId = 1024 + _sprites[i]->_castId;
//TODO looks like bad file?
if (!_movie.hasResource(MKTAG('D', 'I', 'B', ' '), imgId)) {
continue;
}

img.loadStream(*_movie.getResource(MKTAG('D', 'I', 'B', ' '), imgId));

uint32 regX = static_cast<BitmapCast *>(_sprites[i]->_cast)->regX;
Expand Down

0 comments on commit 2e87ca4

Please sign in to comment.