[Scummvm-git-logs] scummvm master -> 223867b2f5f2ccb3c5ade26cca5af15b65d3dbbc
dreammaster
dreammaster at scummvm.org
Fri Oct 6 13:16:45 CEST 2017
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:
223867b2f5 TITANIC: DE: Fixes for article handling
Commit: 223867b2f5f2ccb3c5ade26cca5af15b65d3dbbc
https://github.com/scummvm/scummvm/commit/223867b2f5f2ccb3c5ade26cca5af15b65d3dbbc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-10-06T07:16:36-04:00
Commit Message:
TITANIC: DE: Fixes for article handling
Changed paths:
engines/titanic/true_talk/tt_parser.cpp
engines/titanic/true_talk/tt_sentence.cpp
engines/titanic/true_talk/tt_sentence.h
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 3481587..f230179 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -1741,9 +1741,10 @@ void TTparser::preprocessGerman(TTstring &line) {
"et ", "st ", "s ", "e ", "n ", "t "
};
- for (uint idx = 0; idx < _replacements4.size(); idx += 3) {
- if (!line.hasSuffix(_replacements4[idx + 2]))
+ for (uint idx = 0; idx < _replacements4.size(); ++idx) {
+ if (!line.hasSuffix(_replacements4[idx]))
continue;
+
const char *lineP = line.c_str();
const char *p = strstr(lineP, _replacements4[idx].c_str());
if (!p || p == lineP || *(p - 1) != ' ')
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index 2c675ba..1bb30d3 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -24,6 +24,7 @@
#include "titanic/true_talk/tt_concept.h"
#include "titanic/true_talk/script_handler.h"
#include "titanic/titanic.h"
+#include "titanic/translation.h"
namespace Titanic {
@@ -311,6 +312,12 @@ bool TTsentence::isConcept34(int slotIndex, const TTconceptNode *node) const {
bool TTsentence::localWord(const char *str) const {
CScriptHandler &scriptHandler = *g_vm->_exeResources._owner;
bool foundMatch = false;
+ static const char *const ARTICLES_EN[11] = {
+ "it", "that", "he", "she", "him", "her", "them", "they", "those", "1", "thing"
+ };
+ static const char *const ARTICLES_DE[9] = {
+ "es", "das", "er", "ihn", "ihm", "ihnen", "diese", "man", "ding"
+ };
if (scriptHandler._concept1P) {
TTstring s = scriptHandler._concept1P->getText();
@@ -332,15 +339,15 @@ bool TTsentence::localWord(const char *str) const {
continue;
const TTstring wordStr = nodeP->_wordP->_text;
- if (mode == VOCAB_MODE_EN && wordStr == str) {
+ if ((g_language == Common::DE_DEU || mode == VOCAB_MODE_EN) && wordStr == str) {
result = true;
} else if (nodeP->_wordP->findSynByName(str, &syn, mode)) {
result = true;
} else if (foundMatch) {
- result = wordStr == "it" || wordStr == "that" || wordStr == "he"
- || wordStr == "she" || wordStr == "him" || wordStr == "her"
- || wordStr == "them" || wordStr == "they" || wordStr == "those"
- || wordStr == "1" || wordStr == "thing";
+ result = false;
+ for (int idx = 0; idx < TRANSLATE(11, 9) && !result; ++idx) {
+ result = wordStr == TRANSLATE(ARTICLES_EN[idx], ARTICLES_DE[idx]);
+ }
}
}
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 01a0346..dfbf7ae 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -119,6 +119,10 @@ public:
bool isConcept34(int slotIndex, const TTconceptNode *node = nullptr) const;
+ /**
+ * Returns true if the sentence contains the specified word,
+ * allowing for common synonyms of the desired word
+ */
bool localWord(const char *str) const;
/**
More information about the Scummvm-git-logs
mailing list