diff options
author | Paul Gilbert | 2016-06-08 19:42:37 -0400 |
---|---|---|
committer | Paul Gilbert | 2016-07-15 19:21:10 -0400 |
commit | bc8e37e17bb02c81467c36dd8c0b60d8e1f9eca1 (patch) | |
tree | 3cfdf425d96ce4324dcfa035d81955b2b6fa87bc /engines/titanic | |
parent | cf79431c72becc58791a610f2ff184801e74f998 (diff) | |
download | scummvm-rg350-bc8e37e17bb02c81467c36dd8c0b60d8e1f9eca1.tar.gz scummvm-rg350-bc8e37e17bb02c81467c36dd8c0b60d8e1f9eca1.tar.bz2 scummvm-rg350-bc8e37e17bb02c81467c36dd8c0b60d8e1f9eca1.zip |
TITANIC: Load NPC mapping tables
Diffstat (limited to 'engines/titanic')
-rw-r--r-- | engines/titanic/true_talk/barbot_script.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/bellbot_script.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/deskbot_script.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/doorbot_script.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/liftbot_script.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/maitred_script.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/parrot_script.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/succubus_script.cpp | 1 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.cpp | 24 | ||||
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.h | 15 |
10 files changed, 47 insertions, 0 deletions
diff --git a/engines/titanic/true_talk/barbot_script.cpp b/engines/titanic/true_talk/barbot_script.cpp index dc8a5bbd62..ebd35a775a 100644 --- a/engines/titanic/true_talk/barbot_script.cpp +++ b/engines/titanic/true_talk/barbot_script.cpp @@ -33,6 +33,7 @@ BarbotScript::BarbotScript(int val1, const char *charClass, int v2, const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) : TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) { _state = 0; + _mappings.load("Mappings/Barbot", 8); loadRanges("Ranges/Barbot"); loadResponses("Responses/Barbot"); } diff --git a/engines/titanic/true_talk/bellbot_script.cpp b/engines/titanic/true_talk/bellbot_script.cpp index dec4ace8ea..5acf01179b 100644 --- a/engines/titanic/true_talk/bellbot_script.cpp +++ b/engines/titanic/true_talk/bellbot_script.cpp @@ -39,6 +39,7 @@ BellbotScript::BellbotScript(int val1, const char *charClass, int v2, _array[0] = 100; _array[1] = 0; + _mappings.load("Mappings/Bellbot", 1); loadRanges("Ranges/Bellbot"); loadResponses("Responses/Bellbot", 4); } diff --git a/engines/titanic/true_talk/deskbot_script.cpp b/engines/titanic/true_talk/deskbot_script.cpp index e92dd6b790..8c526163cc 100644 --- a/engines/titanic/true_talk/deskbot_script.cpp +++ b/engines/titanic/true_talk/deskbot_script.cpp @@ -40,6 +40,7 @@ DeskbotScript::DeskbotScript(int val1, const char *charClass, int v2, if (_field74 == 1) _field74 = 0; + _mappings.load("Mappings/Deskbot", 4); loadRanges("Ranges/Deskbot"); loadResponses("Responses/Deskbot", 4); } diff --git a/engines/titanic/true_talk/doorbot_script.cpp b/engines/titanic/true_talk/doorbot_script.cpp index 65fc194c11..92db168eb1 100644 --- a/engines/titanic/true_talk/doorbot_script.cpp +++ b/engines/titanic/true_talk/doorbot_script.cpp @@ -35,6 +35,7 @@ DoorbotScript::DoorbotScript(int val1, const char *charClass, int v2, TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) { Common::fill(&_array[0], &_array[148], 0); _state = 0; + _mappings.load("Mappings/Doorbot", 4); loadRanges("Ranges/Doorbot"); loadResponses("Responses/Doorbot"); } diff --git a/engines/titanic/true_talk/liftbot_script.cpp b/engines/titanic/true_talk/liftbot_script.cpp index daa3b6c177..a040160736 100644 --- a/engines/titanic/true_talk/liftbot_script.cpp +++ b/engines/titanic/true_talk/liftbot_script.cpp @@ -33,6 +33,7 @@ LiftbotScript::LiftbotScript(int val1, const char *charClass, int v2, const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) : TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) { _state = 0; + _mappings.load("Mappings/Liftbot", 4); loadRanges("Ranges/Liftbot"); loadResponses("Responses/Liftbot"); } diff --git a/engines/titanic/true_talk/maitred_script.cpp b/engines/titanic/true_talk/maitred_script.cpp index 8980da32a3..6b7a124a18 100644 --- a/engines/titanic/true_talk/maitred_script.cpp +++ b/engines/titanic/true_talk/maitred_script.cpp @@ -38,6 +38,7 @@ MaitreDScript::MaitreDScript(int val1, const char *charClass, int v2, CTrueTalkManager::setFlags(15, 0); CTrueTalkManager::setFlags(16, 0); + _mappings.load("Mappings/MaitreD", 1); loadRanges("Ranges/MaitreD"); loadResponses("Responses/MaitreD"); } diff --git a/engines/titanic/true_talk/parrot_script.cpp b/engines/titanic/true_talk/parrot_script.cpp index ecfc8e870d..5434b8b247 100644 --- a/engines/titanic/true_talk/parrot_script.cpp +++ b/engines/titanic/true_talk/parrot_script.cpp @@ -28,6 +28,7 @@ namespace Titanic { ParrotScript::ParrotScript(int val1, const char *charClass, int v2, const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) : TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7) { + _mappings.load("Mappings/Parrot", 1); loadRanges("Ranges/Parrot"); } diff --git a/engines/titanic/true_talk/succubus_script.cpp b/engines/titanic/true_talk/succubus_script.cpp index 403136880d..f0f2003556 100644 --- a/engines/titanic/true_talk/succubus_script.cpp +++ b/engines/titanic/true_talk/succubus_script.cpp @@ -29,6 +29,7 @@ SuccUBusScript::SuccUBusScript(int val1, const char *charClass, int v2, const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) : TTnpcScript(val1, charClass, v2, charName, v3, val2, v4, v5, v6, v7), _field2D0(0) { + _mappings.load("Mappings/SuccUBus", 1); loadRanges("Ranges/SuccUBus"); } diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp index 19ff05d134..e6b803a04c 100644 --- a/engines/titanic/true_talk/tt_npc_script.cpp +++ b/engines/titanic/true_talk/tt_npc_script.cpp @@ -55,6 +55,30 @@ TTscriptRange::TTscriptRange(uint id, const Common::Array<uint> &values, /*------------------------------------------------------------------------*/ +TTscriptMapping::TTscriptMapping() : _id(0) { + Common::fill(&_values[0], &_values[8], 0); +} + +/*------------------------------------------------------------------------*/ + +void TTscriptMappings::load(const char *name, int valuesPerMapping) { + Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name); + _valuesPerMapping = valuesPerMapping; + + while (r->pos() < r->size()) { + resize(size() + 1); + TTscriptMapping &m = (*this)[size() - 1]; + + m._id = r->readUint32LE(); + for (int idx = 0; idx < valuesPerMapping; ++idx) + m._values[idx] = r->readUint32LE(); + } + + delete r; +} + +/*------------------------------------------------------------------------*/ + TTnpcScriptBase::TTnpcScriptBase(int charId, const char *charClass, int v2, const char *charName, int v3, int val2, int v4, int v5, int v6, int v7) : TTscriptBase(0, charClass, v2, charName, v3, v4, v5, v6, v7), diff --git a/engines/titanic/true_talk/tt_npc_script.h b/engines/titanic/true_talk/tt_npc_script.h index 77f44453c7..66cb3af1c3 100644 --- a/engines/titanic/true_talk/tt_npc_script.h +++ b/engines/titanic/true_talk/tt_npc_script.h @@ -62,6 +62,20 @@ struct TTscriptRange { bool isSequential); }; +struct TTscriptMapping { + uint _id; + uint _values[8]; + + TTscriptMapping(); +}; + +class TTscriptMappings : public Common::Array<TTscriptMapping> { +public: + int _valuesPerMapping; + + void load(const char *name, int valuesPerMapping); +}; + class TTnpcScriptBase : public TTscriptBase { protected: int _field54; @@ -100,6 +114,7 @@ protected: Common::Array<TTnpcScriptResponse> _responses; int _valuesPerResponse; Common::Array<TTscriptRange> _ranges; + TTscriptMappings _mappings; const TTsentenceEntries *_entriesP; int _entryCount; int _field68; |