Minor fixes to #3637

This commit is contained in:
2026-03-10 14:43:57 +01:00
parent 3b1960b977
commit a4cb839c6f
3 changed files with 4 additions and 20 deletions
@@ -56,6 +56,7 @@ public class TextureTool : EngineModule
if (options.Target.IsEditor) if (options.Target.IsEditor)
{ {
// Use helper lib for decompression // Use helper lib for decompression
options.PrivateDependencies.Add("ddspp");
options.PrivateDependencies.Add("detex"); options.PrivateDependencies.Add("detex");
options.PrivateDependencies.Add("bc7enc16"); options.PrivateDependencies.Add("bc7enc16");
} }
@@ -520,26 +520,11 @@ bool TextureTool::ImportTextureStb(ImageType type, const StringView& path, Textu
textureData.Format = PixelFormat::R8G8B8A8_UNorm_sRGB; textureData.Format = PixelFormat::R8G8B8A8_UNorm_sRGB;
break; break;
default: default:
LOG(Warning, "Unsupported DDS format."); LOG(Warning, "Unsupported DDS format {}.", (int32)desc.format);
return true; return true;
} }
if (desc.arraySize != 1) int32 slicesPerItem = desc.type == ddspp::Cubemap ? 6 : (desc.type == ddspp::Texture3D ? desc.depth : 1);
{ textureData.Items.Resize(slicesPerItem * desc.arraySize);
// 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
}
for (int32 itemIndex = 0; itemIndex < textureData.Items.Count(); itemIndex++) for (int32 itemIndex = 0; itemIndex < textureData.Items.Count(); itemIndex++)
{ {
-2
View File
@@ -1,5 +1,3 @@
using System.Collections.Generic;
using System.IO;
using Flax.Build; using Flax.Build;
/// <summary> /// <summary>