From 89caddc217bc417128fbbdabc48a665acf338e03 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 17 May 2016 23:07:36 -0400 Subject: TITANIC: Beginning of TTparser findFrames --- engines/titanic/true_talk/script_handler.cpp | 14 +++++++++++++- engines/titanic/true_talk/tt_npc_script.cpp | 4 ---- engines/titanic/true_talk/tt_npc_script.h | 7 +++++-- engines/titanic/true_talk/tt_parser.cpp | 5 +++++ engines/titanic/true_talk/tt_parser.h | 2 ++ engines/titanic/true_talk/tt_room_script.cpp | 4 ---- engines/titanic/true_talk/tt_room_script.h | 7 +++++-- engines/titanic/true_talk/tt_sentence.cpp | 4 ---- engines/titanic/true_talk/tt_sentence.h | 3 ++- 9 files changed, 32 insertions(+), 18 deletions(-) diff --git a/engines/titanic/true_talk/script_handler.cpp b/engines/titanic/true_talk/script_handler.cpp index ab5b97122d..0bc50bd5f9 100644 --- a/engines/titanic/true_talk/script_handler.cpp +++ b/engines/titanic/true_talk/script_handler.cpp @@ -64,10 +64,22 @@ int CScriptHandler::processInput(TTroomScript *roomScript, TTnpcScript *npcScrip return SS_5; TTsentence *sentence = new TTsentence(_inputCtr++, line, this, roomScript, npcScript); - _parser.preprocess(sentence); + int result = _parser.preprocess(sentence); roomScript->preprocess(sentence); npcScript->preprocess(sentence); + int canProcess = 0; + if (result) { + sentence->set34(result); + if (roomScript->proc6(npcScript, sentence, result)) { + canProcess = npcScript->proc6(roomScript, sentence, result); + } + } + + if (canProcess == 0 || canProcess == 1) { + _parser.findFrames(sentence); + } + warning("TODO: CScriptHandler::processInput"); // TODO diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp index 46b350da39..0775d09c08 100644 --- a/engines/titanic/true_talk/tt_npc_script.cpp +++ b/engines/titanic/true_talk/tt_npc_script.cpp @@ -63,10 +63,6 @@ void TTnpcScript::proc4(int v) { warning("TODO"); } -int TTnpcScript::proc6() const { - return 1; -} - void TTnpcScript::proc7(int v1, int v2) { warning("TODO"); } diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h index 29ab08f458..2396943025 100644 --- a/engines/titanic/true_talk/tt_npc_script.h +++ b/engines/titanic/true_talk/tt_npc_script.h @@ -28,6 +28,9 @@ namespace Titanic { +class TTroomScript; +class TTsentence; + class TTnpcScriptBase : public TTscriptBase { protected: int _field54; @@ -39,7 +42,7 @@ public: const char *charName, int v3, int val2, int v4, int v5, int v6, int v7); - virtual int proc6() const = 0; + virtual int proc6(TTroomScript *roomScript, TTsentence *sentence, int val) const = 0; virtual void proc7(int v1, int v2) = 0; virtual int proc8() const = 0; virtual int proc9() const = 0; @@ -78,7 +81,7 @@ public: int v5, int v6, int v7); virtual void proc4(int v); - virtual int proc6() const; + virtual int proc6(TTroomScript *roomScript, TTsentence *sentence, int val) const { return 1; } virtual void proc7(int v1, int v2); virtual int proc8() const; virtual int proc9() const; diff --git a/engines/titanic/true_talk/tt_parser.cpp b/engines/titanic/true_talk/tt_parser.cpp index a965c70394..d2563d4c05 100644 --- a/engines/titanic/true_talk/tt_parser.cpp +++ b/engines/titanic/true_talk/tt_parser.cpp @@ -465,4 +465,9 @@ const NumberEntry *TTparser::replaceNumbers2(TTstring &line, int *startIndex) { return numEntry; } +int TTparser::findFrames(TTsentence *sentence) { + // TODO + return 0; +} + } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_parser.h b/engines/titanic/true_talk/tt_parser.h index da63336783..fcf39ea822 100644 --- a/engines/titanic/true_talk/tt_parser.h +++ b/engines/titanic/true_talk/tt_parser.h @@ -128,6 +128,8 @@ public: * all the words, and replcaing common slang with their full equivalents */ int preprocess(TTsentence *sentence); + + int findFrames(TTsentence *sentence); }; } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_room_script.cpp b/engines/titanic/true_talk/tt_room_script.cpp index 62f60f428c..885021eb7f 100644 --- a/engines/titanic/true_talk/tt_room_script.cpp +++ b/engines/titanic/true_talk/tt_room_script.cpp @@ -37,10 +37,6 @@ TTroomScript::TTroomScript(int scriptId) : TTroomScriptBase(scriptId, "", "", 0, -1, -1, -1, 0, 0) { } -void TTroomScript::proc6() { - warning("TODO"); -} - void TTroomScript::proc7() { warning("TODO"); } diff --git a/engines/titanic/true_talk/tt_room_script.h b/engines/titanic/true_talk/tt_room_script.h index 7f72573dec..7fd43f3c79 100644 --- a/engines/titanic/true_talk/tt_room_script.h +++ b/engines/titanic/true_talk/tt_room_script.h @@ -27,6 +27,9 @@ namespace Titanic { +class TTnpcScript; +class TTsentence; + class TTroomScriptBase : public TTscriptBase { public: int _scriptId; @@ -34,7 +37,7 @@ public: TTroomScriptBase(int scriptId, const char *charClass, const char *charName, int v3, int v4, int v5, int v6, int v2, int v7); - virtual void proc6() = 0; + virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, int val) = 0; virtual void proc7() = 0; virtual void proc8() = 0; virtual void proc9() = 0; @@ -54,7 +57,7 @@ private: public: TTroomScript(int scriptId); - virtual void proc6(); + virtual int proc6(TTnpcScript *npcScript, TTsentence *sentence, int val) { return 1; } virtual void proc7(); virtual void proc8(); virtual void proc9(); diff --git a/engines/titanic/true_talk/tt_sentence.cpp b/engines/titanic/true_talk/tt_sentence.cpp index 446d79ab82..f7779eb8bb 100644 --- a/engines/titanic/true_talk/tt_sentence.cpp +++ b/engines/titanic/true_talk/tt_sentence.cpp @@ -77,8 +77,4 @@ void TTsentence::copyFrom(const TTsentence &src) { } } -void TTsentence::set38(int val) { - _field38 = val; -} - } // End of namespace Titanic diff --git a/engines/titanic/true_talk/tt_sentence.h b/engines/titanic/true_talk/tt_sentence.h index 4980f2439c..450280b430 100644 --- a/engines/titanic/true_talk/tt_sentence.h +++ b/engines/titanic/true_talk/tt_sentence.h @@ -79,7 +79,8 @@ public: TTroomScript *roomScript, TTnpcScript *npcScript); TTsentence(const TTsentence *src); - void set38(int v); + void set34(int v) { _field34 = v; } + void set38(int v) { _field38 = v; } int getStatus() const { return _status; } }; -- cgit v1.2.3