Ejemplo n.º 1
0
 static void LoadHeightMap_override(ref float[] heightMap, XmlNode HeightMap, int width, int height)
 {
     foreach (XmlNode HexCellData in HeightMap.SelectNodes("Cell"))
     {
         int   Xindex = int.Parse(HexCellData.SelectSingleNode("Xindex").InnerText);
         float Y      = float.Parse(HexCellData.SelectSingleNode("Y").InnerText, CInfo);
         int   Zindex = int.Parse(HexCellData.SelectSingleNode("Zindex").InnerText);
         heightMap[Zindex * width + Xindex] = Y;
     }
 }
Ejemplo n.º 2
0
        static void LoadColorMap_override(ref Color[] colorMap, XmlNode ColorMap, int width, int height, Color defaultColor)
        {
            for (int i = 0; i < colorMap.Length; i++)
            {
                colorMap[i] = defaultColor;
            }

            foreach (XmlNode HexCellData in ColorMap.SelectNodes("Cell"))
            {
                int Xindex = int.Parse(HexCellData.SelectSingleNode("Xindex").InnerText);
                int Zindex = int.Parse(HexCellData.SelectSingleNode("Zindex").InnerText);

                XmlNode colorNode = HexCellData.SelectSingleNode("Color");

                float r = float.Parse(colorNode.SelectSingleNode("Red").InnerText, CInfo);
                float g = float.Parse(colorNode.SelectSingleNode("Green").InnerText, CInfo);
                float b = float.Parse(colorNode.SelectSingleNode("Blue").InnerText, CInfo);

                colorMap[Zindex * width + Xindex] = new Color(r, g, b);
            }
        }