aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-24 13:35:57 -0400
committerPaul Gilbert2016-07-15 19:15:18 -0400
commit06b9131a6cd5f009147368746b9354378d9d5d18 (patch)
tree148b7803219961f78a548608fa355a3b41e96b0b /engines/titanic/true_talk
parentae9a04bd414b45bbd8d3c00357432457a92230f9 (diff)
downloadscummvm-rg350-06b9131a6cd5f009147368746b9354378d9d5d18.tar.gz
scummvm-rg350-06b9131a6cd5f009147368746b9354378d9d5d18.tar.bz2
scummvm-rg350-06b9131a6cd5f009147368746b9354378d9d5d18.zip
TITANIC: Added TTconcept copy constructor
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/tt_concept.h5
-rw-r--r--engines/titanic/true_talk/tt_concept_node.cpp26
-rw-r--r--engines/titanic/true_talk/tt_concept_node.h13
3 files changed, 29 insertions, 15 deletions
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 112d864e19..8168d4ebe1 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -113,6 +113,11 @@ public:
*/
int getStatus() const { return _status; }
+ /**
+ * True true if the concept is valid
+ */
+ bool isValid() const { return _status == SS_VALID; }
+
void setFlag(bool val) { _flag = val; }
void set1C(int val) { _field1C = val; }
diff --git a/engines/titanic/true_talk/tt_concept_node.cpp b/engines/titanic/true_talk/tt_concept_node.cpp
index 9ad985746f..aca5718bca 100644
--- a/engines/titanic/true_talk/tt_concept_node.cpp
+++ b/engines/titanic/true_talk/tt_concept_node.cpp
@@ -26,20 +26,28 @@
namespace Titanic {
-TTconceptNode::TTconceptNode() : _concept0P(nullptr),
- _concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
- _concept4P(nullptr), _concept5P(nullptr), _field18(0),
- _field1C(0), _nextP(nullptr), _status(0) {
+TTconceptNode::TTconceptNode() : _concept0P(_concepts[0]), _concept1P(_concepts[1]),
+ _concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]),
+ _concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) {
}
-TTconceptNode::TTconceptNode(const TTconceptNode &src) : _concept0P(nullptr),
- _concept1P(nullptr), _concept2P(nullptr), _concept3P(nullptr),
- _concept4P(nullptr), _concept5P(nullptr), _field18(0),
- _field1C(0), _nextP(nullptr), _status(0) {
+TTconceptNode::TTconceptNode(const TTconceptNode &src) : _concept0P(_concepts[0]), _concept1P(_concepts[1]),
+ _concept2P(_concepts[2]), _concept3P(_concepts[3]), _concept4P(_concepts[4]),
+ _concept5P(_concepts[5]), _field18(0), _field1C(0), _nextP(nullptr), _status(0) {
if (src._status) {
_status = SS_5;
} else {
- // TODO
+ for (int idx = 0; idx < 6; ++idx) {
+ if (src._concepts[idx]) {
+ _concepts[idx] = new TTconcept(*src._concepts[idx]);
+ if (!_concepts[idx]->isValid())
+ _status = SS_11;
+ }
+ }
+
+ _field18 = src._field18;
+ _field1C = src._field1C;
+ _nextP = src._nextP;
}
}
diff --git a/engines/titanic/true_talk/tt_concept_node.h b/engines/titanic/true_talk/tt_concept_node.h
index 8fc1371f7b..af2fd42e7b 100644
--- a/engines/titanic/true_talk/tt_concept_node.h
+++ b/engines/titanic/true_talk/tt_concept_node.h
@@ -29,12 +29,13 @@ namespace Titanic {
class TTconceptNode {
public:
- TTconcept *_concept0P;
- TTconcept *_concept1P;
- TTconcept *_concept2P;
- TTconcept *_concept3P;
- TTconcept *_concept4P;
- TTconcept *_concept5P;
+ TTconcept *_concepts[6];
+ TTconcept *&_concept0P;
+ TTconcept *&_concept1P;
+ TTconcept *&_concept2P;
+ TTconcept *&_concept3P;
+ TTconcept *&_concept4P;
+ TTconcept *&_concept5P;
int _field18;
int _field1C;
TTconceptNode *_nextP;