From 3d18d542a9fabe6a88c7f95fa4471ba1e5e41787 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Sat, 11 Jul 2020 13:17:46 -0400 Subject: [PATCH] Force bc7 to use unorm on .dds export so it doesn't darken in external programs. --- Switch_Toolbox_Library/FileFormats/DDS.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Switch_Toolbox_Library/FileFormats/DDS.cs b/Switch_Toolbox_Library/FileFormats/DDS.cs index 25dca300..17845dba 100644 --- a/Switch_Toolbox_Library/FileFormats/DDS.cs +++ b/Switch_Toolbox_Library/FileFormats/DDS.cs @@ -1261,7 +1261,6 @@ namespace Toolbox.Library case DXGI_FORMAT.DXGI_FORMAT_BC6H_UF16: case DXGI_FORMAT.DXGI_FORMAT_BC6H_SF16: case DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM: - case DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM_SRGB: header.ddspf.flags = (uint)DDPF.FOURCC; header.ddspf.fourCC = FOURCC_DX10; if (DX10header == null) @@ -1270,6 +1269,15 @@ namespace Toolbox.Library IsDX10 = true; DX10header.DXGI_Format = Format; break; + case DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM_SRGB: + header.ddspf.flags = (uint)DDPF.FOURCC; + header.ddspf.fourCC = FOURCC_DX10; + if (DX10header == null) + DX10header = new DX10Header(); + + IsDX10 = true; + DX10header.DXGI_Format = DDS.DXGI_FORMAT.DXGI_FORMAT_BC7_UNORM; + break; } } public bool IsCompressed()