Exemplo n.º 1
0
 //============================================================
 // <T>加载配置信息。</T>
 //
 // @param xconfig 配置信息
 //============================================================
 public void LoadConfig(FXmlNode xconfig)
 {
     _name = xconfig.Get("name");
     if (xconfig.Contains("render_target_size"))
     {
         _renderTargetSize.Parse(xconfig.Get("render_target_size"));
     }
 }
Exemplo n.º 2
0
        //============================================================
        // <T>加载配置信息。</T>
        //
        // @param config 配置信息
        //============================================================
        public void LoadConfig(FXmlNode xconfig)
        {
            // 加载编号
            _id = xconfig.GetInteger("id");
            // 加载名称
            _name = xconfig.Get("name");
            // 加载层数
            _layerCount = xconfig.GetInteger("layer_count");
            // 加载尺寸
            _size.Parse(xconfig.Get("size"));
            // 加载切割尺寸
            _range.Parse(xconfig.Get("range"));
            // 加载深度
            _deep = xconfig.GetFloat("deep");

            _incise = RInt.Parse(xconfig.GetFloat("deep"));
            //............................................................
            // 加载高度纹理
            FXmlNode xheight = xconfig.Find("Height");

            if (null != xheight)
            {
                _textureHeight = xheight.Get("source");
            }
            // 加载颜色纹理
            FXmlNode xcolor = xconfig.Find("Color");

            if (null != xcolor)
            {
                _textureColor = xcolor.Get("source");
            }
            //............................................................
            // 加载层信息
            FXmlNode xlayers = xconfig.Find("Layers");

            if (null != xlayers)
            {
                foreach (FXmlNode xlayer in xlayers.Nodes)
                {
                    FDrMapLayer layer = new FDrMapLayer();
                    layer.Index = _layers.Count;
                    layer.LoadConfig(xlayer);
                    _layers.Push(layer);
                }
            }
        }