Example #1
0
void Obstacles::load(SaveFileReadStream &f) {
	for (int i = 0; i < kPolygonCount; ++i) {
		_polygons[i].isPresent = false;
		_polygons[i].verticeCount = 0;
		_polygonsBackup[i].isPresent = false;
		_polygonsBackup[i].verticeCount = 0;
	}

	_backup = f.readBool();
	_count = f.readInt();
	for (int i = 0; i < _count; ++i) {
		Polygon &p = _polygonsBackup[i];
		p.isPresent = f.readBool();
		p.verticeCount = f.readInt();
		p.rect.x0 = f.readFloat();
		p.rect.y0 = f.readFloat();
		p.rect.x1 = f.readFloat();
		p.rect.y1 = f.readFloat();
		for (int j = 0; j < kPolygonVertexCount; ++j) {
			p.vertices[j] = f.readVector2();
		}
		for (int j = 0; j < kPolygonVertexCount; ++j) {
			p.vertexType[j] = (VertexType)f.readInt();
		}
	}

	for (int i = 0; i < kPolygonCount; ++i) {
		_polygons[i] = _polygonsBackup[i];
	}

	for (int i = 0; i < kVertexCount; ++i) {
		_vertices[i] = f.readVector2();
	}
	_verticeCount = f.readInt();
}
Example #2
0
void Items::load(SaveFileReadStream &f) {
	for (int i = _items.size() - 1; i >= 0; i--) {
		delete _items.remove_at(i);
	}
	_items.resize(f.readInt());

	int size = (int)_items.size();

	int i;
	for (i = 0; i != size; ++i) {
		_items[i] = new Item(_vm);
		_items[i]->load(f);
	}

	// Always read out 100 items
	for (; i != 100; ++i) {
		f.skip(0x174); // bbox + rect + 18 float fields
	}
}
Example #3
0
void Overlays::load(SaveFileReadStream &f) {
	for (int i = 0; i < kOverlayVideos; ++i) {
		// 37 bytes per overlay
		Video &ov = _videos[i];

		ov.loaded = f.readBool();
		f.skip(4); // vqaPlayer pointer
		ov.vqaPlayer = nullptr;
		ov.name = f.readStringSz(13);
		ov.hash = f.readSint32LE();
		ov.loopId = f.readInt();
		ov.loopForever = f.readBool();
		ov.frame = f.readInt();
	}
}
Example #4
0
void CrimesDatabase::load(SaveFileReadStream &f) {
	for (int i = 0; i < _crimeCount; ++i) {
		_crimes[i] = f.readByte();
	}
}
Example #5
0
void Item::load(SaveFileReadStream &f) {
	_setId = f.readInt();
	_itemId = f.readInt();
	_boundingBox = f.readBoundingBox(false);
	_screenRectangle = f.readRect();
	_animationId = f.readInt();
	_position = f.readVector3();
	_facing  = f.readInt();
	_angle = f.readFloat();
	_width = f.readInt();
	_height = f.readInt();
	_screenX = f.readInt();
	_screenY = f.readInt();
	_depth = f.readFloat();
	_isTarget = f.readBool();
	_isSpinning = f.readBool();
	_facingChange = f.readInt();
	f.skip(4);
	_isVisible = f.readBool();
	_isPoliceMazeEnemy = f.readBool();
}
Example #6
0
void GameFlags::load(SaveFileReadStream &f) {
	for (int i = 0; i != _flagCount / 32 + 1; ++i) {
		_flags[i] = f.readUint32LE();
	}
}
Example #7
0
void Spinner::load(SaveFileReadStream &f) {
	for (int i = 0; i != kSpinnerDestinations; ++i) {
		_isDestinationSelectable[i] = f.readBool();
	}
}