diff options
author | Paul Gilbert | 2016-05-11 07:04:08 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-10 16:39:10 -0400 |
commit | e86ce94441a032de3707eb7576060d9281a3fec0 (patch) | |
tree | 28c749a6cf6da36cc19323c53093a7396908ca53 | |
parent | fa626a8bc981b9a3009996787c3007193eab1147 (diff) | |
download | scummvm-rg350-e86ce94441a032de3707eb7576060d9281a3fec0.tar.gz scummvm-rg350-e86ce94441a032de3707eb7576060d9281a3fec0.tar.bz2 scummvm-rg350-e86ce94441a032de3707eb7576060d9281a3fec0.zip |
TITANIC: Implement TTword scanCopy
-rw-r--r-- | engines/titanic/true_talk/st_vocab.cpp | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_string_node.cpp | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_string_node.h | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_word.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_word.h | 2 |
5 files changed, 16 insertions, 8 deletions
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp index b5223a0ae5..bf4d366d60 100644 --- a/engines/titanic/true_talk/st_vocab.cpp +++ b/engines/titanic/true_talk/st_vocab.cpp @@ -127,7 +127,7 @@ TTword *STVocab::findWord(const TTString &str) { while (!flag) { if (_field18 != 3 || strcmp(word->c_str(), str)) { - if (word->fn1(str, tempNode, _field18)) + if (word->scanCopy(str, tempNode, _field18)) word = word->_pNext; else flag = true; diff --git a/engines/titanic/true_talk/tt_string_node.cpp b/engines/titanic/true_talk/tt_string_node.cpp index db7c846a53..b3d3707ee5 100644 --- a/engines/titanic/true_talk/tt_string_node.cpp +++ b/engines/titanic/true_talk/tt_string_node.cpp @@ -100,7 +100,7 @@ TTstringNode *TTstringNode::getTail() const { TTsynonymNode::TTsynonymNode() : TTstringNode() { } -TTsynonymNode::TTsynonymNode(const TTsynonymNode *src) { +TTsynonymNode::TTsynonymNode(const TTstringNode *src) { _string = src->_string; initialize(src->_mode); _field14 = src->_field14; @@ -113,7 +113,7 @@ TTsynonymNode::TTsynonymNode(int mode, const char *str, int val2) : _field14 = val2; } -TTsynonymNode *TTsynonymNode::copy(TTsynonymNode *src) { +TTsynonymNode *TTsynonymNode::copy(TTstringNode *src) { if (src->_field1C) { _field1C = 5; return this; diff --git a/engines/titanic/true_talk/tt_string_node.h b/engines/titanic/true_talk/tt_string_node.h index 7b96fbf9b5..f836889f43 100644 --- a/engines/titanic/true_talk/tt_string_node.h +++ b/engines/titanic/true_talk/tt_string_node.h @@ -73,10 +73,10 @@ public: class TTsynonymNode : public TTstringNode { public: TTsynonymNode(); - TTsynonymNode(const TTsynonymNode *src); + TTsynonymNode(const TTstringNode *src); TTsynonymNode(int mode, const char *str, int val2); - TTsynonymNode *copy(TTsynonymNode *src); + TTsynonymNode *copy(TTstringNode *src); }; } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp index 263b519edd..7f4b5a8dde 100644 --- a/engines/titanic/true_talk/tt_word.cpp +++ b/engines/titanic/true_talk/tt_word.cpp @@ -92,8 +92,16 @@ bool TTword::testFileHandle(SimpleFile *file) const { return true; } -TTword *TTword::fn1(const TTString &str, TTsynonymNode *node, int val) { - // TODO +TTword *TTword::scanCopy(const TTString &str, TTsynonymNode *node, int mode) { + if (_synP) { + TTstringNode *strNode = _synP->scan(_synP, str, mode); + if (strNode) { + node->copy(strNode); + node->_pPrior = nullptr; + node->_pNext = nullptr; + } + } + return nullptr; } diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h index 589dcf7bbe..277f180d6c 100644 --- a/engines/titanic/true_talk/tt_word.h +++ b/engines/titanic/true_talk/tt_word.h @@ -61,7 +61,7 @@ public: */ int load(SimpleFile *file, int mode); - TTword *fn1(const TTString &str, TTsynonymNode *node, int val); + TTword *scanCopy(const TTString &str, TTsynonymNode *node, int mode); const char *c_str() const { return _string.c_str(); } operator const char *() const { return c_str(); } |