aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-25 22:23:42 -0400
committerPaul Gilbert2016-07-15 19:15:36 -0400
commit1992afe4aa5ff8b02d38a0038fc390b6280ab358 (patch)
treec222604aecf76c41f42dd7a56a7aea38a41a4402 /engines/titanic/true_talk
parent986ab4b0d18e708fb74b9228bb7b21fd3695035d (diff)
downloadscummvm-rg350-1992afe4aa5ff8b02d38a0038fc390b6280ab358.tar.gz
scummvm-rg350-1992afe4aa5ff8b02d38a0038fc390b6280ab358.tar.bz2
scummvm-rg350-1992afe4aa5ff8b02d38a0038fc390b6280ab358.zip
TITANIC: Added TTconceptNode createConcept
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/tt_concept_node.cpp14
-rw-r--r--engines/titanic/true_talk/tt_concept_node.h4
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp30
-rw-r--r--engines/titanic/true_talk/tt_sentence.cpp12
-rw-r--r--engines/titanic/true_talk/tt_sentence.h2
5 files changed, 60 insertions, 2 deletions
diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp
index a98200bce3..454ca59971 100644
--- a/engines/titanic/true_talk/tt_concept_node.cpp
+++ b/engines/titanic/true_talk/tt_concept_node.cpp
@@ -148,4 +148,18 @@ int TTconceptNode::changeConcept(int mode, TTconcept **conceptPP, int conceptInd
}
}
+bool TTconceptNode::createConcept(int mode, int conceptIndex, TTword *word) {
+ TTconcept *newConcept = new TTconcept(word, ST_UNKNOWN_SCRIPT);
+ TTconcept **conceptPP = setConcept(conceptIndex, newConcept);
+
+ if (mode == 0 || (mode == 1 && !*conceptPP)) {
+ delete *conceptPP;
+ *conceptPP = newConcept;
+ return false;
+ } else {
+ delete newConcept;
+ return true;
+ }
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept_node.h b/engines/titanic/true_talk/tt_concept_node.h
index 5e49e37abe..9a1c3a9912 100644
--- a/engines/titanic/true_talk/tt_concept_node.h
+++ b/engines/titanic/true_talk/tt_concept_node.h
@@ -60,10 +60,14 @@ public:
TTconcept **setConcept(int conceptIndex, TTconcept *src);
int replaceConcept(int mode, int conceptIndex, TTconcept *concept);
int changeConcept(int mode, TTconcept **conceptPP, int conceptIndex);
+ bool createConcept(int mode, int conceptIndex, TTword *word);
int concept1WordId() const {
return _concept1P ? _concept1P->getWordId() : 0;
}
+ int concept5WordId() const {
+ return _concept5P ? _concept5P->getWordId() : 0;
+ }
};
} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index c8bee25351..3741ab7e5f 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -791,9 +791,14 @@ int TTparser::considerRequests(TTword *word) {
case SEEK_ACTOR:
if (_sentenceConcept->_concept0P) {
+ if (_sentenceConcept->_concept0P->compareTo("?") &&
+ _sentenceConcept->_concept1P->isWordId(113) &&
+ word->_wordClass == WC_THING) {
+ // TODO
+ }
- }
- else {
+
+ } else {
}
break;
@@ -804,12 +809,33 @@ int TTparser::considerRequests(TTword *word) {
case SEEK_FROM:
case SEEK_TO_OVERRIDE:
case SEEK_FROM_OVERRIDE:
+ if (_sentenceConcept->_concept4P) {
+ delete _sentenceConcept->_concept4P;
+ _sentenceConcept->_concept4P = nullptr;
+ }
+
+ addNode(8);
+ flag = true;
+ break;
+
case SEEK_LOCATION:
case SEEK_OWNERSHIP:
case SEEK_STATE:
case SEEK_MODIFIERS:
case SEEK_NEW_FRAME:
case SEEK_STATE_OBJECT:
+ if (!_sentenceConcept->_concept5P) {
+ addToConceptList(word);
+ } else if (_sentenceConcept->concept5WordId() == 113 ||
+ _sentenceConcept->concept5WordId() == 112) {
+ _sentenceConcept->createConcept(1, 2, word);
+ } else {
+ addToConceptList(word);
+ }
+
+ flag = true;
+ break;
+
case SET_ACTION:
case SET_COLOR:
case ACTOR_IS_TO:
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp
index d269f41b0c..06ddb6b299 100644
--- a/engines/titanic/true_talk/tt_sentence.cpp
+++ b/engines/titanic/true_talk/tt_sentence.cpp
@@ -218,4 +218,16 @@ TTconcept *TTsentence::getFrameSlot(int conceptIndex, TTconceptNode *conceptNode
return newConcept;
}
+int TTsentence::is18(int val, const TTconceptNode *node) const {
+ if (!node)
+ node = &_sentenceConcept;
+ return node->_field18 == val;
+}
+
+int TTsentence::is1C(int val, const TTconceptNode *node) const {
+ if (!node)
+ node = &_sentenceConcept;
+ return node->_field1C == val;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h
index 00f31b4f31..83416cbd49 100644
--- a/engines/titanic/true_talk/tt_sentence.h
+++ b/engines/titanic/true_talk/tt_sentence.h
@@ -80,6 +80,8 @@ public:
return conceptNode ? conceptNode->get18() : 0;
}
int get58() const { return _field58; }
+ int is18(int val, const TTconceptNode *node) const;
+ int is1C(int val, const TTconceptNode *node) const;
int getStatus() const { return _status; }