aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk/tt_vocab.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2017-09-18 18:16:03 -0400
committerPaul Gilbert2017-09-18 18:16:03 -0400
commit5af8ed228d729dd9ef71f5f6cea7adb254dff7a4 (patch)
tree042295fae00eb651b35f3702408e60944462ae88 /engines/titanic/true_talk/tt_vocab.cpp
parent1d4e2c67fa20d962b0755cbe6a9c653f3bec76e5 (diff)
downloadscummvm-rg350-5af8ed228d729dd9ef71f5f6cea7adb254dff7a4.tar.gz
scummvm-rg350-5af8ed228d729dd9ef71f5f6cea7adb254dff7a4.tar.bz2
scummvm-rg350-5af8ed228d729dd9ef71f5f6cea7adb254dff7a4.zip
TITANIC: Add VocabMode enum, fix German vocab loading
Diffstat (limited to 'engines/titanic/true_talk/tt_vocab.cpp')
-rw-r--r--engines/titanic/true_talk/tt_vocab.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/titanic/true_talk/tt_vocab.cpp b/engines/titanic/true_talk/tt_vocab.cpp
index 20df6bd4bb..861d8f89a0 100644
--- a/engines/titanic/true_talk/tt_vocab.cpp
+++ b/engines/titanic/true_talk/tt_vocab.cpp
@@ -28,12 +28,13 @@
#include "titanic/true_talk/tt_picture.h"
#include "titanic/true_talk/tt_pronoun.h"
#include "titanic/titanic.h"
+#include "titanic/translation.h"
#include "common/file.h"
namespace Titanic {
-TTvocab::TTvocab(int val): _headP(nullptr), _tailP(nullptr),
- _word(nullptr), _vocabMode(val) {
+TTvocab::TTvocab(VocabMode vocabMode): _headP(nullptr), _tailP(nullptr),
+ _word(nullptr), _vocabMode(vocabMode) {
load("STVOCAB");
}
@@ -131,7 +132,8 @@ int TTvocab::load(const CString &name) {
}
void TTvocab::addWord(TTword *word) {
- TTword *existingWord = findWord(word->_text);
+ TTword *existingWord = g_language == Common::DE_DEU ? nullptr :
+ findWord(word->_text);
if (existingWord) {
if (word->_synP) {
@@ -160,7 +162,7 @@ TTword *TTvocab::findWord(const TTstring &str) {
TTword *word = _headP;
while (word && !flag) {
- if (_vocabMode != 3 || strcmp(word->c_str(), str)) {
+ if (_vocabMode != VOCAB_MODE_EN || strcmp(word->c_str(), str)) {
if (word->findSynByName(str, tempNode, _vocabMode))
flag = true;
else
@@ -203,7 +205,7 @@ TTword *TTvocab::getPrimeWord(TTstring &str, TTword **srcWord) const {
} else {
// Standard word
for (vocabP = _headP; vocabP; vocabP = vocabP->_nextP) {
- if (_vocabMode == 3 && !strcmp(str.c_str(), vocabP->c_str())) {
+ if (_vocabMode == VOCAB_MODE_EN && !strcmp(str.c_str(), vocabP->c_str())) {
newWord = vocabP->copy();
newWord->_nextP = nullptr;
newWord->setSyn(nullptr);