diff --git a/CMakeLists.txt b/CMakeLists.txt index cb588bf..015ffd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -51,6 +51,15 @@ option(TEXCONV_USE_SINGLEPROC "Use -singleproc" OFF) option(TEXCONV_USE_TGA20 "Use -tga20 " OFF) option(TEXCONV_USE_TEXASSEMBLE "Use texassemble as a dll function" OFF) +if(NOT WIN32) + set(TEXCONV_USE_WIC OFF) + set(TEXCONV_USE_PPM OFF) + set(TEXCONV_USE_FLIP OFF) + set(TEXCONV_USE_MULTIPLE_FILES OFF) + set(TEXCONV_NO_GPU_CODEC OFF) + set(TEXCONV_USE_TIMING OFF) +endif() + # show variables function(texconv_show_variables) diff --git a/TexconvDLL/texassemble.cpp b/TexconvDLL/texassemble.cpp index 8af7548..2c996a7 100644 --- a/TexconvDLL/texassemble.cpp +++ b/TexconvDLL/texassemble.cpp @@ -852,7 +852,7 @@ namespace #endif L"\n" L" (cube, volume, array, cubearray, merge only)\n" - L" -stripmips Use only base image from input dds files\n" + L" -stripmips Use only base image from input dds files\n"; wprintf(L"%ls", s_usage); diff --git a/batch_files/build_texassemble.bat b/batch_files/build_texassemble.bat index 1cc0558..cc03f7d 100644 --- a/batch_files/build_texassemble.bat +++ b/batch_files/build_texassemble.bat @@ -16,6 +16,7 @@ cmake -G "%VS_VERSION%"^ -D CMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded^ -D TEXCONV_BUILD_AS_EXE=ON^ -D TEXCONV_USE_USAGE=ON^ + -D TEXCONV_USE_3D=ON^ -D TEXCONV_USE_TEXASSEMBLE=ON^ ../ diff --git a/docs/Build-on-Unix.md b/docs/Build-on-Unix.md index a9ac3dd..00d9fab 100644 --- a/docs/Build-on-Unix.md +++ b/docs/Build-on-Unix.md @@ -13,6 +13,7 @@ But it might not work on your environment. - Ubuntu 20.04 + GCC 9.4 - MacOS 10.15 + AppleClang 12.0 +- MacOS 11 + AppleClang 13.0 ## 0. Requirements @@ -39,8 +40,13 @@ You can build `libtexconv.so` (or `libtexconv.dylib`) with a shell script. Move to `Texconv-Custom-DLL/shell_scripts` and type `bash build.sh` on the terminal. `libtexconv.so` (or `libtexconv.dylib`) will be generated in `./Texconv-Custom-DLL/`. -## 4. Build executable +## 4. Build executable (optional) If you want an executable, use `build_as_exe.sh` instead of `build.sh`. `texconv` will be generated in `./Texconv-Custom-DLL/`. You can use it on the terminal. (e.g. `./texconv -ft tga -y -o outdir test.dds`) + +## 5. Build texassemble (optional) + +If you want to build texassemble as an executable, use `build_texassemble.sh` instead of `build.sh`. +If you want to use texassemble as a dll function, use `build_dds_full_support.sh` instead of `build.sh`. diff --git a/docs/Build-on-Windows.md b/docs/Build-on-Windows.md index f3eb217..bd9ed17 100644 --- a/docs/Build-on-Windows.md +++ b/docs/Build-on-Windows.md @@ -10,7 +10,7 @@ Move to `./Texconv-Custom-DLL` and type `git submodule update --init --recursive It'll download DirectXTex to the repository. (`git submodule update --init --recursive` will work as well, but it'll download unnecessary repositories for Windows.) -## 2-a. Build .dll with Batch Files +## 2-a. Build .dll with batch files You can build texconv.dll with batch files. Move to `./Texconv-Custom-DLL/batch_files` and type `build.bat` on the command prompt. @@ -22,8 +22,13 @@ Of course, you can build the dll with Visual Studio. Open `./Texconv-Custom-DLL` with Visual Studio and load CMakeLists.txt. Then, you can build texconv.dll. -## 3. Build executable +## 3. Build executable (optional) If you want an executable, use `build_as_exe.bat` instead of `build.bat`. `texconv.exe` will be generated in `./Texconv-Custom-DLL/`. You can use it on the command prompt. (e.g. `texconv.exe -ft tga -y -o outdir test.dds`) + +## 4. Build texassemble (optional) + +If you want to build texassemble as an executable, use `build_texassemble.bat` instead of `build.bat`. +If you want to use texassemble as a dll function, use `build_dds_full_support.bat` instead of `build.bat`. diff --git a/docs/CMake-Options.md b/docs/CMake-Options.md index 66e7e4d..5bf0ecf 100644 --- a/docs/CMake-Options.md +++ b/docs/CMake-Options.md @@ -7,45 +7,45 @@ If you enable all options, the dll will be almost the same size as the original ## exe options -- `TEXCONV_BUILD_AS_EXE`: Build Texconv as .exe -- `TEXCONV_USE_ICON_FOR_EXE`: Use `directx.ico` when TEXCONV_BUILD_AS_EXE is ON +- `TEXCONV_BUILD_AS_EXE`: Build Texconv as .exe. +- `TEXCONV_USE_ICON_FOR_EXE`: Use `directx.ico` when `TEXCONV_BUILD_AS_EXE` is ON. ## format options -- `TEXCONV_USE_WIC`: Enable to use WIC-supported format (bmp, jpg, png, jxr, etc.) -- `TEXCONV_USE_PPM`: Enable to use .ppm and .pfm +- `TEXCONV_USE_WIC`: Enable to use WIC-supported formats (bmp, jpg, png, etc.) (Only available for Windows) +- `TEXCONV_USE_PPM`: Enable to use ppm and pfm formats (Only available for Windows) - `TEXCONV_USE_PLANAR`: Enable to use planar dds formats - `TEXCONV_USE_3D`: Enable to use 3D textures - `TEXCONV_USE_LEGACY`: Enable to use legacy dds formats -- `TEXCONV_USE_16BPP`: Enable to use 16bpp format (B5G6R5, B5G5R5A1, B4G4R4A4) +- `TEXCONV_USE_16BPP`: Enable to use 16bpp formats (B5G6R5, B5G5R5A1, B4G4R4A4) ## Printing options -- `TEXCONV_USE_LOGO`: Enable to use PrintLogo() -- `TEXCONV_USE_USAGE`: Enable to use -help -- `TEXCONV_USE_PRINT_INFO`: Enable to use PrintInfo() and PrintFormat() -- `TEXCONV_USE_TIMING`: Enable to use -timing +- `TEXCONV_USE_LOGO`: Enable to use `PrintLogo()` +- `TEXCONV_USE_USAGE`: Enable to use `-help` (Only available for Windows) +- `TEXCONV_USE_PRINT_INFO`: Enable to use `PrintInfo()` and `PrintFormat()` +- `TEXCONV_USE_TIMING`: Enable to use `-timing` (Only available for Windows) ## Other options -- `TEXCONV_USE_FLIP`: Enable to use -hflip and -vflip -- `TEXCONV_USE_SWIZZLE`: Enable to use -swizzle -- `TEXCONV_USE_ROTATE_COLOR`: Enable to use -rotatecolor -- `TEXCONV_USE_COLORKEY`: Enable to use -c -- `TEXCONV_USE_ALPHA_CONFIG`: Enable to use -pmalpha, -alpha, -keepcoverage, -aw, and -at -- `TEXCONV_USE_ADDRESSING`: Enable to use -wrap and -mirror -- `TEXCONV_USE_TONEMAP`: Enable to use -tonemap -- `TEXCONV_USE_MULTIPLE_FILES`: Enable to use -r and -flist -- `TEXCONV_USE_NMAP_CONFIG`: Enable to use -nmap and -nmapamp -- `TEXCONV_USE_MINOR_DDS_CONFIG`: Enable to use -tu, -tf, -dword, -badtails, -fixbc4x4, -xlum, -dx10, and -dx9 -- `TEXCONV_USE_FEATURE_LEVEL`: Enable to use -fl -- `TEXCONV_USE_BC_CONFIG`: Enable to use -bc -- `TEXCONV_USE_SRGB`: Enable to use -srgb, -srgbi, and -srgbo -- `TEXCONV_USE_NAME_CONFIG`: Enable to use -px, -sx, and -l -- `TEXCONV_USE_DITHER`: Enable to use dither filters -- `TEXCONV_NO_GPU_CODEC`: Disable GPU codec for BC6 and BC7 -- `TEXCONV_USE_GPU_CONFIG`: Enable to use -gpu and -nogpu -- `TEXCONV_USE_X2BIAS`: Enable to use -x2bias -- `TEXCONV_USE_SINGLEPROC`: Enable to use -singleproc -- `TEXCONV_USE_TGA20`: Enable to use -tga20 +- `TEXCONV_USE_FLIP`: Enable to use `-hflip` and `-vflip` (Only available for Windows) +- `TEXCONV_USE_SWIZZLE`: Enable to use `-swizzle` +- `TEXCONV_USE_ROTATE_COLOR`: Enable to use `-rotatecolor` +- `TEXCONV_USE_COLORKEY`: Enable to use `-c` +- `TEXCONV_USE_ALPHA_CONFIG`: Enable to use `-pmalpha`, `-alpha`, `-keepcoverage`, `-aw`, and `-at` +- `TEXCONV_USE_ADDRESSING`: Enable to use `-wrap` and `-mirror` +- `TEXCONV_USE_TONEMAP`: Enable to use `-tonemap` +- `TEXCONV_USE_MULTIPLE_FILES`: Enable to use `-r` and `-flist` (Only available for Windows) +- `TEXCONV_USE_NMAP_CONFIG`: Enable to use -nmap and `-nmapamp` +- `TEXCONV_USE_MINOR_DDS_CONFIG`: Enable to use `-tu`, `-tf`, `-dword`, `-badtails`, `-fixbc4x4`, `-xlum`, `-dx10`, and `-dx9` +- `TEXCONV_USE_FEATURE_LEVEL`: Enable to use `-fl` +- `TEXCONV_USE_BC_CONFIG`: Enable to use `-bc` +- `TEXCONV_USE_SRGB`: Enable to use `-srgb`, `-srgbi`, and `-srgbo` +- `TEXCONV_USE_NAME_CONFIG`: Enable to use `-px`, `-sx`, and `-l` +- `TEXCONV_USE_DITHER`: Enable to use dither filters for `-if` option +- `TEXCONV_NO_GPU_CODEC`: Disable GPU codec for BC6 and BC7 (Only available for Windows) +- `TEXCONV_USE_GPU_CONFIG`: Enable to use `-gpu` and `-nogpu` +- `TEXCONV_USE_X2BIAS`: Enable to use `-x2bias` +- `TEXCONV_USE_SINGLEPROC`: Enable to use `-singleproc` +- `TEXCONV_USE_TGA20`: Enable to use `-tga20` - `TEXCONV_USE_TEXASSEMBLE`: Enable to use texassemble as a DLL function diff --git a/docs/README.md b/docs/README.md index ab99852..605771d 100644 --- a/docs/README.md +++ b/docs/README.md @@ -39,6 +39,7 @@ If you want to restore them, you need to use [cmake options](./CMake-Options.md) You can add some features by [cmake options](./CMake-Options.md). - Disable GPU codec (`TEXCONV_NO_GPU_CODEC`) - Enable to use [texassemble](https://github.com/microsoft/DirectXTex/wiki/Texassemble) as a DLL function (`TEXCONV_USE_TEXASSEMBLE`) +- Enable to build [texassemble](https://github.com/microsoft/DirectXTex/wiki/Texassemble) as an executable (`TEXCONV_USE_TEXASSEMBLE` and `TEXCONV_BUILD_AS_EXE`) ## Platform @@ -50,13 +51,14 @@ But the custom build supports the following platforms and compilers. - Ubuntu 20.04 (or later) + GCC ## Download + You can download the built binary from [the release page](https://github.com/matyalatte/Texconv-Custom-DLL/releases). - `TexconvCustomDLL*-Windows.zip` is for Windows. - `TexconvCustomDLL*-macOS.tar.bz2` is for Mac (10.15 or later). - `TexconvCustomDLL*-Linux.tar.bz2` is for Ubuntu (20.04 or later). -Each zip file has a DLL and a executable. +Each zip file has a DLL and an executable. You can copy whichever you want to use to your project. (The execuatble won't refer the DLL.) diff --git a/docs/Usage.md b/docs/Usage.md index b3d4185..4b670b4 100644 --- a/docs/Usage.md +++ b/docs/Usage.md @@ -54,6 +54,10 @@ And 1 means failed to convert. You can use [texassemble](https://github.com/microsoft/DirectXTex/wiki/Texassemble) if you built the dll with `TEXCONV_USE_TEXASSEMBLE` option. +> **Warning** +> This function is not included in the released builds. +> You need to build it by yourself if you want to use. + ```c++ int texassemble(int argc, wchar_t* argv[], bool verbose = true, bool init_com = false, diff --git a/shell_scripts/build_texassemble.sh b/shell_scripts/build_texassemble.sh index 03701b2..3c9273d 100644 --- a/shell_scripts/build_texassemble.sh +++ b/shell_scripts/build_texassemble.sh @@ -12,6 +12,7 @@ cmake \ -D CMAKE_POSITION_INDEPENDENT_CODE=ON\ -D TEXCONV_BUILD_AS_EXE=ON\ -D TEXCONV_USE_USAGE=ON\ + -D TEXCONV_USE_3D=ON\ -D TEXCONV_USE_TEXASSEMBLE=ON\ ../ cmake --build .