コード例 #1
0
 /// <inheritdoc/>
 public void LoadBinaryData(byte[] inData)
 {
     using (var ms = new MemoryStream(inData))
     {
         using (var br = new BinaryReader(ms))
         {
             for (var y = 0; y < 16; ++y)
             {
                 if (y % 2 == 0)
                 {
                     // Read a block of 9 high res vertices
                     for (var x = 0; x < 9; ++x)
                     {
                         HighResVertices.Add(br.ReadSingle());
                     }
                 }
                 else
                 {
                     // Read a block of 8 low res vertices
                     for (var x = 0; x < 8; ++x)
                     {
                         LowResVertices.Add(br.ReadSingle());
                     }
                 }
             }
         }
     }
 }
コード例 #2
0
ファイル: WorldLODMapArea.cs プロジェクト: Xalcon/libwarcraft
        /// <inheritdoc/>
        public void LoadBinaryData(byte[] inData)
        {
            using (var ms = new MemoryStream(inData))
            {
                using (var br = new BinaryReader(ms))
                {
                    // TODO: Verify if this isn't mapped the same way as ADT.Chunks.MapChunkHeightmap
                    for (var y = 0; y < 17; ++y)
                    {
                        for (var x = 0; x < 17; ++x)
                        {
                            HighResVertices.Add(br.ReadInt16());
                        }
                    }

                    for (var y = 0; y < 16; ++y)
                    {
                        for (var x = 0; x < 16; ++x)
                        {
                            LowResVertices.Add(br.ReadInt16());
                        }
                    }
                }
            }
        }