aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/journal.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-07-28 20:12:22 -0400
committerPaul Gilbert2015-07-28 20:12:22 -0400
commit23152571554672ada336cee4311f351e409609dc (patch)
tree33148482098a7cca620505871a8c185bf68043ba /engines/sherlock/journal.cpp
parentd021b20e82c0699cc2d168d7026b02bd92735fe1 (diff)
downloadscummvm-rg350-23152571554672ada336cee4311f351e409609dc.tar.gz
scummvm-rg350-23152571554672ada336cee4311f351e409609dc.tar.bz2
scummvm-rg350-23152571554672ada336cee4311f351e409609dc.zip
SHERLOCK: RT: Fix redundant speaker lines in Journal
Diffstat (limited to 'engines/sherlock/journal.cpp')
-rw-r--r--engines/sherlock/journal.cpp20
1 files changed, 15 insertions, 5 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index cd973858ff..cb3941e138 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