예제 #1
0
        public static MaterialDefinition LoadFromXPathNavigator(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return(null);
            }

            MaterialDefinition materialDefinition = new MaterialDefinition();

            //name
            materialDefinition.Name     = navigator.GetAttribute("Name", String.Empty);
            materialDefinition.NameHash = Jenkins.OneAtATime(materialDefinition.Name);

            //type
            materialDefinition.Type     = navigator.GetAttribute("Type", String.Empty);
            materialDefinition.TypeHash = Jenkins.OneAtATime(materialDefinition.Type);

            //draw styles
            XPathNodeIterator entries = navigator.Select("./Array[@Name='DrawStyles']/Object[@Class='DrawStyle']");

            while (entries.MoveNext())
            {
                DrawStyle drawStyle = DrawStyle.LoadFromXPathNavigator(entries.Current);

                if (drawStyle != null)
                {
                    materialDefinition.DrawStyles.Add(drawStyle);
                }
            }

            return(materialDefinition);
        }
예제 #2
0
파일: DrawStyle.cs 프로젝트: psemu/ps2ls
        public static DrawStyle LoadFromXPathNavigator(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return null;
            }

            DrawStyle drawStyle = new DrawStyle();

            //name
            drawStyle.Name = navigator.GetAttribute("Name", String.Empty);
            drawStyle.NameHash = Jenkins.OneAtATime(drawStyle.Name);

            //effect
            drawStyle.Effect = navigator.GetAttribute("Effect", String.Empty);

            //input layout
            String vertexLayout = navigator.GetAttribute("InputLayout", String.Empty);
            drawStyle.VertexLayoutNameHash = Jenkins.OneAtATime(vertexLayout);

            return drawStyle;
        }
예제 #3
0
        public static DrawStyle LoadFromXPathNavigator(XPathNavigator navigator)
        {
            if (navigator == null)
            {
                return(null);
            }

            DrawStyle drawStyle = new DrawStyle();

            //name
            drawStyle.Name     = navigator.GetAttribute("Name", String.Empty);
            drawStyle.NameHash = Cryptography.JenkinsOneAtATime(drawStyle.Name);

            //effect
            drawStyle.Effect = navigator.GetAttribute("Effect", String.Empty);

            //input layout
            string vertexLayout = navigator.GetAttribute("InputLayout", String.Empty);

            drawStyle.VertexLayoutNameHash = Cryptography.JenkinsOneAtATime(vertexLayout);

            return(drawStyle);
        }