예제 #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();
}
예제 #2
0
파일: item.cpp 프로젝트: athrxx/scummvm
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();
}