aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock/journal.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2016-01-27 21:47:24 -0500
committerPaul Gilbert2016-01-27 21:47:24 -0500
commit314379e9291f5f30fddc1fded6efd330a16da8c2 (patch)
treefccfa240b165df6d350a9687001549923eef68b4 /engines/sherlock/journal.cpp
parent2eecbe68fa9f1ba80e7c78fd578e4b95577e7d3a (diff)
downloadscummvm-rg350-314379e9291f5f30fddc1fded6efd330a16da8c2.tar.gz
scummvm-rg350-314379e9291f5f30fddc1fded6efd330a16da8c2.tar.bz2
scummvm-rg350-314379e9291f5f30fddc1fded6efd330a16da8c2.zip
SHERLOCK: SS: Fix German accents not showing in journal
Diffstat (limited to 'engines/sherlock/journal.cpp')
-rw-r--r--engines/sherlock/journal.cpp23
1 files changed, 21 insertions, 2 deletions
diff --git a/engines/sherlock/journal.cpp b/engines/sherlock/journal.cpp
index c4aaa07a73..3312422b92 100644
--- a/engines/sherlock/journal.cpp
+++ b/engines/sherlock/journal.cpp
@@ -424,7 +424,7 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
}
// Is it a control character?
- if (c < opcodes[0]) {
+ if (isPrintable(c)) {
// Nope. Set flag for allowing control codes to insert spaces
ctrlSpace = true;
justChangedSpeaker = false;
@@ -486,7 +486,7 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
// Copy text from the place until either the reply ends, a comment
// {} block is started, or a control character is encountered
journalString += c;
- while (*replyP && *replyP < opcodes[0] && *replyP != '{' && *replyP != '}') {
+ while (*replyP && isPrintable(*replyP) && *replyP != '{' && *replyP != '}') {
journalString += *replyP++;
}
@@ -706,6 +706,25 @@ void Journal::loadJournalFile(bool alreadyLoaded) {
}
}
+bool Journal::isPrintable(char ch) const {
+ Talk &talk = *_vm->_talk;
+ const byte *opcodes = talk._opcodes;
+
+ // Okay.. there is freaky stuff going among the various different languages
+ // and across the two games as to which characters are printable, and which
+ // are opcodes, and which are not opcodes but shouldn't be printed anyway.
+ // I don't want to end up breaking stuff, so this method acts as a bit of a
+ // kludge to get German accents working in the Journal
+ if (ch < opcodes[0])
+ return true;
+
+ if (_vm->getGameID() == GType_SerratedScalpel && _vm->getLanguage() == Common::DE_DEU
+ && ch >= 0xe0)
+ return true;
+
+ return false;
+}
+
void Journal::record(int converseNum, int statementNum, bool replyOnly) {
int saveIndex = _index;
int saveSub = _sub;