aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2015-08-02 15:14:22 -0400
committerPaul Gilbert2015-08-02 15:14:22 -0400
commit7765cdb9724db38c1046efc46b06326a451b00f2 (patch)
tree72f69a9899030ab81028beccab956bbcf5ae887f
parent1e3313580f5e4fff2896c5a02214775c399a4c9b (diff)
downloadscummvm-rg350-7765cdb9724db38c1046efc46b06326a451b00f2.tar.gz
scummvm-rg350-7765cdb9724db38c1046efc46b06326a451b00f2.tar.bz2
scummvm-rg350-7765cdb9724db38c1046efc46b06326a451b00f2.zip
SHERLOCK: RT: Implement Tattoo cmdCallTalkFile
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.cpp35
-rw-r--r--engines/sherlock/scalpel/scalpel_talk.h1
-rw-r--r--engines/sherlock/talk.cpp36
-rw-r--r--engines/sherlock/talk.h1
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.cpp25
-rw-r--r--engines/sherlock/tattoo/tattoo_talk.h1
6 files changed, 62 insertions, 37 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
diff --git a/engines/sherlock/scalpel/scalpel_talk.h b/engines/sherlock/scalpel/scalpel_talk.h
index 24188d8fcd..dede117337 100644
--- a/engines/sherlock/scalpel/scalpel_talk.h
+++ b/engines/sherlock/scalpel/scalpel_talk.h
@@ -40,6 +40,7 @@ private:
OpcodeReturn cmdSwitchSpeaker(const byte *&str);
OpcodeReturn cmdAssignPortraitLocation(const byte *&str);
OpcodeReturn cmdGotoScene(const byte *&str);
+ OpcodeReturn cmdCallTalkFile(const byte *&str);
OpcodeReturn cmdClearInfoLine(const byte *&str);
OpcodeReturn cmdClearWindow(const byte *&str);
OpcodeReturn cmdDisplayInfoLine(const byte *&str);
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index d259182a70..e901280ee9 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -1092,42 +1092,6 @@ OpcodeReturn Talk::cmdBanishWindow(const byte *&str) {
return RET_SUCCESS;
}
-OpcodeReturn Talk::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;
-}
-
OpcodeReturn Talk::cmdDisableEndKey(const byte *&str) {
_vm->_ui->_endKeyActive = false;
return RET_SUCCESS;
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index ddb81f1b04..8364bbf6dd 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -208,7 +208,6 @@ protected:
OpcodeReturn cmdAddItemToInventory(const byte *&str);
OpcodeReturn cmdAdjustObjectSequence(const byte *&str);
OpcodeReturn cmdBanishWindow(const byte *&str);
- OpcodeReturn cmdCallTalkFile(const byte *&str);
OpcodeReturn cmdDisableEndKey(const byte *&str);
OpcodeReturn cmdEnableEndKey(const byte *&str);
OpcodeReturn cmdEndTextWindow(const byte *&str);
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 8303fd42ad..260aee8857 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -877,6 +877,31 @@ OpcodeReturn TattooTalk::cmdWalkHomesAndNPCToCoords(const byte *&str) {
return RET_SUCCESS;
}
+OpcodeReturn TattooTalk::cmdCallTalkFile(const byte *&str) {
+ TattooPeople &people = *(TattooPeople *)_vm->_people;
+ Common::String tempString;
+
+ int npc = *++str;
+ assert(npc >= 1 && npc < MAX_CHARACTERS);
+ TattooPerson &person = people[npc];
+
+ if (person._resetNPCPath) {
+ person._npcIndex = person._npcPause = 0;
+ person._resetNPCPath = false;
+ Common::fill(&person._npcPath[0], &person._npcPath[100], 0);
+ }
+
+ // Set the path control code and copy the filename
+ person._npcPath[person._npcIndex] = 4;
+ for (int idx = 1; idx <= 8; ++idx)
+ person._npcPath[person._npcIndex + idx] = str[idx];
+
+ person._npcIndex += 9;
+ str += 8;
+
+ return RET_SUCCESS;
+}
+
} // End of namespace Tattoo
} // End of namespace Sherlock
diff --git a/engines/sherlock/tattoo/tattoo_talk.h b/engines/sherlock/tattoo/tattoo_talk.h
index 8abbb1b8be..64a329e3f8 100644
--- a/engines/sherlock/tattoo/tattoo_talk.h
+++ b/engines/sherlock/tattoo/tattoo_talk.h
@@ -43,6 +43,7 @@ class TattooTalk : public Talk {
private:
WidgetTalk _talkWidget;
+ OpcodeReturn cmdCallTalkFile(const byte *&str);
OpcodeReturn cmdSwitchSpeaker(const byte *&str);
OpcodeReturn cmdMouseOnOff(const byte *&str);
OpcodeReturn cmdGotoScene(const byte *&str);