• R/O
  • HTTP
  • SSH
  • HTTPS

tso2mqo: コミット

tso2mqo project


コミットメタ情報

リビジョン40faa30b9e6c7c7870a588e47916c8c2ffcfb82f (tree)
日時2015-01-30 04:00:17
作者nomeu <nomeu@nome...>
コミッターnomeu

ログメッセージ

attribute names are case-sensitive.

変更サマリ

差分

--- a/MqoReader.cs
+++ b/MqoReader.cs
@@ -11,7 +11,7 @@ namespace Tso2MqoGui
1111
1212 static char[] param_delimiters = new char[] { ' ', '\t', '(', ')' };
1313
14- StreamReader sr;
14+ StreamReader reader;
1515 MqoFile mqo;
1616 MqoObject obj;
1717
@@ -21,9 +21,9 @@ namespace Tso2MqoGui
2121
2222 public void Load(string path)
2323 {
24- using (FileStream fs = File.OpenRead(path))
24+ using (FileStream stream = File.OpenRead(path))
2525 {
26- sr = new StreamReader(fs, Encoding.Default);
26+ reader = new StreamReader(stream, Encoding.Default);
2727 mqo = new MqoFile();
2828 ReadAll();
2929 }
@@ -101,7 +101,7 @@ namespace Tso2MqoGui
101101 {
102102 for (int lineno = 1; ; ++lineno)
103103 {
104- string line = sr.ReadLine();
104+ string line = reader.ReadLine();
105105
106106 if (line == null)
107107 break;
@@ -293,16 +293,15 @@ namespace Tso2MqoGui
293293 for (int i = 1; i < tokens.Length; ++i)
294294 {
295295 string t = tokens[i];
296- string t2 = t.ToLower();
297-
298- if (t2.StartsWith("shader(")) m.shader = int.Parse(SplitParam(t)[1]);
299- else if (t2.StartsWith("col(")) m.col = Color3.Parse(SplitParam(t), 1);
300- else if (t2.StartsWith("dif(")) m.dif = float.Parse(SplitParam(t)[1]);
301- else if (t2.StartsWith("amb(")) m.amb = float.Parse(SplitParam(t)[1]);
302- else if (t2.StartsWith("emi(")) m.emi = float.Parse(SplitParam(t)[1]);
303- else if (t2.StartsWith("spc(")) m.spc = float.Parse(SplitParam(t)[1]);
304- else if (t2.StartsWith("power(")) m.power = float.Parse(SplitParam(t)[1]);
305- else if (t2.StartsWith("tex(")) m.tex = t.Substring(3).Trim('(', ')', '"');
296+
297+ if (t.StartsWith("shader(")) m.shader = int.Parse(SplitParam(t)[1]);
298+ else if (t.StartsWith("col(")) m.col = Color3.Parse(SplitParam(t), 1);
299+ else if (t.StartsWith("dif(")) m.dif = float.Parse(SplitParam(t)[1]);
300+ else if (t.StartsWith("amb(")) m.amb = float.Parse(SplitParam(t)[1]);
301+ else if (t.StartsWith("emi(")) m.emi = float.Parse(SplitParam(t)[1]);
302+ else if (t.StartsWith("spc(")) m.spc = float.Parse(SplitParam(t)[1]);
303+ else if (t.StartsWith("power(")) m.power = float.Parse(SplitParam(t)[1]);
304+ else if (t.StartsWith("tex(")) m.tex = t.Substring(3).Trim('(', ')', '"');
306305 }
307306 return true;
308307 }
@@ -389,7 +388,7 @@ namespace Tso2MqoGui
389388
390389 for (int lineno = 1; ; ++lineno)
391390 {
392- string line = sr.ReadLine();
391+ string line = reader.ReadLine();
393392
394393 if (line == null)
395394 break;
@@ -436,21 +435,20 @@ namespace Tso2MqoGui
436435 for (int i = 1; i < tokens.Length; ++i)
437436 {
438437 string t = tokens[i];
439- string t2 = t.ToLower();
440438
441- if (t2.StartsWith("v("))
439+ if (t.StartsWith("V("))
442440 {
443441 string[] t3 = SplitParam(t);
444442 f.a = ushort.Parse(t3[1]);
445443 f.b = ushort.Parse(t3[2]);
446444 f.c = ushort.Parse(t3[3]);
447445 }
448- else if (t2.StartsWith("m("))
446+ else if (t.StartsWith("M("))
449447 {
450448 string[] t3 = SplitParam(t);
451449 f.spec = ushort.Parse(t3[1]);
452450 }
453- else if (t2.StartsWith("uv("))
451+ else if (t.StartsWith("UV("))
454452 {
455453 string[] t3 = SplitParam(t);
456454 f.ta = Point2.Parse(t3, 1);
@@ -469,9 +467,8 @@ namespace Tso2MqoGui
469467 for (int i = 1; i < tokens.Length; ++i)
470468 {
471469 string t = tokens[i];
472- string t2 = t.ToLower();
473470
474- if (t2.StartsWith("v("))
471+ if (t.StartsWith("V("))
475472 {
476473 string[] t3 = SplitParam(t);
477474 f.a = ushort.Parse(t3[1]);
@@ -481,13 +478,13 @@ namespace Tso2MqoGui
481478 f2.b = f.c;
482479 f2.c = ushort.Parse(t3[4]);
483480 }
484- else if (t2.StartsWith("m("))
481+ else if (t.StartsWith("M("))
485482 {
486483 string[] t3 = SplitParam(t);
487484 f.spec = ushort.Parse(t3[1]);
488485 f2.spec = f.spec;
489486 }
490- else if (t2.StartsWith("uv("))
487+ else if (t.StartsWith("UV("))
491488 {
492489 string[] t3 = SplitParam(t);
493490 f.ta = Point2.Parse(t3, 1);
旧リポジトリブラウザで表示