Example #1
0
        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();
            }
        }
Example #2
0
        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();
            }
        }