diff options
author | Paul Gilbert | 2016-05-24 20:34:10 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:15:25 -0400 |
commit | 5576060aefbea46c8f3214005e8c791776c03b27 (patch) | |
tree | 194cae1b1b2451b77ec6d23c69e959787b950593 /engines/titanic | |
parent | 483929e70a74f86b250e8934a3880919e9bf3a02 (diff) | |
download | scummvm-rg350-5576060aefbea46c8f3214005e8c791776c03b27.tar.gz scummvm-rg350-5576060aefbea46c8f3214005e8c791776c03b27.tar.bz2 scummvm-rg350-5576060aefbea46c8f3214005e8c791776c03b27.zip |
TITANIC: Added TTparser filterConcepts
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/true_talk/tt_parser.cpp | 22 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_parser.h | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index 7b9f4c4c1c..013e5f1433 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -974,4 +974,26 @@ bool TTparser::checkConcept2(TTconcept *concept, int conceptMode) { return false; } +int TTparser::filterConcepts(int conceptMode, int conceptIndex) { + int result = 0; + + for (TTconcept *currP = _conceptP; currP && !result; currP = currP->_nextP) { + if (checkConcept2(currP, conceptMode)) { + TTconcept **ptrPP = _sentenceConcept->setConcept(conceptIndex, currP); + TTconcept *newConcept = new TTconcept(*currP); + *ptrPP = newConcept; + + if (newConcept->isValid()) { + removeConcept(currP); + (*ptrPP)->_nextP = nullptr; + result = 1; + } else { + result = -2; + } + } + } + + return result; +} + } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h index 512acbec89..d7e67b2d51 100644 --- a/engines/titanic/true_talk/tt_parser.h +++ b/engines/titanic/true_talk/tt_parser.h @@ -168,6 +168,7 @@ private: int fn2(TTword *word); bool fn3(TTconcept **v, int v2); bool checkConcept2(TTconcept *concept, int conceptMode); + int filterConcepts(int conceptMode, int conceptIndex); public: CScriptHandler *_owner; TTsentenceConcept *_sentenceConcept; |