From 8c1a783f6c8da707c9e31f82216b7f1803d55184 Mon Sep 17 00:00:00 2001 From: nomeu Date: Sun, 12 May 2013 16:38:13 +0900 Subject: [PATCH] improve encapsulation --- FormMaterial.cs | 6 +++--- TSOGenerator.cs | 16 ++++++++-------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/FormMaterial.cs b/FormMaterial.cs index 4bc77cf..946e569 100644 --- a/FormMaterial.cs +++ b/FormMaterial.cs @@ -25,9 +25,9 @@ namespace Tso2MqoGui { ListViewItem item = lvMaterials.Items.Add(mat_info.Name); item.Tag = mat_info; - item.SubItems.Add(mat_info.diffuse == null ? "" : mat_info.diffuse); - item.SubItems.Add(mat_info.shadow == null ? "" : mat_info.shadow); - item.SubItems.Add(mat_info.shader == null ? "" : mat_info.shader); + item.SubItems.Add(mat_info.DiffuseTexture ?? ""); + item.SubItems.Add(mat_info.ShadowTexture ?? ""); + item.SubItems.Add(mat_info.ShaderFile ?? ""); } } diff --git a/TSOGenerator.cs b/TSOGenerator.cs index 48d06c1..d7e378c 100644 --- a/TSOGenerator.cs +++ b/TSOGenerator.cs @@ -83,15 +83,15 @@ namespace Tso2MqoGui foreach (MaterialInfo i in materials.Values) { - string name = Path.GetFileNameWithoutExtension(i.diffuse); + string name = Path.GetFileNameWithoutExtension(i.DiffuseTexture); if (!textures.ContainsKey(name)) - textures.Add(name, new TextureInfo(name, i.diffuse)); + textures.Add(name, new TextureInfo(name, i.DiffuseTexture)); - name = Path.GetFileNameWithoutExtension(i.shadow); + name = Path.GetFileNameWithoutExtension(i.ShadowTexture); if (!textures.ContainsKey(name)) - textures.Add(name, new TextureInfo(name, i.shadow)); + textures.Add(name, new TextureInfo(name, i.ShadowTexture)); } return true; @@ -797,10 +797,10 @@ namespace Tso2MqoGui public class MaterialInfo { - public string name; - public string shader; - public string diffuse; - public string shadow; + string name; + string shader; + string diffuse; + string shadow; //public Dictionary parameters; public MaterialInfo(string path, MqoMaterial mat, ImportMaterialInfo import_mat_info) -- 2.11.0