aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/true_talk
diff options
context:
space:
mode:
authorPaul Gilbert2016-05-09 19:18:03 -0400
committerPaul Gilbert2016-07-10 16:38:58 -0400
commit45f84a9da592fbc76156801c634d60615ace67a2 (patch)
tree3a08fd6b59c50bdc72199a01074d1d2d698be88a /engines/titanic/true_talk
parentb7e4ed8744c815b687ce0e4b89df2d204dd28a2a (diff)
downloadscummvm-rg350-45f84a9da592fbc76156801c634d60615ace67a2.tar.gz
scummvm-rg350-45f84a9da592fbc76156801c634d60615ace67a2.tar.bz2
scummvm-rg350-45f84a9da592fbc76156801c634d60615ace67a2.zip
TITANIC: Fix script handler initialization
Diffstat (limited to 'engines/titanic/true_talk')
-rw-r--r--engines/titanic/true_talk/script_handler.cpp8
-rw-r--r--engines/titanic/true_talk/script_handler.h3
-rw-r--r--engines/titanic/true_talk/true_talk_manager.cpp2
3 files changed, 11 insertions, 2 deletions
diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp
index 09110a3f19..67ce8be61f 100644
--- a/engines/titanic/true_talk/script_handler.cpp
+++ b/engines/titanic/true_talk/script_handler.cpp
@@ -29,10 +29,16 @@ namespace Titanic {
CScriptHandler::CScriptHandler(CTitleEngine *owner, int val1, int val2) :
_owner(owner), _script(owner->_script), _reader(g_vm->_fileReader),
- _vocab(val2), _sub1(), _sub2(this), _field10(0), _inputCtr(0),
+ _sub1(), _sub2(this), _field10(0), _inputCtr(0),
_field20(0), _field24(0), _field28(0), _field2C(0), _field30(0) {
g_vm->_scriptHandler = this;
g_vm->_script = _script;
+ g_vm->_fileReader.reset(this, val1, val2);
+ _vocab = new STVocab(val2);
+}
+
+CScriptHandler::~CScriptHandler() {
+ delete _vocab;
}
ScriptChangedResult 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 38da259021..58d58d6d27 100644
--- a/engines/titanic/true_talk/script_handler.h
+++ b/engines/titanic/true_talk/script_handler.h
@@ -64,8 +64,8 @@ class CScriptHandler {
private:
CTitleEngine *_owner;
TTScriptBase *_script;
+ STVocab *_vocab;
CFileReader &_reader;
- STVocab _vocab;
int _field10;
CScriptHandlerSub1 _sub1;
CScriptHandlerSub2 _sub2;
@@ -77,6 +77,7 @@ private:
int _field30;
public:
CScriptHandler(CTitleEngine *owner, int val1, int val2);
+ ~CScriptHandler();
/**
* Set the character and room
diff --git a/engines/titanic/true_talk/true_talk_manager.cpp b/engines/titanic/true_talk/true_talk_manager.cpp
index 0b841aca00..4892259341 100644
--- a/engines/titanic/true_talk/true_talk_manager.cpp
+++ b/engines/titanic/true_talk/true_talk_manager.cpp
@@ -47,6 +47,8 @@ CTrueTalkNPC *CTrueTalkManager::_currentNPC;
CTrueTalkManager::CTrueTalkManager(CGameManager *owner) :
_gameManager(owner), _scripts(&_titleEngine), _currentCharId(0),
_dialogueFile(nullptr), _dialogueId(0) {
+ _titleEngine.setup(3, 3);
+ _currentNPC = nullptr;
}
CTrueTalkManager::~CTrueTalkManager() {