diff --git a/Source/Engine/Tools/TextureTool/TextureTool.Build.cs b/Source/Engine/Tools/TextureTool/TextureTool.Build.cs index c87a5b4ec..29c413821 100644 --- a/Source/Engine/Tools/TextureTool/TextureTool.Build.cs +++ b/Source/Engine/Tools/TextureTool/TextureTool.Build.cs @@ -56,6 +56,7 @@ public class TextureTool : EngineModule if (options.Target.IsEditor) { // Use helper lib for decompression + options.PrivateDependencies.Add("ddspp"); options.PrivateDependencies.Add("detex"); options.PrivateDependencies.Add("bc7enc16"); } diff --git a/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp b/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp index cafce9fc5..3d3e38d55 100644 --- a/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp +++ b/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp @@ -520,26 +520,11 @@ bool TextureTool::ImportTextureStb(ImageType type, const StringView& path, Textu textureData.Format = PixelFormat::R8G8B8A8_UNorm_sRGB; break; default: - LOG(Warning, "Unsupported DDS format."); + LOG(Warning, "Unsupported DDS format {}.", (int32)desc.format); return true; } - if (desc.arraySize != 1) - { - // TODO: Implement DDS support for 2D arrays or volume textures - MessageBox::Show(TEXT("Unsupported DDS file."), TEXT("Import warning"), MessageBoxButtons::OK, MessageBoxIcon::Warning); - LOG(Warning, "Unsupported DDS file. Contains {0} Array Slices.", desc.arraySize); - return true; - } - else - { - if (desc.type == ddspp::Cubemap) - { - LOG(Info, "Texture is Cubemap."); - textureData.Items.Resize(6); // 6 Cubemap faces - } - else - textureData.Items.Resize(1); // 2D Texture - } + int32 slicesPerItem = desc.type == ddspp::Cubemap ? 6 : (desc.type == ddspp::Texture3D ? desc.depth : 1); + textureData.Items.Resize(slicesPerItem * desc.arraySize); for (int32 itemIndex = 0; itemIndex < textureData.Items.Count(); itemIndex++) { diff --git a/Source/ThirdParty/ddspp/ddspp.Build.cs b/Source/ThirdParty/ddspp/ddspp.Build.cs index a2a1b8c36..9595877d2 100644 --- a/Source/ThirdParty/ddspp/ddspp.Build.cs +++ b/Source/ThirdParty/ddspp/ddspp.Build.cs @@ -1,5 +1,3 @@ -using System.Collections.Generic; -using System.IO; using Flax.Build; ///