From babdf0aa036a62e098be2e0aef7082e315afbf62 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sat, 7 May 2016 20:52:36 -0400 Subject: TITANIC: Setting up of title engine and title script --- engines/titanic/true_talk/script_handler.cpp | 5 ++++- engines/titanic/true_talk/script_handler.h | 2 +- engines/titanic/true_talk/title_engine.cpp | 4 ++-- engines/titanic/true_talk/title_engine.h | 1 + engines/titanic/true_talk/true_talk_manager.cpp | 2 +- engines/titanic/true_talk/tt_title_script.cpp | 3 +++ engines/titanic/true_talk/tt_title_script.h | 8 +++++++- 7 files changed, 19 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp index a46a03301c..83d181275a 100644 --- a/engines/titanic/true_talk/script_handler.cpp +++ b/engines/titanic/true_talk/script_handler.cpp @@ -33,8 +33,11 @@ void CScriptHandler::setup(TTRoomScript *roomScript, TTNamedScript *npcScript, u // TODO } -void CScriptHandler::processInput(TTNamedScript *npcScript, TTRoomScript *roomScript, +void CScriptHandler::processInput(TTRoomScript *roomScript, TTNamedScript *npcScript, const TTString &line) { + if (!roomScript || line.empty()) + return; + // TODO } diff --git a/engines/titanic/true_talk/script_handler.h b/engines/titanic/true_talk/script_handler.h index 8d5c78dbc3..1206afe48e 100644 --- a/engines/titanic/true_talk/script_handler.h +++ b/engines/titanic/true_talk/script_handler.h @@ -42,7 +42,7 @@ public: */ void setup(TTRoomScript *roomScript, TTNamedScript *npcScript, uint charId); - void processInput(TTNamedScript *npcScript, TTRoomScript *roomScript, + void processInput(TTRoomScript *roomScript, TTNamedScript *npcScript, const TTString &line); }; diff --git a/engines/titanic/true_talk/title_engine.cpp b/engines/titanic/true_talk/title_engine.cpp index 5b8e8d9ef9..3908ea0986 100644 --- a/engines/titanic/true_talk/title_engine.cpp +++ b/engines/titanic/true_talk/title_engine.cpp @@ -33,10 +33,10 @@ CTitleEngine::~CTitleEngine() { } void CTitleEngine::setup(int val1, int val2) { - + _script = new TTTitleScript(); + _scriptHandler = new CScriptHandler(this, val1, val2); } - /*------------------------------------------------------------------------*/ STtitleEngine::STtitleEngine(): CTitleEngine(), _field58(0) { diff --git a/engines/titanic/true_talk/title_engine.h b/engines/titanic/true_talk/title_engine.h index ab541ec6f8..389e376516 100644 --- a/engines/titanic/true_talk/title_engine.h +++ b/engines/titanic/true_talk/title_engine.h @@ -28,6 +28,7 @@ #include "titanic/support/string.h" #include "titanic/true_talk/script_handler.h" #include "titanic/true_talk/tt_script_base.h" +#include "titanic/true_talk/tt_title_script.h" namespace Titanic { diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp index 2f7828bc52..fefa2fa824 100644 --- a/engines/titanic/true_talk/true_talk_manager.cpp +++ b/engines/titanic/true_talk/true_talk_manager.cpp @@ -295,7 +295,7 @@ void CTrueTalkManager::processInput(CTrueTalkNPC *npc, CTextInputMsg *msg, CView if (npcScript && roomScript) { _currentNPC = npc; - _titleEngine._scriptHandler->processInput(npcScript, roomScript, + _titleEngine._scriptHandler->processInput(roomScript, npcScript, TTString(msg->_input)); _currentNPC = nullptr; diff --git a/engines/titanic/true_talk/tt_title_script.cpp b/engines/titanic/true_talk/tt_title_script.cpp index 048199ad62..af784e3352 100644 --- a/engines/titanic/true_talk/tt_title_script.cpp +++ b/engines/titanic/true_talk/tt_title_script.cpp @@ -24,5 +24,8 @@ namespace Titanic { +TTTitleScript::TTTitleScript() : TTScriptBase(1, "", 0, "", 0, -1, -1, -1, 0), + _field50(0), _field5C(-1), _field60(0) { +} } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_title_script.h b/engines/titanic/true_talk/tt_title_script.h index 0c36e832a9..7876ba8a71 100644 --- a/engines/titanic/true_talk/tt_title_script.h +++ b/engines/titanic/true_talk/tt_title_script.h @@ -24,12 +24,18 @@ #define TITANIC_TT_TITLE_SCRIPT_H #include "titanic/true_talk/tt_script_base.h" +#include "titanic/true_talk/tt_string.h" namespace Titanic { class TTTitleScript : public TTScriptBase { +private: + int _field50; + TTString _string1; + int _field5C; + int _field60; public: - + TTTitleScript(); }; } // End of namespace Titanic -- cgit v1.2.3