diff options
author | Tobia Tesan | 2017-05-01 00:03:00 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2017-05-02 21:01:23 +0100 |
commit | 84a65f9df0d895d841cad3191302ea592809af2d (patch) | |
tree | 2f1c3c4d403d64c92352c71a5a97a4f832fd94f8 /engines | |
parent | bad6cc32ef0ee2ff36ca3f67b2104d33b14084e9 (diff) | |
download | scummvm-rg350-84a65f9df0d895d841cad3191302ea592809af2d.tar.gz scummvm-rg350-84a65f9df0d895d841cad3191302ea592809af2d.tar.bz2 scummvm-rg350-84a65f9df0d895d841cad3191302ea592809af2d.zip |
DIRECTOR: Init textCasts with Stxts in Score
Diffstat (limited to 'engines')
-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); |