2 using System.Collections.Generic;
\r
5 using System.Windows.Forms;
\r
12 /// アプリケーションのメイン エントリ ポイントです。
\r
15 static int Main(string[] args)
\r
17 if (args.Length != 0)
\r
22 string tso_file = null;
\r
23 string mqo_file = null;
\r
24 string tsoref_file = null;
\r
25 string out_path = null;
\r
27 foreach (string arg in args)
\r
29 string opt = arg.ToLower();
\r
31 if (opt.StartsWith("-tso:"))
\r
32 tso_file = opt.Substring(5).Trim('\r', '\n');
\r
33 else if (opt.StartsWith("-mqo:"))
\r
34 mqo_file = opt.Substring(5).Trim('\r', '\n');
\r
35 else if (opt.StartsWith("-ref:"))
\r
36 tsoref_file = opt.Substring(5).Trim('\r', '\n');
\r
37 else if (opt.StartsWith("-out:"))
\r
38 out_path = opt.Substring(5).Trim('\r', '\n');
\r
40 throw new ArgumentException("Invalid option: " + arg);
\r
43 if (tso_file == null)
\r
44 throw new ArgumentException("-tso:ファイル名 の形式で出力Tsoファイル名を指定してください");
\r
46 if (out_path != null)
\r
48 MqoGenerator gen = new MqoGenerator();
\r
49 gen.Generate(tso_file, out_path, MqoBoneMode.None);
\r
53 if (mqo_file == null)
\r
54 throw new ArgumentException("-mso:ファイル名 の形式で入力Mqoファイル名を指定してください");
\r
55 if (tsoref_file == null)
\r
56 throw new ArgumentException("-ref:ファイル名 の形式で参照Tsoファイル名を指定してください");
\r
58 TSOGeneratorConfig config = new TSOGeneratorConfig();
\r
60 config.ShowMaterials = false;
\r
61 TSOGeneratorRefBone gen = new TSOGeneratorRefBone(config);
\r
63 gen.Generate(mqo_file, tsoref_file, tso_file);
\r
66 catch (ArgumentException e)
\r
68 System.Diagnostics.Debug.WriteLine(e.Message);
\r
69 System.Console.Out.WriteLine(e.Message);
\r
70 System.Console.Out.Flush();
\r
73 catch (Exception exception)
\r
75 System.Diagnostics.Debug.WriteLine(exception.Message);
\r
76 System.Console.Out.WriteLine(exception.Message);
\r
77 System.Console.Out.Flush();
\r
84 Application.EnableVisualStyles();
\r
85 Application.SetCompatibleTextRenderingDefault(false);
\r
86 Application.Run(new Form1());
\r