public override void Unpack(BinaryReader reader) { Id = reader.ReadUInt32(); Flags = (GfxObjFlags)reader.ReadUInt32(); Surfaces.UnpackSmartArray(reader); VertexArray.Unpack(reader); // Has Physics if ((Flags & GfxObjFlags.HasPhysics) != 0) { PhysicsPolygons.UnpackSmartArray(reader); PhysicsBSP.Unpack(reader, BSPType.Physics); } SortCenter = reader.ReadVector3(); // Has Drawing if ((Flags & GfxObjFlags.HasDrawing) != 0) { Polygons.UnpackSmartArray(reader); DrawingBSP.Unpack(reader, BSPType.Drawing); } if ((Flags & GfxObjFlags.HasDIDDegrade) != 0) { DIDDegrade = reader.ReadUInt32(); } }
public override void Unpack(BinaryReader reader) { Id = reader.ReadUInt32(); var fields = reader.ReadUInt32(); Surfaces.UnpackSmartArray(reader); VertexArray.Unpack(reader); // Has Physics if ((fields & 1) != 0) { PhysicsPolygons.UnpackSmartArray(reader); PhysicsBSP.Unpack(reader, BSPType.Physics); } SortCenter = reader.ReadVector3(); // Has Drawing if ((fields & 2) != 0) { Polygons.UnpackSmartArray(reader); DrawingBSP.Unpack(reader, BSPType.Drawing); } if ((fields & 8) != 0) { DIDDegrade = reader.ReadUInt32(); } }
public void Unpack(BinaryReader reader) { var numPolygons = reader.ReadUInt32(); var numPhysicsPolygons = reader.ReadUInt32(); var numPortals = reader.ReadUInt32(); VertexArray.Unpack(reader); Polygons.Unpack(reader, numPolygons); for (uint i = 0; i < numPortals; i++) { Portals.Add(reader.ReadUInt16()); } reader.AlignBoundary(); CellBSP.Unpack(reader, BSPType.Cell); PhysicsPolygons.Unpack(reader, numPhysicsPolygons); PhysicsBSP.Unpack(reader, BSPType.Physics); uint hasDrawingBSP = reader.ReadUInt32(); if (hasDrawingBSP != 0) { DrawingBSP = new BSPTree(); DrawingBSP.Unpack(reader, BSPType.Drawing); } reader.AlignBoundary(); }