[Scummvm-cvs-logs] scummvm master -> 23152571554672ada336cee4311f351e409609dc

dreammaster dreammaster at scummvm.org
Wed Jul 29 02:13:52 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:
2315257155 SHERLOCK: RT: Fix redundant speaker lines in Journal


Commit: 23152571554672ada336cee4311f351e409609dc
    https://github.com/scummvm/scummvm/commit/23152571554672ada336cee4311f351e409609dc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-07-28T20:12:22-04:00

Commit Message:
SHERLOCK: RT: Fix redundant speaker lines in Journal

Changed paths:
    engines/sherlock/journal.cpp



diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index cd97385..cb3941e 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -409,6 +409,8 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
 	bool commentJustPrinted = false;
 	const byte *replyP = (const byte *)statement._reply.c_str();
 	const int inspectorId = (IS_SERRATED_SCALPEL) ? 2 : 18;
+	int beforeLastSpeakerChange = journalString.size();
+	bool justChangedSpeaker = true;
 
 	while (*replyP) {
 		byte c = *replyP++;
@@ -427,15 +429,11 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
 		if (c < opcodes[0]) {
 			// Nope. Set flag for allowing control codes to insert spaces
 			ctrlSpace = true;
+			justChangedSpeaker = false;
 			assert(c >= ' ');
 
 			// Check for embedded comments
 			if (c == '{' || c == '}') {
-
-				// TODO: Rose Tattoo checks if no text was added for the last
-				// comment here. In such a case, the last "XXX said" string is
-				// removed here.
-
 				// Comment characters. If we're starting a comment and there's
 				// already text displayed, add a closing quote
 				if (c == '{' && !startOfReply && !commentJustPrinted)
@@ -497,6 +495,15 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
 				commentJustPrinted = false;
 			}
 		} else if (c == opcodes[OP_SWITCH_SPEAKER]) {
+			if (IS_ROSE_TATTOO) {
+				// If the speaker has just changed, then no text has just been added
+				// from the last speaker, so remove the initial "Person said" text
+				if (justChangedSpeaker)
+					journalString = Common::String(journalString.c_str(), journalString.c_str() + beforeLastSpeakerChange);
+
+				justChangedSpeaker = true;
+			}
+
 			if (!startOfReply) {
 				if (!commentFlag && !commentJustPrinted)
 					journalString += "\"\n";
@@ -656,6 +663,9 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
 	if (!startOfReply && !commentJustPrinted)
 		journalString += '"';
 
+	if (IS_ROSE_TATTOO && justChangedSpeaker)
+		journalString = Common::String(journalString.c_str(), journalString.c_str() + beforeLastSpeakerChange);
+
 	// Finally finished building the journal text. Need to process the text to
 	// word wrap it to fit on-screen. The resulting lines are stored in the
 	// _lines array






More information about the Scummvm-git-logs mailing list