aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-28 11:03:04 -0400
committerPaul Gilbert2016-07-15 19:16:06 -0400
commit23cd7fd2994c6438a37b243af432d5027ee6aeb8 (patch)
tree4280a0a66851d7a254a8fdac226464855753035a
parent8a3118912191736620580fd4ead9b19b15d3c3dd (diff)
downloadscummvm-rg350-23cd7fd2994c6438a37b243af432d5027ee6aeb8.tar.gz
scummvm-rg350-23cd7fd2994c6438a37b243af432d5027ee6aeb8.tar.bz2
scummvm-rg350-23cd7fd2994c6438a37b243af432d5027ee6aeb8.zip
TITANIC: Fleshing out TTparser considerRequests
-rw-r--r--engines/titanic/true_talk/tt_concept.h2
-rw-r--r--engines/titanic/true_talk/tt_major_word.cpp2
-rw-r--r--engines/titanic/true_talk/tt_major_word.h2
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp106
-rw-r--r--engines/titanic/true_talk/tt_picture.cpp2
-rw-r--r--engines/titanic/true_talk/tt_picture.h2
-rw-r--r--engines/titanic/true_talk/tt_word.cpp2
-rw-r--r--engines/titanic/true_talk/tt_word.h2
8 files changed, 110 insertions, 10 deletions
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
index 9d067ad947..835ff60a5f 100644
--- a/engines/titanic/true_talk/tt_concept.h
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -78,7 +78,7 @@ public:
public:
TTconcept();
TTconcept(TTscriptBase *script, ScriptType scriptType);
- TTconcept(TTword *word, ScriptType scriptType);
+ TTconcept(TTword *word, ScriptType scriptType = ST_UNKNOWN_SCRIPT);
TTconcept(TTconcept &src);
~TTconcept();
diff --git a/engines/titanic/true_talk/tt_major_word.cpp b/engines/titanic/true_talk/tt_major_word.cpp
index 0085accceb..18a56a40be 100644
--- a/engines/titanic/true_talk/tt_major_word.cpp
+++ b/engines/titanic/true_talk/tt_major_word.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
bool TTmajorWord::_staticFlag;
-TTmajorWord::TTmajorWord(TTstring &str, WordClass wordClass, int val2, int val3) :
+TTmajorWord::TTmajorWord(const TTstring &str, WordClass wordClass, int val2, int val3) :
TTword(str, wordClass, val2), _field2C(val3) {
}
diff --git a/engines/titanic/true_talk/tt_major_word.h b/engines/titanic/true_talk/tt_major_word.h
index d3d434e26d..c9a708abfb 100644
--- a/engines/titanic/true_talk/tt_major_word.h
+++ b/engines/titanic/true_talk/tt_major_word.h
@@ -38,7 +38,7 @@ protected:
*/
int saveData(SimpleFile *file, int val) const;
public:
- TTmajorWord(TTstring &str, WordClass wordClass, int val2, int val3);
+ TTmajorWord(const TTstring &str, WordClass wordClass, int val2, int val3);
TTmajorWord(const TTmajorWord *src);
/**
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 748c19a718..1d2680ecc7 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -24,6 +24,7 @@
#include "titanic/true_talk/script_handler.h"
#include "titanic/true_talk/tt_action.h"
#include "titanic/true_talk/tt_concept.h"
+#include "titanic/true_talk/tt_picture.h"
#include "titanic/true_talk/tt_sentence.h"
#include "titanic/true_talk/tt_word.h"
#include "titanic/titanic.h"
@@ -732,11 +733,9 @@ int TTparser::considerRequests(TTword *word) {
int status = 0;
bool flag = false;
bool modifierFlag = false;
+ int seekFlag = 0;
while (word) {
- //int ecx = 906;
- //int edx = 12;
-
if (nodeP->_tag == MKTAG('C', 'O', 'M', 'E')) {
addNode(7);
addNode(5);
@@ -894,6 +893,29 @@ int TTparser::considerRequests(TTword *word) {
break;
case SEEK_NEW_FRAME:
+ if (word->_wordClass == WC_ACTION && word->_id != 104 && word->_id != 107) {
+ if (concept && (_sentenceConcept->_concept5P || _sentenceConcept->_concept2P)) {
+ TTsentenceConcept *oldNode = _sentenceConcept;
+ oldNode->_field1C = 2;
+ _sentenceConcept = oldNode->addSibling();
+ concept = nullptr;
+
+ _sentenceConcept->_concept1P = oldNode->_concept1P;
+ _sentenceConcept->_concept5P = oldNode->_concept5P;
+ _sentenceConcept->_concept2P = oldNode->_concept2P;
+
+ if (seekFlag) {
+ seekFlag = 0;
+
+ _sentenceConcept->_field18 = oldNode->_field18;
+ oldNode->_field18 = seekFlag;
+ }
+ }
+
+ flag = true;
+ }
+ break;
+
case SEEK_STATE_OBJECT:
if (!_sentenceConcept->_concept5P) {
addToConceptList(word);
@@ -938,6 +960,84 @@ int TTparser::considerRequests(TTword *word) {
break;
case WORD_TYPE_IS_SENTENCE_TYPE:
+ if (_sentence->_field2C == 1 || _sentence->_field2C == 10) {
+ for (TTword *wordP = _currentWordP; wordP; wordP = wordP->_nextP) {
+ if (wordP->_id == 906) {
+ _sentence->_field2C = 12;
+ flag = true;
+ break;
+ }
+ }
+
+ TTpicture *newPictP;
+ TTconcept *newConceptP;
+ switch (word->_id) {
+ case 108:
+ _sentence->_field2C = 8;
+ break;
+ case 113:
+ if (!_sentenceConcept->_concept3P)
+ _sentence->_field2C = 22;
+ break;
+ case 304:
+ _sentence->_field2C = 25;
+ break;
+ case 305:
+ _sentence->_field2C = 24;
+ break;
+ case 306:
+ _sentence->_field2C = 7;
+ break;
+ case 501:
+ _sentence->_field2C = 9;
+ break;
+ case 900:
+ _sentence->_field2C = 5;
+ break;
+ case 901:
+ _sentence->_field2C = 4;
+ break;
+ case 904:
+ _sentence->_field2C = 6;
+ break;
+ case 905:
+ _sentence->_field2C = 11;
+ break;
+ case 906:
+ _sentence->_field2C = 12;
+ break;
+ case 907:
+ _sentence->_field2C = 13;
+ break;
+ case 908:
+ _sentence->_field2C = 2;
+ if (!_sentenceConcept->_concept0P) {
+ newPictP = new TTpicture(TTstring("?"), WC_THING, 0, 0, 0, 0, 0);
+ newConceptP = new TTconcept(newPictP);
+
+ _sentenceConcept->_concept0P = newConceptP;
+ delete newPictP;
+ addNode(4);
+ }
+ break;
+ case 909:
+ _sentence->_field2C = 3;
+ newPictP = new TTpicture(TTstring("?"), WC_THING, 0, 0, 0, 0, 0);
+ newConceptP = new TTconcept(newPictP);
+
+ _sentenceConcept->_concept2P = newConceptP;
+ delete newPictP;
+ addNode(4);
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ flag = true;
+ break;
+
case COMPLEX_VERB:
// TODO
break;
diff --git a/engines/titanic/true_talk/tt_picture.cpp b/engines/titanic/true_talk/tt_picture.cpp
index 5c6444adb3..4b04b8825b 100644
--- a/engines/titanic/true_talk/tt_picture.cpp
+++ b/engines/titanic/true_talk/tt_picture.cpp
@@ -26,7 +26,7 @@ namespace Titanic {
bool TTpicture::_staticFlag;
-TTpicture::TTpicture(TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6) :
+TTpicture::TTpicture(const TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6) :
TTmajorWord(str, wordClass, val2, val4), _tag(val3), _field30(val5), _field3C(val6),
_field38(0) {
}
diff --git a/engines/titanic/true_talk/tt_picture.h b/engines/titanic/true_talk/tt_picture.h
index 9c7b2acfbf..18cb88278f 100644
--- a/engines/titanic/true_talk/tt_picture.h
+++ b/engines/titanic/true_talk/tt_picture.h
@@ -36,7 +36,7 @@ protected:
int _field38;
int _field3C;
public:
- TTpicture(TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6);
+ TTpicture(const TTstring &str, WordClass wordClass, int val2, int val3, int val4, int val5, int val6);
TTpicture(const TTpicture *src);
/**
diff --git a/engines/titanic/true_talk/tt_word.cpp b/engines/titanic/true_talk/tt_word.cpp
index 1bf4783459..1dccd30a0b 100644
--- a/engines/titanic/true_talk/tt_word.cpp
+++ b/engines/titanic/true_talk/tt_word.cpp
@@ -26,7 +26,7 @@
namespace Titanic {
-TTword::TTword(TTstring &str, WordClass wordClass, int id) : _text(str),
+TTword::TTword(const TTstring &str, WordClass wordClass, int id) : _text(str),
_wordClass(wordClass), _id(id), _tag(0), _field24(0),
_field28(0), _synP(nullptr), _nextP(nullptr) {
_status = str.getStatus() == SS_VALID ? SS_VALID : SS_5;
diff --git a/engines/titanic/true_talk/tt_word.h b/engines/titanic/true_talk/tt_word.h
index ef907964c9..537d1e923b 100644
--- a/engines/titanic/true_talk/tt_word.h
+++ b/engines/titanic/true_talk/tt_word.h
@@ -64,7 +64,7 @@ public:
int _id;
uint _tag;
public:
- TTword(TTstring &str, WordClass wordClass, int val2);
+ TTword(const TTstring &str, WordClass wordClass, int val2);
TTword(const TTword *src);
~TTword();