void BedheadEntry::load(Common::SeekableReadStream *s) { _name1 = readStringFromStream(s); _name2 = readStringFromStream(s); _name3 = readStringFromStream(s); _name4 = readStringFromStream(s); _startFrame = s->readUint32LE(); _endFrame = s->readUint32LE(); }
void TitanicEngine::setItemNames() { Common::SeekableReadStream *r; r = g_vm->_filesManager->getResource("TEXT/ITEM_NAMES"); while (r->pos() < r->size()) _itemNames.push_back(readStringFromStream(r)); delete r; r = g_vm->_filesManager->getResource("TEXT/ITEM_DESCRIPTIONS"); while (r->pos() < r->size()) _itemDescriptions.push_back(readStringFromStream(r)); delete r; r = g_vm->_filesManager->getResource("TEXT/ITEM_IDS"); while (r->pos() < r->size()) _itemIds.push_back(readStringFromStream(r)); 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; }
void TTcommonPhraseArray::load(const char *name) { Common::SeekableReadStream *r = g_vm->_filesManager->getResource(name); while (r->pos() < r->size()) { TTcommonPhrase cp; cp._str = readStringFromStream(r); cp._dialogueId = r->readUint32LE(); cp._roomNum = r->readUint32LE(); cp._val1 = r->readUint32LE(); push_back(cp); } delete r; }
CMusicSong::CMusicSong(int index) { // Read in the list of song strings Common::SeekableReadStream *res = g_vm->_filesManager->getResource("MUSIC/PARSER"); Common::StringArray parserStrings; while (res->pos() < res->size()) parserStrings.push_back(readStringFromStream(res)); delete res; // Set up a new song parser with the desired string CSongParser parser(parserStrings[index].c_str()); // Count how many encoded values there are CValuePair r; int count = 0; while (parser.parse(r)) ++count; assert(count > 0); // Read in the values to the array _data.resize(count); parser.reset(); for (int idx = 0; idx < count; ++idx) parser.parse(_data[idx]); // Figure out the range of values in the array _minVal = 0x7FFFFFFF; int maxVal = -0x7FFFFFFF; for (int idx = 0; idx < count; ++idx) { CValuePair &vp = _data[idx]; if (vp._data != 0x7FFFFFFF) { if (vp._data < _minVal) _minVal = vp._data; if (vp._data > maxVal) maxVal = vp._data; } } _range = maxVal - _minVal; }
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 TitanicEngine::setRoomNames() { Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/ROOM_NAMES"); while (r->pos() < r->size()) _roomNames.push_back(readStringFromStream(r)); delete r; }
void LinkUpdatorEntry::load(Common::SeekableReadStream *s) { _linkStr = readStringFromStream(s); for (int idx = 0; idx < 8; ++idx) _vals[idx] = s->readByte(); }
void Strings::load() { Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/STRINGS"); while (r->pos() < r->size()) push_back(readStringFromStream(r)); delete r; }
void CMissiveOMat::loadArray(CString *arr, const CString &resName, int count) { Common::SeekableReadStream *s = g_vm->_filesManager->getResource(resName); for (int idx = 0; idx < count; ++idx) arr[idx] = readStringFromStream(s); delete s; }