From 84a65f9df0d895d841cad3191302ea592809af2d Mon Sep 17 00:00:00 2001 From: Tobia Tesan Date: Mon, 1 May 2017 00:03:00 +0200 Subject: DIRECTOR: Init textCasts with Stxts in Score --- engines/director/score.cpp | 24 ++++++++++++++++++++++++ engines/director/score.h | 1 + 2 files changed, 25 insertions(+) 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::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); -- cgit v1.2.3