public static ShaderProcess ParseXmlElement(XmlElement el) { ShaderProcess process = new ShaderProcess(); process.name = el.Attributes["name"].InnerText; process.mode = el.GetAttribute("mode"); // process lines XmlNodeList lineEls = el.SelectNodes("line"); process.lines = new ShaderLine[lineEls.Count]; for (int i = 0; i < lineEls.Count; i++) { process.lines[i] = new ShaderLine(lineEls[i].InnerText); } return process; }
public static ShaderProcess ParseXmlElement(XmlElement el) { ShaderProcess process = new ShaderProcess(); process.name = el.Attributes["name"].InnerText; process.mode = el.GetAttribute("mode"); // process lines XmlNodeList lineEls = el.SelectNodes("line"); process.lines = new ShaderLine[lineEls.Count]; for (int i = 0; i < lineEls.Count; i++) { process.lines[i] = new ShaderLine(lineEls[i].InnerText); } return(process); }
protected static void ParseXml(XmlElement el, Shader shader) { shader.id = el.Attributes["id"].InnerText; // parse inputs XmlNodeList inputEls = el.SelectNodes("input"); shader.inputs = new Dictionary <string, Input>(inputEls.Count); for (int i = 0; i < inputEls.Count; i++) { Input input = Input.ParseXmlElement((XmlElement)inputEls[i]); shader.inputs.Add(input.Name, input); } // parse processes XmlNodeList processEls = el.SelectNodes("process"); shader.processes = new ShaderProcess[processEls.Count]; for (int i = 0; i < processEls.Count; i++) { shader.processes[i] = ShaderProcess.ParseXmlElement((XmlElement)processEls[i]); } }