diff options
-rw-r--r-- | engines/titanic/module.mk | 4 | ||||
-rw-r--r-- | engines/titanic/true_talk/title_engine.cpp | 50 | ||||
-rw-r--r-- | engines/titanic/true_talk/title_engine.h | 74 | ||||
-rw-r--r-- | engines/titanic/true_talk/title_engine_sub.cpp | 32 | ||||
-rw-r--r-- | engines/titanic/true_talk/title_engine_sub.h | 37 | ||||
-rw-r--r-- | engines/titanic/true_talk/true_talk_manager.cpp | 12 | ||||
-rw-r--r-- | engines/titanic/true_talk/true_talk_manager.h | 3 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_title_script.cpp | 28 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_title_script.h | 37 |
9 files changed, 275 insertions, 2 deletions
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk index 0f301b93ff..10698cfc3b 100644 --- a/engines/titanic/module.mk +++ b/engines/titanic/module.mk @@ -457,12 +457,14 @@ MODULE_OBJS := \ true_talk/parrot_script.o \ true_talk/succubus_script.o \ true_talk/title_engine.o \ + true_talk/title_engine_sub.o \ true_talk/true_talk_manager.o \ true_talk/tt_script_base.o \ true_talk/tt_room_script.o \ true_talk/tt_named_script.o \ true_talk/tt_scripts.o \ - true_talk/tt_string.o + true_talk/tt_string.o \ + true_talk/tt_title_script.o # This module can be built as a plugin ifeq ($(ENABLE_TITANIC), DYNAMIC_PLUGIN) 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 */ |