예제 #1
0
void BedheadEntry::load(Common::SeekableReadStream *s) {
	_name1 = readStringFromStream(s);
	_name2 = readStringFromStream(s);
	_name3 = readStringFromStream(s);
	_name4 = readStringFromStream(s);
	_startFrame = s->readUint32LE();
	_endFrame = s->readUint32LE();
}
예제 #2
0
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;
}
예제 #3
0
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;
}
예제 #4
0
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;
}
예제 #5
0
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;
}
예제 #6
0
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;
}
예제 #7
0
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;
}
예제 #8
0
void LinkUpdatorEntry::load(Common::SeekableReadStream *s) {
	_linkStr = readStringFromStream(s);
	for (int idx = 0; idx < 8; ++idx)
		_vals[idx] = s->readByte();
}
예제 #9
0
void Strings::load() {
	Common::SeekableReadStream *r = g_vm->_filesManager->getResource("TEXT/STRINGS");
	while (r->pos() < r->size())
		push_back(readStringFromStream(r));
	delete r;
}
예제 #10
0
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;
}