OSDN Git Service

ColorTexはnullでもよい from tso2mqo-040
authornomeu <nomeu@72ae2088-5f33-de11-a17b-0000e250a282>
Sat, 17 Sep 2011 03:16:13 +0000 (03:16 +0000)
committernomeu <nomeu@72ae2088-5f33-de11-a17b-0000e250a282>
Sat, 17 Sep 2011 03:16:13 +0000 (03:16 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/tdcgexplorer/trunk/tso2mqo@2011 72ae2088-5f33-de11-a17b-0000e250a282

MqoWriter.cs

index 13d1fa3..47592e5 100644 (file)
@@ -147,10 +147,18 @@ namespace Tso2MqoGui
 \r
             foreach(TSOMaterial i in file.materials)\r
             {\r
-                TSOTex  tex = file.texturemap[i.ColorTex];\r
-                tw.WriteLine(\r
-                    "  \"{0}\" shader(3) col(1.00 1.00 1.00 1.00) dif(0.800) amb(0.600) emi(0.000) spc(0.000) power(5.00) tex(\"{1}\")",\r
-                    i.name, Path.Combine(OutPath, tex.File.Trim('"')));\r
+                if(i.ColorTex != null)\r
+                {\r
+                    TSOTex  tex = file.texturemap[i.ColorTex];\r
+                    tw.WriteLine(\r
+                        "      \"{0}\" shader(3) col(1.00 1.00 1.00 1.00) dif(0.800) amb(0.600) emi(0.000) spc(0.000) power(5.00) tex(\"{1}\")",\r
+                        i.name, Path.Combine(OutPath, tex.File.Trim('"')));\r
+                } else\r
+                {\r
+                    tw.WriteLine(\r
+                        "      \"{0}\" shader(3) col(1.00 1.00 1.00 1.00) dif(0.800) amb(0.600) emi(0.000) spc(0.000) power(5.00))",\r
+                        i.name);\r
+                }\r
             }\r
 \r
             tw.WriteLine("}");\r