aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/scalpel
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-16 21:43:12 -0400
committerPaul Gilbert2015-08-16 21:43:12 -0400
commitc14f27aa48f89ec1a903effe87d03029c90060c1 (patch)
tree7d22285f08a0aa71d512580be325e1a4bd396530 /engines/sherlock/scalpel
parent28dc37e627814a15bff752bea2cf9a0492559e6a (diff)
downloadscummvm-rg350-c14f27aa48f89ec1a903effe87d03029c90060c1.tar.gz
scummvm-rg350-c14f27aa48f89ec1a903effe87d03029c90060c1.tar.bz2
scummvm-rg350-c14f27aa48f89ec1a903effe87d03029c90060c1.zip
SHERLOCK: RT: Add missing talk sequence stack handling
Diffstat (limited to 'engines/sherlock/scalpel')
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.cpp22
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.h6
2 files changed, 28 insertions, 0 deletions
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index 2fd9ede763..b844979ffb 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -878,6 +878,28 @@ OpcodeReturn ScalpelTalk::cmdCallTalkFile(const byte *&str) {
return RET_SUCCESS;
}
+void ScalpelTalk::pullSequence() {
+ Scene &scene = *_vm->_scene;
+
+ if (_sequenceStack.empty())
+ return;
+
+ SequenceEntry seq = _sequenceStack.pop();
+ if (seq._objNum != -1) {
+ Object &obj = scene._bgShapes[seq._objNum];
+
+ if (obj._seqSize < MAX_TALK_SEQUENCES) {
+ warning("Tried to restore too few frames");
+ } else {
+ for (int idx = 0; idx < MAX_TALK_SEQUENCES; ++idx)
+ obj._sequences[idx] = seq._sequences[idx];
+
+ obj._frameNumber = seq._frameNumber;
+ obj._seqTo = seq._seqTo;
+ }
+ }
+}
+
} // End of namespace Scalpel
} // End of namespace Sherlock
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index 7ef67050d0..6f8b62cd2f 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -101,6 +101,12 @@ public:
* Trigger to play a 3DO talk dialog movie
*/
void talk3DOMovieTrigger(int subIndex);
+
+ /**
+ * Pulls a background object sequence from the sequence stack and restore's the
+ * object's sequence
+ */
+ virtual void pullSequence();
};
} // End of namespace Scalpel