diff options
-rw-r--r-- | engines/director/frame.cpp | 5 | ||||
-rw-r--r-- | engines/director/resource.cpp | 2 | ||||
-rw-r--r-- | engines/director/score.cpp | 2 | ||||
-rw-r--r-- | engines/director/score.h | 1 |
4 files changed, 9 insertions, 1 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index 6464943d99..cccfb375c8 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -559,6 +559,8 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) { continue; } + assert(_sprites[i]->_cast); + uint32 regX = static_cast<BitmapCast *>(_sprites[i]->_cast)->regX; uint32 regY = static_cast<BitmapCast *>(_sprites[i]->_cast)->regY; uint32 rectLeft = static_cast<BitmapCast *>(_sprites[i]->_cast)->initialRect.left; @@ -646,9 +648,10 @@ Image::ImageDecoder *Frame::getImageFrom(uint16 spriteId) { } if (_vm->_currentScore->getArchive()->hasResource(MKTAG('B', 'I', 'T', 'D'), imgId)) { + warning("************"); Common::SeekableReadStream *pic = _vm->_currentScore->getArchive()->getResource(MKTAG('B', 'I', 'T', 'D'), imgId); - if (_vm->getVersion() < 4) { + if (_vm->getVersion() <= 4) { BitmapCast *bc = static_cast<BitmapCast *>(_vm->_currentScore->_casts[spriteId]); int w = bc->initialRect.width(), h = bc->initialRect.height(); diff --git a/engines/director/resource.cpp b/engines/director/resource.cpp index 54ab2198e1..2f8ef3e432 100644 --- a/engines/director/resource.cpp +++ b/engines/director/resource.cpp @@ -220,6 +220,8 @@ void DirectorEngine::loadSharedCastsFrom(Common::String filename) { castScore->loadCastData(*shardcst->getResource(MKTAG('C','A','S','t'), *iterator), *iterator); } + castScore->setSpriteCasts(); + _sharedCasts = &castScore->_casts; Common::Array<uint16> dib = shardcst->getResourceIDList(MKTAG('D','I','B',' ')); diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 1c78745330..f145364882 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -381,7 +381,9 @@ void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) { break; } } +} +void Score::setSpriteCasts() { // Set cast pointers to sprites for (uint16 i = 0; i < _frames.size(); i++) { for (uint16 j = 0; j < _frames[i]->_sprites.size(); j++) { diff --git a/engines/director/score.h b/engines/director/score.h index 9f6088307b..49e4f357b0 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -72,6 +72,7 @@ public: int getCurrentFrame() { return _currentFrame; } Common::String getMacName() const { return _macName; } Sprite *getSpriteById(uint16 id); + void setSpriteCasts(); private: void update(); |