diff options
author | Dmitry Iskrich | 2016-06-26 21:19:17 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 9ba86b960c9e18c2ee021e6ef81e4ca6e71803b1 (patch) | |
tree | cb2a21fc17fad914378b0208371754efb69b33ab /engines/director/score.cpp | |
parent | cc9d17c5eb9db7fc52d8407e401a14072ab9c5d7 (diff) | |
download | scummvm-rg350-9ba86b960c9e18c2ee021e6ef81e4ca6e71803b1.tar.gz scummvm-rg350-9ba86b960c9e18c2ee021e6ef81e4ca6e71803b1.tar.bz2 scummvm-rg350-9ba86b960c9e18c2ee021e6ef81e4ca6e71803b1.zip |
DIRECTOR: Refactoring renderSprite
Diffstat (limited to 'engines/director/score.cpp')
-rw-r--r-- | engines/director/score.cpp | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index da220439ea..6d5247ff98 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -328,6 +328,7 @@ void Score::loadScriptText(Common::SeekableReadStream &stream) { } script += ch; } + if (script != "") _lingo->addCode(script, kMovieScript, _movieScriptCount); @@ -888,8 +889,8 @@ void Frame::readSprite(Common::SeekableReadStream &stream, uint16 offset, uint16 } void Frame::prepareFrame(Score *score) { - renderSprites(*score->_movieArchive, *score->_surface, score->_movieRect, false); - renderSprites(*score->_movieArchive, *score->_trailSurface, score->_movieRect, true); + renderSprites(*score->_surface, false); + renderSprites(*score->_trailSurface, true); if (_transType != 0) //TODO Handle changing area case @@ -1051,20 +1052,26 @@ void Frame::playTransition(Score *score) { } } -void Frame::renderSprites(Archive &_movie, Graphics::ManagedSurface &surface, Common::Rect movieRect, bool renderTrail) { +void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) { for (uint16 i = 0; i < CHANNEL_COUNT; i++) { if (_sprites[i]->_enabled) { if ((_sprites[i]->_trails == 0 && renderTrail) || (_sprites[i]->_trails == 1 && !renderTrail)) continue; + Cast *cast = _vm->_currentScore->_casts[_sprites[i]->_castId]; + if (cast->type == kCastText) { + renderText(surface, i); + continue; + } + DIBDecoder img; uint32 imgId = 1024 + _sprites[i]->_castId; - if (!_movie.hasResource(MKTAG('D', 'I', 'B', ' '), imgId)) { + if (!_vm->_currentScore->getArchive()->hasResource(MKTAG('D', 'I', 'B', ' '), imgId)) { continue; } - img.loadStream(*_movie.getResource(MKTAG('D', 'I', 'B', ' '), imgId)); + img.loadStream(*_vm->_currentScore->getArchive()->getResource(MKTAG('D', 'I', 'B', ' '), imgId)); uint32 regX = static_cast<BitmapCast *>(_sprites[i]->_cast)->regX; uint32 regY = static_cast<BitmapCast *>(_sprites[i]->_cast)->regY; @@ -1104,6 +1111,10 @@ void Frame::renderSprites(Archive &_movie, Graphics::ManagedSurface &surface, Co } } +void Frame::renderText(Graphics::ManagedSurface &surface, uint16 spriteID) { + warning("STUB: renderText()"); +} + void Frame::drawBackgndTransSprite(Graphics::ManagedSurface &target, const Graphics::Surface &sprite, Common::Rect &drawRect) { uint8 skipColor = _vm->getPaletteColorCount() - 1; //FIXME is it always white (last entry in pallette) ? |