diff options
Diffstat (limited to 'engines/titanic/true_talk/tt_npc_script.cpp')
-rw-r--r-- | engines/titanic/true_talk/tt_npc_script.cpp | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/engines/titanic/true_talk/tt_npc_script.cpp b/engines/titanic/true_talk/tt_npc_script.cpp index 7a2ab856d8..dde16d15ca 100644 --- a/engines/titanic/true_talk/tt_npc_script.cpp +++ b/engines/titanic/true_talk/tt_npc_script.cpp @@ -105,123 +105,6 @@ static const uint RANDOM9[] = { /*------------------------------------------------------------------------*/ -int TTnpcScriptResponse::size() const { - for (int idx = 0; idx < 4; ++idx) { - if (_values[idx] == 0) - return idx; - } - - return 4; -} - -/*------------------------------------------------------------------------*/ - -TTscriptRange::TTscriptRange(uint id, const Common::Array<uint> &values, - bool isRandom, bool isSequential) : - _id(id), _nextP(nullptr) { - _mode = SF_NONE; - if (isRandom) - _mode = SF_RANDOM; - if (isSequential) - _mode = SF_SEQUENTIAL; - - for (uint idx = 0; idx < values.size(); ++idx) - _values.push_back(values[idx]); -} - -/*------------------------------------------------------------------------*/ - - -bool TTsentenceEntry::load(Common::SeekableReadStream *s) { - if (s->pos() >= s->size()) - return false; - - _field0 = s->readUint32LE(); - _field4 = s->readUint32LE(); - _string8 = readStringFromStream(s); - _fieldC = s->readUint32LE(); - _string10 = readStringFromStream(s); - _string14 = readStringFromStream(s); - _string18 = readStringFromStream(s); - _string1C = readStringFromStream(s); - _field20 = s->readUint32LE(); - _string24 = readStringFromStream(s); - _field28 = s->readUint32LE(); - _field2C = s->readUint32LE(); - _field30 = s->readUint32LE(); - - return true; -} - -/*------------------------------------------------------------------------*/ - -void TTsentenceEntries::load(const CString &resName) { - TTsentenceEntry entry; - Common::SeekableReadStream *r = g_vm->_filesManager->getResource(resName); - - while (entry.load(r)) - push_back(entry); - - delete r; -} - -/*------------------------------------------------------------------------*/ - -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; -} - -/*------------------------------------------------------------------------*/ - -void TTtagMappings::load(const char *name) { - Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name); - - while (r->pos() < r->size()) { - uint src = r->readUint32LE(); - uint dest = r->readUint32LE(); - - push_back(TTtagMapping(src, dest)); - } - - delete r; -} - -/*------------------------------------------------------------------------*/ - -void TTwordEntries::load(const char *name) { - Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name); - - while (r->pos() < r->size()) { - TTwordEntry we; - we._id = r->readUint32LE(); - we._text = readStringFromStream(r); - - push_back(we); - } - - 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), |