diff options
author | Eugene Sandulenko | 2017-03-14 09:16:19 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2017-03-14 09:26:20 +0100 |
commit | f981e228c15e88a0be1d9f4df068be6de5fde43c (patch) | |
tree | 051de3ba0ecb61c51c061c7658773fa4fae1482c /engines/director | |
parent | db7f5c4553bd1a451055aefcb0d40036c3fca75f (diff) | |
download | scummvm-rg350-f981e228c15e88a0be1d9f4df068be6de5fde43c.tar.gz scummvm-rg350-f981e228c15e88a0be1d9f4df068be6de5fde43c.tar.bz2 scummvm-rg350-f981e228c15e88a0be1d9f4df068be6de5fde43c.zip |
DIRECTOR: Detect immediate Lingo actions
Diffstat (limited to 'engines/director')
-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; |