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/true_talk/tt_npc_script.cpp | |
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/true_talk/tt_npc_script.cpp')
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
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), |