示例#1
0
        /// <inheritdoc/>
        public void LoadBinaryData(byte[] inData)
        {
            using (var ms = new MemoryStream(inData))
            {
                using (var br = new BinaryReader(ms))
                {
                    XVertexCount = br.ReadUInt32();
                    YVertexCount = br.ReadUInt32();

                    WidthTileFlags  = br.ReadUInt32();
                    HeightTileFlags = br.ReadUInt32();

                    Location      = br.ReadVector3();
                    MaterialIndex = br.ReadUInt16();

                    var vertexCount = XVertexCount * YVertexCount;
                    for (var i = 0; i < vertexCount; ++i)
                    {
                        LiquidVertices.Add(new LiquidVertex(br.ReadBytes(LiquidVertex.GetSize())));
                    }

                    var tileFlagCount = WidthTileFlags * HeightTileFlags;
                    for (var i = 0; i < tileFlagCount; ++i)
                    {
                        LiquidTileFlags.Add((LiquidFlags)br.ReadByte());
                    }
                }
            }
        }
示例#2
0
        public void LoadBinaryData(byte[] inData)
        {
            using (MemoryStream ms = new MemoryStream(inData))
            {
                using (BinaryReader br = new BinaryReader(ms))
                {
                    this.WidthVertices  = br.ReadUInt32();
                    this.HeightVertices = br.ReadUInt32();

                    this.WidthTileFlags  = br.ReadUInt32();
                    this.HeightTileFlags = br.ReadUInt32();

                    this.Location      = br.ReadVector3();
                    this.MaterialIndex = br.ReadUInt16();

                    uint vertexCount = this.WidthVertices * this.HeightVertices;
                    for (int i = 0; i < vertexCount; ++i)
                    {
                        this.LiquidVertices.Add(new LiquidVertex(br.ReadBytes(LiquidVertex.GetSize())));
                    }

                    uint tileFlagCount = this.WidthTileFlags * this.HeightTileFlags;
                    for (int i = 0; i < tileFlagCount; ++i)
                    {
                        this.LiquidTileFlags.Add((LiquidFlags)br.ReadByte());
                    }
                }
            }
        }