diff options
-rw-r--r-- | engines/director/score.cpp | 16 | ||||
-rw-r--r-- | engines/director/score.h | 3 |
2 files changed, 18 insertions, 1 deletions
diff --git a/engines/director/score.cpp b/engines/director/score.cpp index c92c0d0758..4fc946d5c5 100644 --- a/engines/director/score.cpp +++ b/engines/director/score.cpp @@ -693,8 +693,22 @@ void Score::loadActions(Common::SeekableSubReadStreamEndian &stream) { } for (j = _actions.begin(); j != _actions.end(); ++j) - if (!j->_value.empty()) + if (!j->_value.empty()) { _lingo->addCode(j->_value.c_str(), kFrameScript, j->_key); + + processImmediateFrameScript(j->_value, j->_key); + } +} + +bool Score::processImmediateFrameScript(Common::String s, int id) { + s.trim(); + + // In D2/D3 this specifies immediately the sprite/field properties + if (!s.compareToIgnoreCase("moveableSprite") || !s.compareToIgnoreCase("editableText")) { + _immediateActions[id] = true; + } + + return false; } void Score::loadScriptText(Common::SeekableSubReadStreamEndian &stream) { diff --git a/engines/director/score.h b/engines/director/score.h index 83ffecd245..021dcb5577 100644 --- a/engines/director/score.h +++ b/engines/director/score.h @@ -106,6 +106,8 @@ private: Common::String getString(Common::String str); Common::Array<Common::String> loadStrings(Common::SeekableSubReadStreamEndian &stream, uint32 &entryType, bool hasHeader = true); + bool processImmediateFrameScript(Common::String s, int id); + public: Common::Array<Frame *> _frames; Common::HashMap<int, CastType> _castTypes; @@ -113,6 +115,7 @@ public: Common::HashMap<Common::String, int> _castsNames; Common::SortedArray<Label *> *_labels; Common::HashMap<uint16, Common::String> _actions; + Common::HashMap<uint16, bool> _immediateActions; Common::HashMap<uint16, Common::String> _fontMap; Graphics::ManagedSurface *_surface; Graphics::ManagedSurface *_trailSurface; |