diff --git a/Texassemble/texassemble.cpp b/Texassemble/texassemble.cpp index 68edbc4..34aff99 100644 --- a/Texassemble/texassemble.cpp +++ b/Texassemble/texassemble.cpp @@ -78,6 +78,7 @@ enum OPTIONS OPT_SRGBO, OPT_SRGB, OPT_OUTPUTFILE, + OPT_TOLOWER, OPT_OVERWRITE, OPT_USE_DX10, OPT_NOLOGO, @@ -136,6 +137,7 @@ const SValue g_pOptions[] = { L"srgbo", OPT_SRGBO }, { L"srgb", OPT_SRGB }, { L"o", OPT_OUTPUTFILE }, + { L"l", OPT_TOLOWER }, { L"y", OPT_OVERWRITE }, { L"dx10", OPT_USE_DX10 }, { L"nologo", OPT_NOLOGO }, @@ -519,6 +521,7 @@ namespace wprintf(L" -if image filtering\n"); wprintf(L" -srgb{i|o} sRGB {input, output}\n"); wprintf(L" -o output filename\n"); + wprintf(L" -l force output filename to lower case\n"); wprintf(L" -y overwrite existing output file (if any)\n"); wprintf(L" -sepalpha resize alpha channel separately from color channels\n"); wprintf(L" -nowic Force non-WIC filtering\n"); @@ -1885,6 +1888,11 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) wprintf(L"\n"); fflush(stdout); + if (dwOptions & (1 << OPT_TOLOWER)) + { + (void)_wcslwr_s(szOutputFile); + } + if (~dwOptions & (1 << OPT_OVERWRITE)) { if (GetFileAttributesW(szOutputFile) != INVALID_FILE_ATTRIBUTES) @@ -1967,6 +1975,11 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) wprintf(L"\n"); fflush(stdout); + if (dwOptions & (1 << OPT_TOLOWER)) + { + (void)_wcslwr_s(szOutputFile); + } + if (~dwOptions & (1 << OPT_OVERWRITE)) { if (GetFileAttributesW(szOutputFile) != INVALID_FILE_ATTRIBUTES) @@ -2033,6 +2046,11 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) wprintf(L"\n"); fflush(stdout); + if (dwOptions & (1 << OPT_TOLOWER)) + { + (void)_wcslwr_s(szOutputFile); + } + if (~dwOptions & (1 << OPT_OVERWRITE)) { if (GetFileAttributesW(szOutputFile) != INVALID_FILE_ATTRIBUTES) @@ -2100,6 +2118,11 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) wprintf(L"\n"); fflush(stdout); + if (dwOptions & (1 << OPT_TOLOWER)) + { + (void)_wcslwr_s(szOutputFile); + } + if (~dwOptions & (1 << OPT_OVERWRITE)) { if (GetFileAttributesW(szOutputFile) != INVALID_FILE_ATTRIBUTES) diff --git a/Texconv/texconv.cpp b/Texconv/texconv.cpp index 6fdcc9b..aecdc11 100644 --- a/Texconv/texconv.cpp +++ b/Texconv/texconv.cpp @@ -68,6 +68,7 @@ enum OPTIONS OPT_PREFIX, OPT_SUFFIX, OPT_OUTPUTDIR, + OPT_TOLOWER, OPT_OVERWRITE, OPT_FILETYPE, OPT_HFLIP, @@ -157,6 +158,7 @@ const SValue g_pOptions[] = { L"px", OPT_PREFIX }, { L"sx", OPT_SUFFIX }, { L"o", OPT_OUTPUTDIR }, + { L"l", OPT_TOLOWER }, { L"y", OPT_OVERWRITE }, { L"ft", OPT_FILETYPE }, { L"hflip", OPT_HFLIP }, @@ -720,6 +722,7 @@ namespace wprintf(L"\n -px name prefix\n"); wprintf(L" -sx name suffix\n"); wprintf(L" -o output directory\n"); + wprintf(L" -l force output filename to lower case\n"); wprintf(L" -y overwrite existing output file (if any)\n"); wprintf(L" -ft output file type\n"); wprintf(L"\n -hflip horizonal flip of source image\n"); @@ -3066,6 +3069,11 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) wcscat_s(pConv->szDest, MAX_PATH, szSuffix); + if (dwOptions & (DWORD64(1) << OPT_TOLOWER)) + { + (void)_wcslwr_s(pConv->szDest); + } + // Write texture wprintf(L"writing %ls", pConv->szDest); fflush(stdout); diff --git a/Texdiag/texdiag.cpp b/Texdiag/texdiag.cpp index 459d273..c2cee71 100644 --- a/Texdiag/texdiag.cpp +++ b/Texdiag/texdiag.cpp @@ -64,6 +64,7 @@ enum OPTIONS OPT_DDS_DWORD_ALIGN, OPT_DDS_BAD_DXTN_TAILS, OPT_OUTPUTFILE, + OPT_TOLOWER, OPT_OVERWRITE, OPT_FILETYPE, OPT_NOLOGO, @@ -113,6 +114,7 @@ const SValue g_pOptions[] = { L"badtails", OPT_DDS_BAD_DXTN_TAILS }, { L"nologo", OPT_NOLOGO }, { L"o", OPT_OUTPUTFILE }, + { L"l", OPT_TOLOWER }, { L"y", OPT_OVERWRITE }, { L"ft", OPT_FILETYPE }, { L"tu", OPT_TYPELESS_UNORM }, @@ -549,6 +551,7 @@ namespace wprintf(L"\n (diff only)\n"); wprintf(L" -f format\n"); wprintf(L" -o output filename\n"); + wprintf(L" -l force output filename to lower case\n"); wprintf(L" -y overwrite existing output file (if any)\n"); wprintf(L"\n (dumpbc only)\n"); wprintf(L" -targetx dump pixels at location x (defaults to all)\n"); @@ -3368,6 +3371,11 @@ int __cdecl wmain(_In_ int argc, _In_z_count_(argc) wchar_t* argv[]) return 1; } + if (dwOptions & (1 << OPT_TOLOWER)) + { + (void)_wcslwr_s(szOutputFile); + } + if (~dwOptions & (1 << OPT_OVERWRITE)) { if (GetFileAttributesW(szOutputFile) != INVALID_FILE_ATTRIBUTES)