aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/scalpel/scalpel_talk.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-02 15:14:22 -0400
committerPaul Gilbert2015-08-02 15:14:22 -0400
commit7765cdb9724db38c1046efc46b06326a451b00f2 (patch)
tree72f69a9899030ab81028beccab956bbcf5ae887f /engines/sherlock/scalpel/scalpel_talk.cpp
parent1e3313580f5e4fff2896c5a02214775c399a4c9b (diff)
downloadscummvm-rg350-7765cdb9724db38c1046efc46b06326a451b00f2.tar.gz
scummvm-rg350-7765cdb9724db38c1046efc46b06326a451b00f2.tar.bz2
scummvm-rg350-7765cdb9724db38c1046efc46b06326a451b00f2.zip
SHERLOCK: RT: Implement Tattoo cmdCallTalkFile
Diffstat (limited to 'engines/sherlock/scalpel/scalpel_talk.cpp')
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.cpp35
1 files changed, 35 insertions, 0 deletions
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index f9a10ebc70..d85820e3dc 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -839,6 +839,41 @@ void ScalpelTalk::showTalk() {
}
}
+OpcodeReturn ScalpelTalk::cmdCallTalkFile(const byte *&str) {
+ Common::String tempString;
+
+ ++str;
+ for (int idx = 0; idx < 8 && str[idx] != '~'; ++idx)
+ tempString += str[idx];
+ str += 8;
+
+ int scriptCurrentIndex = str - _scriptStart;
+
+ // Save the current script position and new talk file
+ if (_scriptStack.size() < 9) {
+ ScriptStackEntry rec1;
+ rec1._name = _scriptName;
+ rec1._currentIndex = scriptCurrentIndex;
+ rec1._select = _scriptSelect;
+ _scriptStack.push(rec1);
+
+ // Push the new talk file onto the stack
+ ScriptStackEntry rec2;
+ rec2._name = tempString;
+ rec2._currentIndex = 0;
+ rec2._select = 100;
+ _scriptStack.push(rec2);
+ } else {
+ error("Script stack overflow");
+ }
+
+ _scriptMoreFlag = 1;
+ _endStr = true;
+ _wait = 0;
+
+ return RET_SUCCESS;
+}
+
} // End of namespace Scalpel
} // End of namespace Sherlock