diff options
author | Paul Gilbert | 2016-05-28 14:33:45 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:16:19 -0400 |
commit | a261041be74b42dd9877acd9968e53641fd62587 (patch) | |
tree | ed05755ee0e1cbc83601620f7d8861ae13377bed /engines | |
parent | ef186e1a2e668b524f423ad7fbb44dc9d3fb3ea4 (diff) | |
download | scummvm-rg350-a261041be74b42dd9877acd9968e53641fd62587.tar.gz scummvm-rg350-a261041be74b42dd9877acd9968e53641fd62587.tar.bz2 scummvm-rg350-a261041be74b42dd9877acd9968e53641fd62587.zip |
TITANIC: Adding tag switches to TTparser considerRequests
Diffstat (limited to 'engines')
-rw-r--r-- | engines/titanic/true_talk/tt_concept.cpp | 9 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_concept.h | 2 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_parser.cpp | 42 |
3 files changed, 53 insertions, 0 deletions
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp index 30ecce1c3b..c614e14dae 100644 --- a/engines/titanic/true_talk/tt_concept.cpp +++ b/engines/titanic/true_talk/tt_concept.cpp @@ -288,6 +288,15 @@ TTconcept *TTconcept::findByWordClass(WordClass wordClass) { return nullptr; } +TTconcept *TTconcept::findBy20(int val) { + for (TTconcept *conceptP = this; conceptP; conceptP = conceptP->_nextP) { + if (conceptP->_field20 == val) + return conceptP; + } + + return nullptr; +} + bool TTconcept::isWordId(int id) const { return this && _wordP && _wordP->_id == id; } diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h index 4584b514c7..97cc70e41d 100644 --- a/engines/titanic/true_talk/tt_concept.h +++ b/engines/titanic/true_talk/tt_concept.h @@ -153,6 +153,8 @@ public: */ TTconcept *findByWordClass(WordClass wordClass); + TTconcept *findBy20(int val); + /** * Returns true if the concept has a word with a given Id */ diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index f397173ae8..664dcf7ced 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -1173,6 +1173,48 @@ int TTparser::considerRequests(TTword *word) { _sentence->_field2C = 14; break; + case MKTAG('F', 'A', 'R', 'R'): + if (_conceptP->findBy20(0)) + _conceptP->_field20 = 2; + break; + + case MKTAG('F', 'U', 'T', 'R'): + _sentenceConcept->_field18 = 3; + break; + + case MKTAG('G', 'O', 'G', 'O'): + addNode(7); + addNode(5); + addNode(21); + + if (_sentence->_field2C == 1) + _sentence->_field2C = 14; + + flag = true; + break; + + case MKTAG('H', 'E', 'L', 'P'): + if (_sentence->_field2C == 1) + _sentence->_field2C = 18; + + flag = true; + break; + + case MKTAG('L', 'O', 'C', 'F'): + status = _sentenceConcept->createConcept(1, 5, word); + if (!status) { + _sentenceConcept->_concept5P->_field20 = 2; + flag = true; + } + break; + + case MKTAG('T', 'E', 'A', 'C'): + if (_sentence->_field2C == 1) + _sentence->_field2C = 10; + + flag = true; + break; + default: break; } |