diff --git a/model2obj/Program.cs b/model2obj/Program.cs index 581c49d..05909be 100644 --- a/model2obj/Program.cs +++ b/model2obj/Program.cs @@ -3,12 +3,26 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using ShenmueDKSharp; using ShenmueDKSharp.Files.Models; namespace model2obj { class Program { + static void ExportMT7(string mt7Filepath, string objFilepath) + { + MT7 mt7 = new MT7(mt7Filepath); + OBJ obj = new OBJ(mt7); + obj.Write(objFilepath); + } + static void ExportMT5(string mt5Filepath, string objFilepath) + { + MT5 mt5 = new MT5(mt5Filepath); + OBJ obj = new OBJ(mt5); + obj.Write(objFilepath); + } + static void Main(string[] args) { if (args.Count() < 3 || args[0].Contains("-h") || args[0].Contains("--help") || args[0].Contains("/?")) @@ -17,34 +31,10 @@ static void Main(string[] args) return; } - bool MT5convert = false, MT7convert = false; - - string modelSource; - string modelDestination; - - modelSource = args[1]; - modelDestination = args[2]; - Console.WriteLine("Source: {0}\nDestination: {1}", modelSource, modelDestination); - if((args[0].Contains("--mt5") || args[0].Contains("-mt5"))) - MT5convert = true; + ExportMT5(args[1], args[2]); if ((args[0].Contains("--mt7") || args[0].Contains("-mt7"))) - MT7convert = true; - - if(MT5convert) - { - MT5 tmpMT5 = new MT5(modelSource); - OBJ tmpOBJ = new OBJ(tmpMT5); - - tmpOBJ.Write(modelDestination); - } - else if (MT7convert) - { - MT7 tmpMT7 = new MT7(modelSource); - OBJ tmpOBJ = new OBJ(tmpMT7); - - tmpOBJ.Write(modelDestination); - } + ExportMT7(args[1], args[2]); } } }