From 7765cdb9724db38c1046efc46b06326a451b00f2 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 2 Aug 2015 15:14:22 -0400 Subject: SHERLOCK: RT: Implement Tattoo cmdCallTalkFile --- engines/sherlock/scalpel/scalpel_talk.cpp | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'engines/sherlock/scalpel/scalpel_talk.cpp') 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 -- cgit v1.2.3