[Scummvm-cvs-logs] scummvm master -> fe362f3fbc0a4df5ba83737f4ba4c1f04943aad1

dreammaster dreammaster at scummvm.org
Mon Aug 17 13:47:07 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:
fe362f3fbc SHERLOCK: RT: Merge setStillSequence & setListenSequence methods


Commit: fe362f3fbc0a4df5ba83737f4ba4c1f04943aad1
    https://github.com/scummvm/scummvm/commit/fe362f3fbc0a4df5ba83737f4ba4c1f04943aad1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-17T07:46:28-04:00

Commit Message:
SHERLOCK: RT: Merge setStillSequence & setListenSequence methods

Changed paths:
    engines/sherlock/people.h
    engines/sherlock/scalpel/scalpel_people.cpp
    engines/sherlock/scalpel/scalpel_people.h
    engines/sherlock/scalpel/scalpel_talk.cpp
    engines/sherlock/talk.cpp
    engines/sherlock/talk.h
    engines/sherlock/tattoo/tattoo_people.h



diff --git a/engines/sherlock/people.h b/engines/sherlock/people.h
index d790e4c..c47d451 100644
--- a/engines/sherlock/people.h
+++ b/engines/sherlock/people.h
@@ -166,6 +166,17 @@ public:
 	 * Restrict passed point to zone using Sherlock's positioning rules
 	 */
 	virtual const Common::Point restrictToZone(int zoneId, const Common::Point &destPos) = 0;
+
+	/**
+	 * If the specified speaker is a background object, it will set it so that it uses 
+	 * the Listen Sequence (specified by the sequence number). If the current sequence 
+	 * has an Allow Talk Code in it, the _gotoSeq field will be set so that the object 
+	 * begins listening as soon as it hits the Allow Talk Code. If there is no Abort Code, 
+	 * the Listen Sequence will begin immediately.
+	 * @param speaker		Who is speaking
+	 * @param sequenceNum	Which listen sequence to use
+	 */
+	virtual void setListenSequence(int speaker, int sequenceNum = 1) = 0;
 };
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/scalpel/scalpel_people.cpp b/engines/sherlock/scalpel/scalpel_people.cpp
index 0b8caf3..0a9d510 100644
--- a/engines/sherlock/scalpel/scalpel_people.cpp
+++ b/engines/sherlock/scalpel/scalpel_people.cpp
@@ -533,6 +533,36 @@ const Common::Point ScalpelPeople::restrictToZone(int zoneId, const Common::Poin
 		(pt.y - delta.y * 2) / FIXED_INT_MULTIPLIER);
 }
 
+void ScalpelPeople::setListenSequence(int speaker, int sequenceNum) {
+	People &people = *_vm->_people;
+	Scene &scene = *_vm->_scene;
+
+	// Don't bother doing anything if no specific speaker is specified
+	if (speaker == -1)
+		return;
+
+	if (speaker) {
+		int objNum = people.findSpeaker(speaker);
+		if (objNum != -1) {
+			Object &obj = scene._bgShapes[objNum];
+
+			if (obj._seqSize < MAX_TALK_SEQUENCES) {
+				warning("Tried to copy too few still frames");
+			} else {
+				for (uint idx = 0; idx < MAX_TALK_SEQUENCES; ++idx) {
+					obj._sequences[idx] = people._characters[speaker]._stillSequences[idx];
+					if (idx > 0 && !people._characters[speaker]._talkSequences[idx] &&
+						!people._characters[speaker]._talkSequences[idx - 1])
+						break;
+				}
+
+				obj._frameNumber = 0;
+				obj._seqTo = 0;
+			}
+		}
+	}
+}
+
 } // End of namespace Scalpel
 
 } // End of namespace Sherlock
diff --git a/engines/sherlock/scalpel/scalpel_people.h b/engines/sherlock/scalpel/scalpel_people.h
index ad9a6a5..941c2dc 100644
--- a/engines/sherlock/scalpel/scalpel_people.h
+++ b/engines/sherlock/scalpel/scalpel_people.h
@@ -110,6 +110,17 @@ public:
 	 * Load the walking images for Sherlock
 	 */
 	virtual bool loadWalk();
+
+	/**
+	 * If the specified speaker is a background object, it will set it so that it uses 
+	 * the Listen Sequence (specified by the sequence number). If the current sequence 
+	 * has an Allow Talk Code in it, the _gotoSeq field will be set so that the object 
+	 * begins listening as soon as it hits the Allow Talk Code. If there is no Abort Code, 
+	 * the Listen Sequence will begin immediately.
+	 * @param speaker		Who is speaking
+	 * @param sequenceNum	Which listen sequence to use
+	 */
+	virtual void setListenSequence(int speaker, int sequenceNum = 1);
 };
 
 } // End of namespace Scalpel
diff --git a/engines/sherlock/scalpel/scalpel_talk.cpp b/engines/sherlock/scalpel/scalpel_talk.cpp
index b844979..61e7364 100644
--- a/engines/sherlock/scalpel/scalpel_talk.cpp
+++ b/engines/sherlock/scalpel/scalpel_talk.cpp
@@ -806,6 +806,7 @@ int ScalpelTalk::talkLine(int lineNum, int stateNum, byte color, int lineY, bool
 
 void ScalpelTalk::showTalk() {
 	FixedText &fixedText = *_vm->_fixedText;
+	People &people = *_vm->_people;
 	ScalpelScreen &screen = *(ScalpelScreen *)_vm->_screen;
 	ScalpelUserInterface &ui = *(ScalpelUserInterface *)_vm->_ui;
 	Common::String fixedText_Exit = fixedText.getText(kFixedText_Window_Exit);
@@ -813,7 +814,7 @@ void ScalpelTalk::showTalk() {
 
 	clearSequences();
 	pushSequence(_talkTo);
-	setStillSeq(_talkTo);
+	people.setListenSequence(_talkTo);
 
 	ui._selector = ui._oldSelector = -1;
 
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index 5213445..a2d6d8a 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -500,7 +500,7 @@ void Talk::talk(int objNum) {
 			Object &obj = scene._bgShapes[objNum];
 			clearSequences();
 			pushSequence(_talkTo);
-			setStillSeq(_talkTo);
+			people.setListenSequence(_talkTo, 129);
 
 			events.setCursor(WAIT);
 			if (obj._lookPosition.y != 0)
@@ -521,7 +521,7 @@ void Talk::talk(int objNum) {
 			Object &obj = scene._bgShapes[objNum];
 			clearSequences();
 			pushSequence(_talkTo);
-			setStillSeq(_talkTo);
+			people.setListenSequence(_talkTo, 129);
 
 			events.setCursor(WAIT);
 			if (obj._lookPosition.y != 0)
@@ -694,36 +694,6 @@ void Talk::pushTalkSequence(Object *obj) {
 	error("Ran out of talk sequence stack space");
 }
 
-void Talk::setStillSeq(int speaker) {
-	People &people = *_vm->_people;
-	Scene &scene = *_vm->_scene;
-
-	// Don't bother doing anything if no specific speaker is specified
-	if (speaker == -1)
-		return;
-
-	if (speaker) {
-		int objNum = people.findSpeaker(speaker);
-		if (objNum != -1) {
-			Object &obj = scene._bgShapes[objNum];
-
-			if (obj._seqSize < MAX_TALK_SEQUENCES) {
-				warning("Tried to copy too few still frames");
-			} else {
-				for (uint idx = 0; idx < MAX_TALK_SEQUENCES; ++idx) {
-					obj._sequences[idx] = people._characters[speaker]._stillSequences[idx];
-					if (idx > 0 && !people._characters[speaker]._talkSequences[idx] &&
-							!people._characters[speaker]._talkSequences[idx - 1])
-						break;
-				}
-
-				obj._frameNumber = 0;
-				obj._seqTo = 0;
-			}
-		}
-	}
-}
-
 void Talk::doScript(const Common::String &script) {
 	People &people = *_vm->_people;
 	Scene &scene = *_vm->_scene;
diff --git a/engines/sherlock/talk.h b/engines/sherlock/talk.h
index d765b80..dcc970a 100644
--- a/engines/sherlock/talk.h
+++ b/engines/sherlock/talk.h
@@ -321,12 +321,6 @@ public:
 	void loadTalkFile(const Common::String &filename);
 
 	/**
-	 * Change the sequence of a background object corresponding to a given speaker.
-	 * The new sequence will display the character as "listening"
-	 */
-	void setStillSeq(int speaker);
-
-	/**
 	 * Clears the stack of pending object sequences associated with speakers in the scene
 	 */
 	void clearSequences();
diff --git a/engines/sherlock/tattoo/tattoo_people.h b/engines/sherlock/tattoo/tattoo_people.h
index 4e57cfe..66123a7 100644
--- a/engines/sherlock/tattoo/tattoo_people.h
+++ b/engines/sherlock/tattoo/tattoo_people.h
@@ -232,17 +232,6 @@ public:
 	TattooPerson &operator[](int idx) { return *(TattooPerson *)_data[idx]; }
 
 	/**
-	 * If the specified speaker is a background object, it will set it so that it uses 
-	 * the Listen Sequence (specified by the sequence number). If the current sequence 
-	 * has an Allow Talk Code in it, the _gotoSeq field will be set so that the object 
-	 * begins listening as soon as it hits the Allow Talk Code. If there is no Abort Code, 
-	 * the Listen Sequence will begin immediately.
-	 * @param speaker		Who is speaking
-	 * @param sequenceNum	Which listen sequence to use
-	 */
-	void setListenSequence(int speaker, int sequenceNum = 1);
-
-	/**
 	 * Restore any saved NPC walk path data from any of the NPCs
 	 */
 	void pullNPCPaths();
@@ -271,6 +260,17 @@ public:
 	 * Restrict passed point to zone using Sherlock's positioning rules
 	 */
 	virtual const Common::Point restrictToZone(int zoneId, const Common::Point &destPos);
+
+	/**
+	 * If the specified speaker is a background object, it will set it so that it uses 
+	 * the Listen Sequence (specified by the sequence number). If the current sequence 
+	 * has an Allow Talk Code in it, the _gotoSeq field will be set so that the object 
+	 * begins listening as soon as it hits the Allow Talk Code. If there is no Abort Code, 
+	 * the Listen Sequence will begin immediately.
+	 * @param speaker		Who is speaking
+	 * @param sequenceNum	Which listen sequence to use
+	 */
+	virtual void setListenSequence(int speaker, int sequenceNum = 1);
 };
 
 } // End of namespace Scalpel






More information about the Scummvm-git-logs mailing list