aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-05 23:20:54 -0400
committerPaul Gilbert2016-07-10 16:38:31 -0400
commitab86c09a2f4c8ea315824bb95c58b5f33728e115 (patch)
treee23d54a52d95f0714f049701516ff512e70d9602 /engines/titanic/true_talk
parent03a8cbaf98fb44dcd4c915f4d8577adaef6b0d7a (diff)
downloadscummvm-rg350-ab86c09a2f4c8ea315824bb95c58b5f33728e115.tar.gz
scummvm-rg350-ab86c09a2f4c8ea315824bb95c58b5f33728e115.tar.bz2
scummvm-rg350-ab86c09a2f4c8ea315824bb95c58b5f33728e115.zip
TITANIC: Beginnings of STtitleEngine class
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/title_engine.cpp50
-rw-r--r--engines/titanic/true_talk/title_engine.h74
-rw-r--r--engines/titanic/true_talk/title_engine_sub.cpp32
-rw-r--r--engines/titanic/true_talk/title_engine_sub.h37
-rw-r--r--engines/titanic/true_talk/true_talk_manager.cpp12
-rw-r--r--engines/titanic/true_talk/true_talk_manager.h3
-rw-r--r--engines/titanic/true_talk/tt_title_script.cpp28
-rw-r--r--engines/titanic/true_talk/tt_title_script.h37
8 files changed, 272 insertions, 1 deletions
diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp
index 1369af6a5c..adc74feff8 100644
--- a/engines/titanic/true_talk/title_engine.cpp
+++ b/engines/titanic/true_talk/title_engine.cpp
@@ -24,4 +24,54 @@
namespace Titanic {
+CTitleEngine::CTitleEngine() : _script(nullptr), _sub(nullptr) {
+}
+
+CTitleEngine::~CTitleEngine() {
+ delete _script;
+ delete _sub;
+}
+
+void CTitleEngine::setup(int val1, int val2) {
+
+}
+
+
+/*------------------------------------------------------------------------*/
+
+STtitleEngine::STtitleEngine(): CTitleEngine(), _field58(0) {
+}
+
+STtitleEngine::~STtitleEngine() {
+ delete _stream;
+}
+
+void STtitleEngine::reset() {
+ _field58 = 0;
+ _array.clear();
+}
+
+void STtitleEngine::setup(int val1, int val2) {
+ CTitleEngine::setup(val1, 3);
+}
+
+int STtitleEngine::proc2(int val1, int val2) {
+ // TODO
+ return 0;
+}
+
+void STtitleEngine::dump(int val1, int val2) {
+ // TODO
+}
+
+void STtitleEngine::open(const CString &name) {
+ _stream = _resources.getResource(Common::WinResourceID("Text"),
+ name);
+}
+
+void STtitleEngine::close() {
+ delete _stream;
+ _stream = nullptr;
+}
+
} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h
index c854704cdc..71b0947012 100644
--- a/engines/titanic/true_talk/title_engine.h
+++ b/engines/titanic/true_talk/title_engine.h
@@ -23,9 +23,83 @@
#ifndef TITANIC_TITLE_ENGINE_H
#define TITANIC_TITLE_ENGINE_H
+#include "common/stream.h"
+#include "common/winexe_pe.h"
+#include "titanic/support/string.h"
+#include "titanic/true_talk/title_engine_sub.h"
+#include "titanic/true_talk/tt_script_base.h"
+
namespace Titanic {
class CTitleEngine {
+protected:
+ CTitleEngineSub *_sub;
+ TTScriptBase *_script;
+public:
+ CTitleEngine();
+ ~CTitleEngine();
+
+ /**
+ * Setup the engine
+ */
+ virtual void setup(int val1, int val2 = 0);
+
+ virtual int proc2(int val1, int val2) { return 2; }
+
+ virtual int proc4(int unused) const = 0;
+ virtual int proc5(int64 unused) const = 0;
+ virtual int proc6(int64 unused) const = 0;
+ virtual int proc7(int64 unused) const = 0;
+ virtual int proc8() const = 0;
+
+ /**
+ * Open a designated file
+ */
+ virtual void open(const CString &name) = 0;
+
+ /**
+ * Close the file
+ */
+ virtual void close() = 0;
+};
+
+class STtitleEngine : public CTitleEngine {
+private:
+ Common::PEResources _resources;
+ Common::SeekableReadStream *_stream;
+ int _field58;
+ Common::Array<uint> _array;
+ Common::Array<byte> _data;
+public:
+ STtitleEngine();
+ ~STtitleEngine();
+
+ void reset();
+
+ /**
+ * Setup the engine
+ */
+ virtual void setup(int val1, int val2 = 0);
+
+ virtual int proc2(int val1, int val2);
+
+ virtual void dump(int val1, int val2);
+
+ virtual int proc4(int unused) const { return 0; }
+ virtual int proc5(int64 unused) const { return 0; }
+ virtual int proc6(int64 unused) const { return 0; }
+ virtual int proc7(int64 unused) const { return 0; }
+ virtual int proc8() const { return 0; }
+
+ /**
+ * Open a designated file
+ */
+ virtual void open(const CString &name);
+
+ /**
+ * Close the file
+ */
+ virtual void close();
};
} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine_sub.cpp b/engines/titanic/true_talk/title_engine_sub.cpp
new file mode 100644
index 0000000000..f7e1f28d1d
--- /dev/null
+++ b/engines/titanic/true_talk/title_engine_sub.cpp
@@ -0,0 +1,32 @@
+/* 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/title_engine_sub.h"
+
+namespace Titanic {
+
+/*------------------------------------------------------------------------*/
+
+CTitleEngineSub::CTitleEngineSub(CTitleEngine *owner, int val1, int val2) {
+}
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/title_engine_sub.h b/engines/titanic/true_talk/title_engine_sub.h
new file mode 100644
index 0000000000..050f041bf2
--- /dev/null
+++ b/engines/titanic/true_talk/title_engine_sub.h
@@ -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.
+ *
+ */
+
+#ifndef TITANIC_TITLE_ENGINE_SUB_H
+#define TITANIC_TITLE_ENGINE_SUB_H
+
+namespace Titanic {
+
+class CTitleEngine;
+
+class CTitleEngineSub {
+public:
+ CTitleEngineSub(CTitleEngine *owner, int val1, int val2);
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TITLE_ENGINE_SUB_H */
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 2e43266b65..091e3f8e48 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -40,6 +40,7 @@ bool CTrueTalkManager::_v8;
int CTrueTalkManager::_v9;
bool CTrueTalkManager::_v10;
int CTrueTalkManager::_v11[41];
+CTrueTalkNPC *CTrueTalkManager::_currentNPC;
CTrueTalkManager::CTrueTalkManager(CGameManager *owner) :
_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
@@ -201,7 +202,18 @@ void CTrueTalkManager::update2() {
}
void CTrueTalkManager::start(CTrueTalkNPC *npc, int val2, int val3) {
+ TTNamedScript *npcScript = getNpcScript(npc);
+ TTRoomScript *roomScript = getRoomScript();
+ _titleEngine.reset();
+ uint charId = npcScript->charId();
+ loadAssets(npc, charId);
+
+ _currentNPC = npc;
+ warning("TODO: CTrueTalkManager::start");
+ _currentNPC = nullptr;
+
+ //TODO: More
}
TTNamedScript *CTrueTalkManager::getTalker(const CString &name) const {
diff --git a/engines/titanic/true_talk/true_talk_manager.h b/engines/titanic/true_talk/true_talk_manager.h
index a7258c587f..d2bba4b4ba 100644
--- a/engines/titanic/true_talk/true_talk_manager.h
+++ b/engines/titanic/true_talk/true_talk_manager.h
@@ -37,7 +37,7 @@ class CTrueTalkNPC;
class CTrueTalkManager {
private:
CGameManager *_gameManager;
- CTitleEngine _titleEngine;
+ STtitleEngine _titleEngine;
TTScripts _scripts;
int _currentCharId;
CDialogueFile *_dialogueFile;
@@ -89,6 +89,7 @@ public:
static int _v9;
static bool _v10;
static int _v11[41];
+ static CTrueTalkNPC *_currentNPC;
static void setFlags(int index, int val);
public:
diff --git a/engines/titanic/true_talk/tt_title_script.cpp b/engines/titanic/true_talk/tt_title_script.cpp
new file mode 100644
index 0000000000..048199ad62
--- /dev/null
+++ b/engines/titanic/true_talk/tt_title_script.cpp
@@ -0,0 +1,28 @@
+/* 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_title_script.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/true_talk/tt_title_script.h b/engines/titanic/true_talk/tt_title_script.h
new file mode 100644
index 0000000000..0c36e832a9
--- /dev/null
+++ b/engines/titanic/true_talk/tt_title_script.h
@@ -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.
+ *
+ */
+
+#ifndef TITANIC_TT_TITLE_SCRIPT_H
+#define TITANIC_TT_TITLE_SCRIPT_H
+
+#include "titanic/true_talk/tt_script_base.h"
+
+namespace Titanic {
+
+class TTTitleScript : public TTScriptBase {
+public:
+
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_TT_TITLE_SCRIPT_H */