aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-08 12:09:32 -0400
committerPaul Gilbert2016-07-10 16:38:51 -0400
commitc4375b134a57e3217d24e146592560f1ba9342d7 (patch)
treec988c8cefd4171796a611cbf13d38afffe199c90 /engines/titanic/true_talk
parent74935b371fa94637f5592e402110c3b41cd0b3c4 (diff)
downloadscummvm-rg350-c4375b134a57e3217d24e146592560f1ba9342d7.tar.gz
scummvm-rg350-c4375b134a57e3217d24e146592560f1ba9342d7.tar.bz2
scummvm-rg350-c4375b134a57e3217d24e146592560f1ba9342d7.zip
TITANIC: Beginnings of STVocab class, CScriptHandler constructor
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/script_handler.cpp7
-rw-r--r--engines/titanic/true_talk/script_handler.h6
-rw-r--r--engines/titanic/true_talk/st_vocab.cpp37
-rw-r--r--engines/titanic/true_talk/st_vocab.h50
-rw-r--r--engines/titanic/true_talk/title_engine.h3
5 files changed, 98 insertions, 5 deletions
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index e902d0c874..beb5bee996 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -21,12 +21,17 @@
*/
#include "titanic/true_talk/script_handler.h"
+#include "titanic/titanic.h"
namespace Titanic {
/*------------------------------------------------------------------------*/
-CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) {
+CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
+ _owner(owner), _script(owner->_script), _reader(g_vm->_fileReader),
+ _vocab(val2), _field10(0), _field14(0), _field18(0), _inputCtr(0),
+ _field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
+
}
int CScriptHandler::scriptChanged(TTRoomScript *roomScript, TTNpcScript *npcScript, uint dialogueId) {
diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h
index 868a2c3eaa..fba1e41a2e 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -26,6 +26,8 @@
#include "titanic/true_talk/tt_npc_script.h"
#include "titanic/true_talk/tt_room_script.h"
#include "titanic/true_talk/tt_string.h"
+#include "titanic/true_talk/st_vocab.h"
+#include "titanic/support/file_reader.h"
namespace Titanic {
@@ -35,8 +37,8 @@ class CScriptHandler {
private:
CTitleEngine *_owner;
TTScriptBase *_script;
- int _field8;
- int _fieldC;
+ CFileReader &_reader;
+ STVocab _vocab;
int _field10;
int _field14;
int _field18;
diff --git a/engines/titanic/true_talk/st_vocab.cpp b/engines/titanic/true_talk/st_vocab.cpp
new file mode 100644
index 0000000000..ed41a4a61b
--- /dev/null
+++ b/engines/titanic/true_talk/st_vocab.cpp
@@ -0,0 +1,37 @@
+/* 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/st_vocab.h"
+
+namespace Titanic {
+
+STVocab::STVocab(int val): _field0(0), _field4(0), _field8(0),
+ _fieldC(0), _field10(0), _field18(val) {
+ _field14 = load("STvocab.txt");
+}
+
+int STVocab::load(const CString &name) {
+ // TODO
+ return 0;
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/st_vocab.h b/engines/titanic/true_talk/st_vocab.h
new file mode 100644
index 0000000000..2b4ebb8d72
--- /dev/null
+++ b/engines/titanic/true_talk/st_vocab.h
@@ -0,0 +1,50 @@
+/* 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_ST_VOCAB_H
+#define TITANIC_ST_VOCAB_H
+
+#include "titanic/support/string.h"
+
+namespace Titanic {
+
+class STVocab {
+private:
+ int _field0;
+ int _field4;
+ int _field8;
+ int _fieldC;
+ int _field10;
+ int _field14;
+ int _field18;
+private:
+ /**
+ * Load the vocab data
+ */
+ int load(const CString &name);
+public:
+ STVocab(int val);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_ST_VOCAB_H */
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index 389e376516..12a02e2b81 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -33,10 +33,9 @@
namespace Titanic {
class CTitleEngine {
-protected:
- TTScriptBase *_script;
public:
CScriptHandler *_scriptHandler;
+ TTScriptBase *_script;
public:
CTitleEngine();
~CTitleEngine();