From 90316dfa52995453a67c4830a48e84a69dcb94c2 Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Mon, 13 Jan 2025 15:46:35 +0100 Subject: [PATCH] Minor code changes to PR --- .../TextureTool/TextureTool.DirectXTex.cpp | 20 +++++-------------- .../Tools/TextureTool/TextureTool.stb.cpp | 4 ++-- 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/Source/Engine/Tools/TextureTool/TextureTool.DirectXTex.cpp b/Source/Engine/Tools/TextureTool/TextureTool.DirectXTex.cpp index 683bcc292..37b914e9c 100644 --- a/Source/Engine/Tools/TextureTool/TextureTool.DirectXTex.cpp +++ b/Source/Engine/Tools/TextureTool/TextureTool.DirectXTex.cpp @@ -827,10 +827,8 @@ bool TextureTool::ImportTextureDirectXTex(ImageType type, const StringView& path result = TransformImage(currentImage->GetImages(), currentImage->GetImageCount(), currentImage->GetMetadata(), [&](DirectX::XMVECTOR* outPixels, const DirectX::XMVECTOR* inPixels, size_t w, size_t y) { - static const DirectX::XMVECTORU32 s_selecty = { { { DirectX::XM_SELECT_0, DirectX::XM_SELECT_1, DirectX::XM_SELECT_0, DirectX::XM_SELECT_0 } } }; - + const DirectX::XMVECTORU32 s_selecty = { { { DirectX::XM_SELECT_0, DirectX::XM_SELECT_1, DirectX::XM_SELECT_0, DirectX::XM_SELECT_0 } } }; UNREFERENCED_PARAMETER(y); - for (size_t j = 0; j < w; ++j) { const DirectX::XMVECTOR value = inPixels[j]; @@ -853,10 +851,8 @@ bool TextureTool::ImportTextureDirectXTex(ImageType type, const StringView& path result = TransformImage(currentImage->GetImages(), currentImage->GetImageCount(), currentImage->GetMetadata(), [&](DirectX::XMVECTOR* outPixels, const DirectX::XMVECTOR* inPixels, size_t w, size_t y) { - static const DirectX::XMVECTORU32 s_selectx = { { { DirectX::XM_SELECT_1, DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_0 } } }; - + const DirectX::XMVECTORU32 s_selectx = { { { DirectX::XM_SELECT_1, DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_0 } } }; UNREFERENCED_PARAMETER(y); - for (size_t j = 0; j < w; ++j) { const DirectX::XMVECTOR value = inPixels[j]; @@ -879,10 +875,8 @@ bool TextureTool::ImportTextureDirectXTex(ImageType type, const StringView& path result = TransformImage(currentImage->GetImages(), currentImage->GetImageCount(), currentImage->GetMetadata(), [&](DirectX::XMVECTOR* outPixels, const DirectX::XMVECTOR* inPixels, size_t w, size_t y) { - static const DirectX::XMVECTORU32 s_selectz = { { { DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_1, DirectX::XM_SELECT_0 } } }; - + const DirectX::XMVECTORU32 s_selectz = { { { DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_1, DirectX::XM_SELECT_0 } } }; UNREFERENCED_PARAMETER(y); - for (size_t j = 0; j < w; ++j) { const DirectX::XMVECTOR value = inPixels[j]; @@ -905,10 +899,8 @@ bool TextureTool::ImportTextureDirectXTex(ImageType type, const StringView& path result = TransformImage(currentImage->GetImages(), currentImage->GetImageCount(), currentImage->GetMetadata(), [&](DirectX::XMVECTOR* outPixels, const DirectX::XMVECTOR* inPixels, size_t w, size_t y) { - static const DirectX::XMVECTORU32 s_selectw = { { { DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_1 } } }; - + const DirectX::XMVECTORU32 s_selectw = { { { DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_1 } } }; UNREFERENCED_PARAMETER(y); - for (size_t j = 0; j < w; ++j) { const DirectX::XMVECTOR value = inPixels[j]; @@ -932,10 +924,8 @@ bool TextureTool::ImportTextureDirectXTex(ImageType type, const StringView& path result = TransformImage(currentImage->GetImages(), currentImage->GetImageCount(), currentImage->GetMetadata(), [&](DirectX::XMVECTOR* outPixels, const DirectX::XMVECTOR* inPixels, size_t w, size_t y) { - static const DirectX::XMVECTORU32 s_selectz = { { { DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_1, DirectX::XM_SELECT_0 } } }; - + const DirectX::XMVECTORU32 s_selectz = { { { DirectX::XM_SELECT_0, DirectX::XM_SELECT_0, DirectX::XM_SELECT_1, DirectX::XM_SELECT_0 } } }; UNREFERENCED_PARAMETER(y); - for (size_t j = 0; j < w; ++j) { const DirectX::XMVECTOR value = inPixels[j]; diff --git a/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp b/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp index 8ca585c32..0bb2deec2 100644 --- a/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp +++ b/Source/Engine/Tools/TextureTool/TextureTool.stb.cpp @@ -541,10 +541,10 @@ bool TextureTool::ImportTextureStb(ImageType type, const StringView& path, Textu // TODO: impl this LOG(Warning, "Option 'Flip X' is not supported"); } - if (options.InvertGreenChannel) + if (options.InvertRedChannel || options.InvertGreenChannel || options.InvertBlueChannel || options.InvertAlphaChannel) { // TODO: impl this - LOG(Warning, "Option 'Invert Green Channel' is not supported"); + LOG(Warning, "Option to invert channels is not supported"); } if (options.ReconstructZChannel) {