From 9b7e5be50e7b0d1c915ad795dbf403b132fcf735 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sat, 5 Oct 2024 23:22:06 +0200 Subject: [PATCH] Add new features to `stb` too (as unsupported) #2968 --- .../Tools/TextureTool/TextureTool.stb.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp b/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp index 1301327ef..15058752d 100644 --- a/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp +++ b/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp @@ -458,7 +458,7 @@ bool TextureTool::ImportTextureStb(ImageType type, const StringView& path, Textu { if (!options.InternalLoad.IsBinded() || options.InternalLoad(textureData)) return true; - if (options.FlipY) + if (options.FlipY || options.FlipX) { // TODO: impl this errorMsg = TEXT("Flipping images imported from Internal source is not supported by stb."); @@ -489,7 +489,7 @@ bool TextureTool::ImportTextureStb(ImageType type, const StringView& path, Textu if (sourceWidth != width || sourceHeight != height) { // During resizing we need to keep texture aspect ratio - const bool keepAspectRatio = false; // TODO: expose as import option + const bool keepAspectRatio = options.KeepAspectRatio; // TODO: expose as import option if (keepAspectRatio) { const float aspectRatio = static_cast(sourceWidth) / sourceHeight; @@ -536,6 +536,22 @@ bool TextureTool::ImportTextureStb(ImageType type, const StringView& path, Textu return true; } + if (options.FlipX) + { + // TODO: impl this + LOG(Warning "Option 'Flip X' is not supported"); + } + if (options.InvertGreenChannel) + { + // TODO: impl this + LOG(Warning "Option 'Invert Green Channel' is not supported"); + } + if (options.ReconstructZChannel) + { + // TODO: impl this + LOG(Warning "Option 'Reconstruct Z Channel' is not supported"); + } + // Generate mip maps chain if (useMipLevels && options.GenerateMipMaps) {