aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-21 09:02:04 -0400
committerPaul Gilbert2016-07-15 19:13:44 -0400
commitdacfbe6a0e08325d4ddb46937c30a2905d2b79de (patch)
tree1cff8da39c995ed5f6b861289a86f1b4ab6d244c /engines
parent49c9060bec57dbc90eff6f765bccd385f4985c61 (diff)
downloadscummvm-rg350-dacfbe6a0e08325d4ddb46937c30a2905d2b79de.tar.gz
scummvm-rg350-dacfbe6a0e08325d4ddb46937c30a2905d2b79de.tar.bz2
scummvm-rg350-dacfbe6a0e08325d4ddb46937c30a2905d2b79de.zip
TITANIC: Beginnings of TTconcept class
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/module.mk1
-rw-r--r--engines/titanic/true_talk/tt_concept.cpp79
-rw-r--r--engines/titanic/true_talk/tt_concept.h74
-rw-r--r--engines/titanic/true_talk/tt_script_base.h3
4 files changed, 156 insertions, 1 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 1568eb5a8c..b3d1444317 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -462,6 +462,7 @@ MODULE_OBJS := \
true_talk/true_talk_manager.o \
true_talk/tt_action.o \
true_talk/tt_adj.o \
+ true_talk/tt_concept.o \
true_talk/tt_hist.o \
true_talk/tt_major_word.o \
true_talk/tt_node.o \
diff --git a/engines/titanic/true_talk/tt_concept.cpp b/engines/titanic/true_talk/tt_concept.cpp
new file mode 100644
index 0000000000..af0a148ce4
--- /dev/null
+++ b/engines/titanic/true_talk/tt_concept.cpp
@@ -0,0 +1,79 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/true_talk/tt_concept.h"
+#include "titanic/true_talk/tt_script_base.h"
+#include "titanic/true_talk/tt_word.h"
+
+namespace Titanic {
+
+TTconcept::TTconcept() {
+}
+
+TTconcept::TTconcept(TTscriptBase *script, ScriptType scriptType) :
+ _string1(" "), _string2(" "), _wordP(nullptr), _scriptP(nullptr) {
+ if (!script->getStatus()) {
+ setScriptType(scriptType);
+ _scriptP = script;
+
+ if (scriptType == ST_UNKNOWN_SCRIPT && script->_field8 == 1)
+ _scriptType = ST_ROOM_SCRIPT;
+ }
+
+ if (_status)
+ reset();
+}
+
+bool TTconcept::setStatus() {
+ if (_string1.isValid() && _string2.isValid()) {
+ _status = SS_VALID;
+ return true;
+ } else {
+ _status = SS_11;
+ return false;
+ }
+}
+
+void TTconcept::setScriptType(ScriptType scriptType) {
+ _field0 = 0;
+ _field14 = 0;
+ _scriptType = scriptType;
+ _field1C = -1;
+ _field20 = 0;
+ _field2C = 0;
+ _field30 = 0;
+ _field34 = 0;
+ _field38 = 0;
+ _status = 0;
+}
+
+void TTconcept::reset() {
+ delete _wordP;
+ _wordP = nullptr;
+ _scriptP = nullptr;
+
+ int oldStatus = _status;
+ setScriptType(ST_UNKNOWN_SCRIPT);
+ _status = oldStatus;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_concept.h b/engines/titanic/true_talk/tt_concept.h
new file mode 100644
index 0000000000..08b748e8c7
--- /dev/null
+++ b/engines/titanic/true_talk/tt_concept.h
@@ -0,0 +1,74 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_TT_CONCEPT_H
+#define TITANIC_TT_CONCEPT_H
+
+#include "titanic/true_talk/tt_string.h"
+
+namespace Titanic {
+
+enum ScriptType { ST_UNKNOWN_SCRIPT = 0, ST_ROOM_SCRIPT = 1, ST_NPC_SCRIPT = 2 };
+
+class TTscriptBase;
+class TTword;
+
+class TTconcept {
+private:
+ int _field0;
+ TTscriptBase *_scriptP;
+ TTword *_wordP;
+ TTstring _string1;
+ int _field14;
+ ScriptType _scriptType;
+ int _field1C;
+ int _field20;
+ TTstring _string2;
+ int _field2C;
+ int _field30;
+ int _field34;
+ int _field38;
+ int _status;
+private:
+ /**
+ * Sets the status of the concept
+ */
+ bool setStatus();
+
+ /**
+ * Sets the script type and resets other fields
+ */
+ void setScriptType(ScriptType scriptType);
+
+ /**
+ * Resets the concept
+ */
+ void reset();
+public:
+ TTconcept();
+ TTconcept(TTscriptBase *script, ScriptType scriptType);
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_CONCEPT_H */
diff --git a/engines/titanic/true_talk/tt_script_base.h b/engines/titanic/true_talk/tt_script_base.h
index ce83cd13c4..2b748db93b 100644
--- a/engines/titanic/true_talk/tt_script_base.h
+++ b/engines/titanic/true_talk/tt_script_base.h
@@ -40,7 +40,6 @@ private:
void reset();
protected:
TTnode *_nodesP;
- int _field8;
TThist *_hist;
TTstring _charName, _charClass;
int _field20;
@@ -56,6 +55,8 @@ protected:
int _field48;
int _status;
public:
+ int _field8;
+public:
TTscriptBase(int v1, const char *charClass, int v2, const char *charName,
int v3, int v4, int v5, int v6, int v7);
virtual ~TTscriptBase();