diff options
author | Paul Gilbert | 2016-05-23 22:06:33 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:15:11 -0400 |
commit | 2b6a6cffc0b1854734540170d8b91430b5cc2f97 (patch) | |
tree | 2cdc220b9102a29b7fcad672603bacfc22a84e32 | |
parent | d537a25bd705d803d6fb0dc8202c8ef88460cd2c (diff) | |
download | scummvm-rg350-2b6a6cffc0b1854734540170d8b91430b5cc2f97.tar.gz scummvm-rg350-2b6a6cffc0b1854734540170d8b91430b5cc2f97.tar.bz2 scummvm-rg350-2b6a6cffc0b1854734540170d8b91430b5cc2f97.zip |
TITANIC: Implemented TTsentecneSubBase changeConcept
-rw-r--r-- | engines/titanic/true_talk/tt_sentence.cpp | 15 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_sentence.h | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_string.h | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp index 9558c546c3..7b49df2560 100644 --- a/engines/titanic/true_talk/tt_sentence.cpp +++ b/engines/titanic/true_talk/tt_sentence.cpp @@ -97,6 +97,21 @@ TTconcept **TTsentenceSubBase::setConcept(int conceptIndex, TTconcept *src) { return conceptPP; } +int TTsentenceSubBase::changeConcept(int mode, TTconcept **conceptPP, int conceptIndex) { + TTconcept **newConceptPP = setConcept(conceptIndex, *conceptPP); + + if (mode == 0 || (mode == 1 && !*newConceptPP)) { + if (!*conceptPP) + return SS_5; + + delete *newConceptPP; + *newConceptPP = new TTconcept(**conceptPP); + return SS_VALID; + } else { + return SS_1; + } +} + /*------------------------------------------------------------------------*/ TTsentenceSub *TTsentenceSub::addSibling() { diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h index 3a4fd6c685..e995884ec0 100644 --- a/engines/titanic/true_talk/tt_sentence.h +++ b/engines/titanic/true_talk/tt_sentence.h @@ -59,6 +59,7 @@ public: bool is24() const { return _field24 == 0; } TTconcept **setConcept(int conceptIndex, TTconcept *src); + int changeConcept(int mode, TTconcept **conceptPP, int conceptIndex); }; class TTsentenceSub : public TTsentenceSubBase { diff --git a/engines/titanic/true_talk/tt_string.h b/engines/titanic/true_talk/tt_string.h index 435efa14b6..060a48f5b6 100644 --- a/engines/titanic/true_talk/tt_string.h +++ b/engines/titanic/true_talk/tt_string.h @@ -38,7 +38,7 @@ struct TTstringData { TTstringData(const CString &str) : _string(str), _referenceCount(1) {} }; -enum TTstringStatus { SS_VALID = 0, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 }; +enum TTstringStatus { SS_VALID = 0, SS_1 = 1, SS_5 = 5, SS_7 = 7, SS_8 = 8, SS_11 = 11, SS_13 = 13 }; class TTstring { private: |