[Scummvm-cvs-logs] scummvm master -> 7765cdb9724db38c1046efc46b06326a451b00f2

dreammaster dreammaster at scummvm.org
Sun Aug 2 21:16:12 CEST 2015


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
7765cdb972 SHERLOCK: RT: Implement Tattoo cmdCallTalkFile


Commit: 7765cdb9724db38c1046efc46b06326a451b00f2
    https://github.com/scummvm/scummvm/commit/7765cdb9724db38c1046efc46b06326a451b00f2
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-02T15:14:22-04:00

Commit Message:
SHERLOCK: RT: Implement Tattoo cmdCallTalkFile

Changed paths:
    engines/sherlock/scalpel/scalpel_talk.cpp
    engines/sherlock/scalpel/scalpel_talk.h
    engines/sherlock/talk.cpp
    engines/sherlock/talk.h
    engines/sherlock/tattoo/tattoo_talk.cpp
    engines/sherlock/tattoo/tattoo_talk.h



diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index f9a10eb..d85820e 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 24188d8..dede117 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 d259182..e901280 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 ddb81f1..8364bbf 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 8303fd4..260aee8 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 8abbb1b..64a329e 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);






More information about the Scummvm-git-logs mailing list