diff options
author | Paul Gilbert | 2015-04-12 19:11:34 -0500 |
---|---|---|
committer | Paul Gilbert | 2015-04-12 19:11:34 -0500 |
commit | e8e095aa2ad7f3914b3b8dd4826c2d13e35b1163 (patch) | |
tree | 83970913f1e2ed77073f683bb62a52ae30355c26 /engines | |
parent | c9890cbacc7bf6a1216cadf6eddc04832f0ebbe4 (diff) | |
download | scummvm-rg350-e8e095aa2ad7f3914b3b8dd4826c2d13e35b1163.tar.gz scummvm-rg350-e8e095aa2ad7f3914b3b8dd4826c2d13e35b1163.tar.bz2 scummvm-rg350-e8e095aa2ad7f3914b3b8dd4826c2d13e35b1163.zip |
SHERLOCK: Fix mixups with sequence stack and script stack
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sherlock/talk.cpp | 6 | ||||
-rw-r--r-- | engines/sherlock/talk.h | 3 | ||||
-rw-r--r-- | engines/sherlock/user_interface.cpp | 8 |
3 files changed, 9 insertions, 8 deletions
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp index 281b6b4672..a40d3ace2d 100644 --- a/engines/sherlock/talk.cpp +++ b/engines/sherlock/talk.cpp @@ -883,7 +883,7 @@ void Talk::pullSequence() { if (_scriptStack.empty()) return; - SequenceEntry seq = _scriptStack.pop(); + SequenceEntry seq = _sequenceStack.pop(); if (seq._objNum != -1) { Object &obj = scene._bgShapes[seq._objNum]; @@ -911,7 +911,7 @@ void Talk::pushSequence(int speaker) { if (speaker == -1) return; - ScriptStackEntry seqEntry; + SequenceEntry seqEntry; if (!speaker) { seqEntry._objNum = -1; } else { @@ -925,7 +925,7 @@ void Talk::pushSequence(int speaker) { seqEntry._seqTo = obj._seqTo; } - _scriptStack.push(seqEntry); + _sequenceStack.push(seqEntry); if (_scriptStack.size() >= 5) error("script stack overflow"); } diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h index c4b5fe46d2..bf4f12675c 100644 --- a/engines/sherlock/talk.h +++ b/engines/sherlock/talk.h @@ -40,7 +40,7 @@ struct SequenceEntry { int _seqTo; }; -struct ScriptStackEntry : public SequenceEntry { +struct ScriptStackEntry { Common::String _name; int _currentIndex; int _select; @@ -90,6 +90,7 @@ private: SherlockEngine *_vm; int _saveSeqNum; Common::Stack<SequenceEntry> _savedSequences; + Common::Stack<SequenceEntry> _sequenceStack; Common::Stack<ScriptStackEntry> _scriptStack; Common::Array<Statement> _statements; TalkHistoryEntry _talkHistory[500]; diff --git a/engines/sherlock/user_interface.cpp b/engines/sherlock/user_interface.cpp index 70f284c359..e20813822e 100644 --- a/engines/sherlock/user_interface.cpp +++ b/engines/sherlock/user_interface.cpp @@ -1233,7 +1233,6 @@ void UserInterface::doTalkControl() { Screen &screen = *_vm->_screen; Sound &sound = *_vm->_sound; Talk &talk = *_vm->_talk; - UserInterface &ui = *_vm->_ui; Common::Point mousePos = events.mousePos(); int select; @@ -1470,9 +1469,10 @@ void UserInterface::doTalkControl() { // If a script was pushed onto the script stack, restore it if (!talk._scriptStack.empty()) { - SequenceEntry seqEntry = talk._scriptStack.pop(); -// talk._scriptName = seqEntry. - // TODO + ScriptStackEntry stackEntry = talk._scriptStack.pop(); + talk._scriptName = stackEntry._name; + talk._scriptSaveIndex = stackEntry._currentIndex; + talk._scriptSelect = stackEntry._select; } } } |