diff options
-rw-r--r-- | engines/director/score.cpp | 24 | ||||
-rw-r--r-- | engines/director/score.h | 1 |
2 files changed, 25 insertions, 0 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index 65a343910d..7decd6b3f2 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -198,6 +198,30 @@ void Score::loadArchive() { ); } } + copyCastStxts(); + } +} + +void copyStxt(TextCast *textCast, const Stxt *stxt) { + textCast->fontId = stxt->_fontId; + textCast->textSlant = stxt->_textSlant; + textCast->fontSize = stxt->_fontSize; + textCast->palinfo1 = stxt->_palinfo1; + textCast->palinfo2 = stxt->_palinfo2; + textCast->palinfo3 = stxt->_palinfo3; + textCast->_ftext = stxt->_ftext; +} + +void Score::copyCastStxts() { + Common::HashMap<int, TextCast *>::iterator tc; + for (tc = _loadedText->begin(); tc != _loadedText->end(); ++tc) { + uint stxtid = (_vm->getVersion() < 4) ? + tc->_key + 1024 : + tc->_value->children[0].index; + if (_loadedStxts->getVal(stxtid)){ + const Stxt *stxt = _loadedStxts->getVal(stxtid); + copyStxt(tc->_value, stxt); + } } } diff --git a/engines/director/score.h b/engines/director/score.h index cd1f4889bb..b091774ce4 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -83,6 +83,7 @@ public: Sprite *getSpriteById(uint16 id); void setSpriteCasts(); void loadSpriteImages(bool isSharedCast); + void copyCastStxts(); Graphics::ManagedSurface *getSurface() { return _surface; } void loadCastInto(Sprite *sprite, int castId); |