diff options
author | Paul Gilbert | 2016-05-24 21:15:32 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:15:29 -0400 |
commit | 27417fa78d39e983b8a73947ddb476679d9ca953 (patch) | |
tree | 3a7b79375a50ba378c39a278e3094b06763b34ba /engines | |
parent | 5576060aefbea46c8f3214005e8c791776c03b27 (diff) | |
download | scummvm-rg350-27417fa78d39e983b8a73947ddb476679d9ca953.tar.gz scummvm-rg350-27417fa78d39e983b8a73947ddb476679d9ca953.tar.bz2 scummvm-rg350-27417fa78d39e983b8a73947ddb476679d9ca953.zip |
TITANIC: Added TTparser resetConcept
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/true_talk/tt_parser.cpp | 24 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_parser.h | 2 |
2 files changed, 19 insertions, 7 deletions
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index 013e5f1433..dd3389337a 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -786,7 +786,7 @@ int TTparser::considerRequests(TTword *word) { break; case OBJECT_IS_TO: - flag = fn3(&_sentenceConcept->_concept2P, 3); + flag = resetConcept(&_sentenceConcept->_concept2P, 3); break; case SEEK_ACTOR: @@ -814,7 +814,11 @@ int TTparser::considerRequests(TTword *word) { case SET_COLOR: case ACTOR_IS_TO: case ACTOR_IS_FROM: + case ACTOR_IS_OBJECT: + flag = resetConcept(&_sentenceConcept->_concept0P, 2); + break; + case STATE_IDENTITY: case WORD_TYPE_IS_SENTENCE_TYPE: case COMPLEX_VERB: @@ -911,11 +915,6 @@ int TTparser::fn2(TTword *word) { } } -bool TTparser::fn3(TTconcept **v, int v2) { - // TODO - return false; -} - int TTparser::checkReferent(TTpronoun *pronoun) { TTconcept *concept; @@ -996,4 +995,17 @@ int TTparser::filterConcepts(int conceptMode, int conceptIndex) { return result; } +bool TTparser::resetConcept(TTconcept **conceptPP, int conceptIndex) { + TTconcept **ptrPP = _sentenceConcept->setConcept(conceptIndex, nullptr); + + if (!*ptrPP) + return 0; + + int result = _sentenceConcept->changeConcept(1, conceptPP, conceptIndex); + if (*conceptPP) + _sentenceConcept->setConcept(conceptIndex, *conceptPP); + + 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 d7e67b2d51..c8432c2fe9 100644 --- a/engines/titanic/true_talk/tt_parser.h +++ b/engines/titanic/true_talk/tt_parser.h @@ -166,9 +166,9 @@ private: int fn1(); int fn2(TTword *word); - bool fn3(TTconcept **v, int v2); bool checkConcept2(TTconcept *concept, int conceptMode); int filterConcepts(int conceptMode, int conceptIndex); + bool resetConcept(TTconcept **conceptPP, int conceptIndex); public: CScriptHandler *_owner; TTsentenceConcept *_sentenceConcept; |