diff options
author | stevenhoefel | 2017-01-12 16:24:12 +1100 |
---|---|---|
committer | stevenhoefel | 2017-01-12 16:24:12 +1100 |
commit | 16439b346f4b0a6e008e61d65af34348d6ce9420 (patch) | |
tree | b30be49d89b4fcb4cd5741ba3e23562d9f2059a5 | |
parent | 70d372603410794d2b7a1c4395423e551fe3e1f7 (diff) | |
download | scummvm-rg350-16439b346f4b0a6e008e61d65af34348d6ce9420.tar.gz scummvm-rg350-16439b346f4b0a6e008e61d65af34348d6ce9420.tar.bz2 scummvm-rg350-16439b346f4b0a6e008e61d65af34348d6ce9420.zip |
DIRECTOR: Use shared cast member data when rendering shared cast item.
-rw-r--r-- | engines/director/frame.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp index ffe004f7a2..8bf71b6c75 100644 --- a/engines/director/frame.cpp +++ b/engines/director/frame.cpp @@ -594,10 +594,16 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) { 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; - uint32 rectTop = static_cast<BitmapCast *>(_sprites[i]->_cast)->initialRect.top; + BitmapCast *bitmapCast = static_cast<BitmapCast *>(_sprites[i]->_cast); + //TODO: might want a quicker way to determine if cast is from Shared Cast. + if (_vm->getSharedBMP() != NULL && _vm->getSharedBMP()->contains(_sprites[i]->_castId + 1024)) { + bitmapCast = static_cast<BitmapCast *>(_vm->getSharedCasts()->getVal(_sprites[i]->_castId)); + } + + uint32 regX = bitmapCast->regX; + uint32 regY = bitmapCast->regY; + uint32 rectLeft = bitmapCast->initialRect.left; + uint32 rectTop = bitmapCast->initialRect.top; int x = _sprites[i]->_startPoint.x - regX + rectLeft; int y = _sprites[i]->_startPoint.y - regY + rectTop; |