示例#1
0
文件: GfxObj.cs 项目: zarlant/ACE
        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();
            }
        }
示例#2
0
文件: GfxObj.cs 项目: jacobtipp/trACE
        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();
            }
        }