diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 5b949c66ca6..5f05bf8c302 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -827,6 +827,7 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) { sprite->_blend = d.asInt(); break; case kTheCastNum: + score->unrenderSprite(id); sprite->setCast(d.asInt()); break; case kTheConstraint: diff --git a/engines/director/score.cpp b/engines/director/score.cpp index cbc89f11e32..5dba144461d 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -566,15 +566,11 @@ void Score::renderFrame(uint16 frameId, bool forceUpdate, bool updateStageOnly) needsUpdate = needsUpdate || (currentSprite->_ink == kInkTypeReverse); if (needsUpdate || forceUpdate) { - if (!currentSprite->_trails) { - Common::Rect currentBbox = channel->getBbox(); - _maskSurface->fillRect(currentBbox, 1); - _surface->fillRect(currentBbox, _stageColor); - } - } + unrenderSprite(i); - channel->_sprite = nextSprite; - channel->updateLocation(); + channel->_sprite = nextSprite; + channel->updateLocation(); + } } for (uint id = 0; id < _channels.size(); id++) { @@ -588,7 +584,7 @@ void Score::renderFrame(uint16 frameId, bool forceUpdate, bool updateStageOnly) // Sprites marked moveable are constrained to the same bounding box until // the moveable is disabled - if (!sprite->_moveable) + if (!sprite->_puppet && !sprite->_moveable) channel->_currentPoint = sprite->_startPoint; Common::Rect currentBbox = channel->getBbox(); @@ -630,6 +626,17 @@ void Score::renderFrame(uint16 frameId, bool forceUpdate, bool updateStageOnly) g_system->copyRectToScreen(_surface->getPixels(), _surface->pitch, 0, 0, _surface->getBounds().width(), _surface->getBounds().height()); } +void Score::unrenderSprite(int spriteId) { + Channel *channel = _channels[spriteId]; + Sprite *currentSprite = channel->_sprite; + + if (!currentSprite->_trails) { + Common::Rect currentBbox = channel->getBbox(); + _maskSurface->fillRect(currentBbox, 1); + _surface->fillRect(currentBbox, _stageColor); + } +} + void Score::renderShape(uint16 spriteId) { Sprite *sp = _channels[spriteId]->_sprite; diff --git a/engines/director/score.h b/engines/director/score.h index a9375b46113..20a1dcb57a6 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -146,6 +146,7 @@ public: Cast *getCastMember(int castId); const Stxt *getStxt(int castId); void renderFrame(uint16 frameId, bool forceUpdate = false, bool updateStageOnly = false); + void unrenderSprite(int spriteId); private: void update();