private void UpdateSelectedTextureControlValues(int index) { Nud.MatTexture tex = currentMaterialList[currentMatIndex].textures[index]; textureIdTB.Text = tex.hash.ToString("X"); mapModeComboBox.SelectedItem = mapModeByMatValue[tex.mapMode]; wrapXComboBox.SelectedItem = wrapModeByMatValue[tex.wrapModeS]; wrapYComboBox.SelectedItem = wrapModeByMatValue[tex.wrapModeT]; minFilterComboBox.SelectedItem = minFilterByMatValue[tex.minFilter]; magFilterComboBox.SelectedItem = magFilterByMatValue[tex.magFilter]; mipDetailComboBox.SelectedItem = mipDetailByMatValue[tex.mipDetail]; }
private static void ReadTextures(Nud.Material material, XmlNode textureNode) { if (!(textureNode.Name.Equals("texture"))) { return; } Nud.MatTexture matTexture = new Nud.MatTexture(); material.textures.Add(matTexture); foreach (XmlAttribute attribute in textureNode.Attributes) { switch (attribute.Name) { case "hash": int.TryParse(attribute.Value, NumberStyles.HexNumber, null, out matTexture.hash); break; case "wrapmodeS": int.TryParse(attribute.Value, out matTexture.wrapModeS); break; case "wrapmodeT": int.TryParse(attribute.Value, out matTexture.wrapModeT); break; case "minfilter": int.TryParse(attribute.Value, out matTexture.minFilter); break; case "magfilter": int.TryParse(attribute.Value, out matTexture.magFilter); break; case "mipdetail": int.TryParse(attribute.Value, out matTexture.mipDetail); break; } } }