Exemplo n.º 1
0
        public void WriteXml(StringBuilder sb, int indent, byte[] allHeightmapData)
        {
            Vector2 p = new Vector2();

            p.X = PositionX / 4.0f;
            p.Y = PositionY / 4.0f;
            float minz = MinZ / 32.0f;
            float maxz = MaxZ / 32.0f;

            YndXml.SelfClosingTag(sb, indent, "Position " + FloatUtil.GetVector2XmlString(p));
            YndXml.ValueTag(sb, indent, "MinZ", FloatUtil.ToString(minz));
            YndXml.ValueTag(sb, indent, "MaxZ", FloatUtil.ToString(maxz));
            YndXml.ValueTag(sb, indent, "SizeX", HeightmapDimX.ToString());
            YndXml.ValueTag(sb, indent, "SizeY", HeightmapDimY.ToString());

            byte[] hmdata   = null;
            int    hmbcount = HeightmapDimX * HeightmapDimY;

            if (hmbcount > 0)
            {
                hmdata = new byte[hmbcount];
                Buffer.BlockCopy(allHeightmapData, HeightmapPtr, hmdata, 0, hmbcount);
            }
            YndXml.WriteRawArray(sb, hmdata, indent, "Heightmap", "", RelXml.FormatHexByte, Math.Max(HeightmapDimX, (byte)1));
        }
Exemplo n.º 2
0
 public override string ToString()
 {
     return(PositionX.ToString() + ", " + PositionY.ToString() + ": " + MinZ.ToString() + ", " + MaxZ.ToString() + ": " + HeightmapDimX.ToString() + " x " + HeightmapDimY.ToString());
 }