diff options
author | Paul Gilbert | 2016-01-27 21:47:24 -0500 |
---|---|---|
committer | Paul Gilbert | 2016-01-27 21:47:24 -0500 |
commit | 314379e9291f5f30fddc1fded6efd330a16da8c2 (patch) | |
tree | fccfa240b165df6d350a9687001549923eef68b4 | |
parent | 2eecbe68fa9f1ba80e7c78fd578e4b95577e7d3a (diff) | |
download | scummvm-rg350-314379e9291f5f30fddc1fded6efd330a16da8c2.tar.gz scummvm-rg350-314379e9291f5f30fddc1fded6efd330a16da8c2.tar.bz2 scummvm-rg350-314379e9291f5f30fddc1fded6efd330a16da8c2.zip |
SHERLOCK: SS: Fix German accents not showing in journal
-rw-r--r-- | engines/sherlock/journal.cpp | 23 | ||||
-rw-r--r-- | engines/sherlock/journal.h | 5 |
2 files changed, 26 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; diff --git a/engines/sherlock/journal.h b/engines/sherlock/journal.h index a8fec104f4..0bd277aced 100644 --- a/engines/sherlock/journal.h +++ b/engines/sherlock/journal.h @@ -72,6 +72,11 @@ protected: * first time, or being reloaded */ void loadJournalFile(bool alreadyLoaded); + + /** + * Returns true if a given character is printable + */ + bool isPrintable(char ch) const; public: static Journal *init(SherlockEngine *vm); virtual ~Journal() {} |