diff --git a/ShenmueDKSharp b/ShenmueDKSharp index 5b01f21..bbb012c 160000 --- a/ShenmueDKSharp +++ b/ShenmueDKSharp @@ -1 +1 @@ -Subproject commit 5b01f21a765c0ac339f216783798d9718da67890 +Subproject commit bbb012c21a542455c5aa869cb73040a7c0c4085f diff --git a/wudecon/Program.cs b/wudecon/Program.cs index 6f8510f..9ddd339 100644 --- a/wudecon/Program.cs +++ b/wudecon/Program.cs @@ -35,11 +35,12 @@ static void ExportMT7(string path, string objFilepath) foreach (string file in myFiles) { var currentChildDir = objFilepath + "\\" + Path.GetDirectoryName(file.Replace(path, "")); - if (!Directory.Exists(currentChildDir)) - Directory.CreateDirectory(currentChildDir); + string filename = Path.GetFileName(file); + string dest = currentChildDir + "\\_" + filename + "_\\" + Path.ChangeExtension(filename, ".obj"); + string dir = Path.GetDirectoryName(dest); + if (!Directory.Exists(dir)) + Directory.CreateDirectory(dir); - string dest = currentChildDir + "\\" + Path.GetFileName(file) + ".OBJ"; - try { if(bVerbose) @@ -104,10 +105,11 @@ static void ExportMT5(string path, string objFilepath) foreach (string file in myFiles) { var currentChildDir = objFilepath + "\\" + Path.GetDirectoryName(file.Replace(path, "")); - if (!Directory.Exists(currentChildDir)) - Directory.CreateDirectory(currentChildDir); - - string dest = currentChildDir + "\\" + Path.GetFileName(file) + ".OBJ"; + string filename = Path.GetFileName(file); + string dest = currentChildDir + "\\_" + filename + "_\\" + Path.ChangeExtension(filename, ".obj"); + string dir = Path.GetDirectoryName(dest); + if (!Directory.Exists(dir)) + Directory.CreateDirectory(dir); try { @@ -172,17 +174,16 @@ static void ExtractPKF(string path, string folder) foreach (string file in myFiles) { var currentChildDir = folder + "\\" + Path.GetDirectoryName(file.Replace(path, "")); - if (!Directory.Exists(currentChildDir)) - Directory.CreateDirectory(currentChildDir); + string filename = Path.GetFileName(file); + string dest = currentChildDir + "\\_" + filename + "_\\"; + string dir = Path.GetDirectoryName(dest); + if (!Directory.Exists(dir)) + Directory.CreateDirectory(dir); - string dest = currentChildDir + "\\"; try { PKF pkf = new PKF(file); - dest+= "\\_" + Path.GetFileName(file) + "_\\"; - Directory.CreateDirectory(dest); - if (bVerbose) Console.WriteLine("Unpacking {0} to {1}", file, dest); @@ -236,10 +237,11 @@ static void ExtractPKS(string path, string folder) foreach (string file in myFiles) { var currentChildDir = folder + "\\" + Path.GetDirectoryName(file.Replace(path, "")); - if (!Directory.Exists(currentChildDir)) - Directory.CreateDirectory(currentChildDir); - - string dest = currentChildDir + "\\"; + string filename = Path.GetFileName(file); + string dest = currentChildDir + "\\_" + filename + "_\\"; + string dir = Path.GetDirectoryName(dest); + if (!Directory.Exists(dir)) + Directory.CreateDirectory(dir); try { @@ -296,10 +298,11 @@ static void ExtractSPR(string path, string folder) foreach (string file in myFiles) { var currentChildDir = folder + "\\" + Path.GetDirectoryName(file.Replace(path, "")); - if (!Directory.Exists(currentChildDir)) - Directory.CreateDirectory(currentChildDir); - - string dest = currentChildDir + "\\"; + string filename = Path.GetFileName(file); + string dest = currentChildDir + "\\_" + filename + "_\\"; + string dir = Path.GetDirectoryName(dest); + if (!Directory.Exists(dir)) + Directory.CreateDirectory(dir); try { @@ -358,10 +361,11 @@ static void ExtractIPAC(string path, string folder) foreach (string file in myFiles) { var currentChildDir = folder + "\\" + Path.GetDirectoryName(file.Replace(path, "")); - if (!Directory.Exists(currentChildDir)) - Directory.CreateDirectory(currentChildDir); - - string dest = currentChildDir + "\\"; + string filename = Path.GetFileName(file); + string dest = currentChildDir + "\\_" + filename + "_\\"; + string dir = Path.GetDirectoryName(dest); + if (!Directory.Exists(dir)) + Directory.CreateDirectory(dir); try { @@ -419,10 +423,11 @@ static void ExtractGZ(string path, string folder) foreach (string file in myFiles) { var currentChildDir = folder + "\\" + Path.GetDirectoryName(file.Replace(path, "")); - if (!Directory.Exists(currentChildDir)) - Directory.CreateDirectory(currentChildDir); - - string dest = currentChildDir + "\\"; + string filename = Path.GetFileName(file); + string dest = currentChildDir + "\\_" + filename + "_\\"; + string dir = Path.GetDirectoryName(dest); + if (!Directory.Exists(dir)) + Directory.CreateDirectory(dir); try { @@ -482,10 +487,11 @@ static void ExtractAFS(string path, string folder) foreach (string file in myFiles) { var currentChildDir = folder + "\\" + Path.GetDirectoryName(file.Replace(path, "")); - if (!Directory.Exists(currentChildDir)) - Directory.CreateDirectory(currentChildDir); - - string dest = currentChildDir + "\\"; + string filename = Path.GetFileName(file); + string dest = currentChildDir + "\\_" + filename + "_\\"; + string dir = Path.GetDirectoryName(dest); + if (!Directory.Exists(dir)) + Directory.CreateDirectory(dir); try {