From fc89814115eeedbc9bf42df7964d01d504d3e1aa Mon Sep 17 00:00:00 2001 From: Yukai Li Date: Wed, 17 Mar 2021 14:33:09 -0600 Subject: [PATCH] Add option for directly converting TXM when converting PDB --- DgfTxmConvert/Program.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/DgfTxmConvert/Program.cs b/DgfTxmConvert/Program.cs index 880a93f..e537e9e 100644 --- a/DgfTxmConvert/Program.cs +++ b/DgfTxmConvert/Program.cs @@ -160,11 +160,12 @@ namespace DgfTxmConvert txmPathArg.Accepts().ExistingFile(); var outBaseArg = config.Argument("outBase", "Directory to write converted files"); outBaseArg.Accepts().LegalFilePath(); + var forceTexDirectOption = config.Option("--forceTexDirect", "Convert TXM as is without trying PS2 texture unpack", CommandOptionType.NoValue); config.HelpOption(); config.OnExecute(() => { - ExtractPdb(pdbPathArg.Value, txmPathArg.Value, outBaseArg.Value); + ExtractPdb(pdbPathArg.Value, txmPathArg.Value, outBaseArg.Value, forceTexDirectOption.HasValue()); }); }); @@ -609,7 +610,7 @@ namespace DgfTxmConvert } } - static void ExtractPdb(string pdbPath, string txmPath, string basePath = null) + static void ExtractPdb(string pdbPath, string txmPath, string basePath = null, bool forceDirect = false) { if (basePath == null) basePath = Path.ChangeExtension(pdbPath, null); @@ -636,7 +637,7 @@ namespace DgfTxmConvert using (StreamWriter sw = File.CreateText(mtlPath)) { - converter.ExportTextures(sw, basePath + "."); + converter.ExportTextures(sw, basePath + ".", forceDirect); } }