internal void Read(GrnNode textureMap) { // -- Each TextureMap has width height, depth?, and dataExtRef GrnTextureMapImageNode mapImage = textureMap.FindNode <GrnTextureMapImageNode>( GrnNodeType.TextureMapImage); if (mapImage != null) { this.Width = mapImage.Width; this.Height = mapImage.Height; } this.DataExtensionIndex = textureMap.FindNode <GrnDataExtensionReferenceNode>( GrnNodeType.DataExtensionReference).DataExtensionIndex - 1; }
public void Write(GrnNode texSecNode) { GrnNode texMapNode = new GrnNode(texSecNode, GrnNodeType.TextureMap); texSecNode.AppendChild(texMapNode); GrnNode texImSecNode = new GrnNode(texMapNode, GrnNodeType.TextureImageSection); texMapNode.AppendChild(texImSecNode); GrnTextureMapImageNode texMapImNode = new GrnTextureMapImageNode(texImSecNode); texMapImNode.Width = this.Width; texMapImNode.Height = this.Height; texImSecNode.AppendChild(texMapImNode); GrnDataExtensionReferenceNode refNode = new GrnDataExtensionReferenceNode(texMapNode); refNode.DataExtensionIndex = this.DataExtensionIndex + 1; texMapNode.AppendChild(refNode); }