aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk/tt_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/titanic/true_talk/tt_parser.cpp')
-rw-r--r--engines/titanic/true_talk/tt_parser.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp
index 787e9767da..0d7c75c240 100644
--- a/engines/titanic/true_talk/tt_parser.cpp
+++ b/engines/titanic/true_talk/tt_parser.cpp
@@ -23,15 +23,24 @@
#include "titanic/true_talk/tt_parser.h"
#include "titanic/true_talk/script_handler.h"
#include "titanic/true_talk/tt_sentence.h"
+#include "titanic/true_talk/tt_word.h"
#include "titanic/titanic.h"
namespace Titanic {
TTparser::TTparser(CScriptHandler *owner) : _owner(owner), _sentenceSub(nullptr),
- _sentence(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0) {
+ _sentence(nullptr), _fieldC(0), _field10(0), _field14(0), _field18(0),
+ _nodesP(nullptr) {
loadArrays();
}
+TTparser::~TTparser() {
+ if (_nodesP) {
+ _nodesP->deleteSiblings();
+ delete _nodesP;
+ }
+}
+
void TTparser::loadArrays() {
Common::SeekableReadStream *r;
r = g_vm->_filesManager->getResource("TEXT/REPLACEMENTS1");
@@ -495,4 +504,25 @@ int TTparser::findFrames(TTsentence *sentence) {
return 0;
}
+void TTparser::loadRequests(TTword *word) {
+ if (word->_tag != MKTAG('Z', 'Z', 'Z', 'T'))
+ addNode(word->_tag);
+
+ switch (word->_wordMode) {
+ case WMODE_NONE:
+ break;
+
+ case WMODE_ACTION:
+ break;
+ }
+ // TODO
+}
+
+void TTparser::addNode(uint tag) {
+ TTparserNode *newNode = new TTparserNode(tag);
+ if (_nodesP)
+ _nodesP->addToHead(newNode);
+ _nodesP = newNode;
+}
+
} // End of namespace Titanic