From 7e2ab15d19d4a418f5df7f02329286c5f5d20c21 Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Fri, 11 Sep 2020 21:05:38 -0400 Subject: [PATCH] Add support for exporting RG8 dds files. --- Switch_Toolbox_Library/FileFormats/DDS.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Switch_Toolbox_Library/FileFormats/DDS.cs b/Switch_Toolbox_Library/FileFormats/DDS.cs index 17845dba..1b1b65e3 100644 --- a/Switch_Toolbox_Library/FileFormats/DDS.cs +++ b/Switch_Toolbox_Library/FileFormats/DDS.cs @@ -1220,6 +1220,16 @@ namespace Toolbox.Library pixelInternalFormat = PixelInternalFormat.SrgbAlpha; pixelFormat = OpenTK.Graphics.OpenGL.PixelFormat.Rgba; break; + case DXGI_FORMAT.DXGI_FORMAT_R8G8_UNORM: + header.ddspf.flags = (uint)(DDPF.RGB | DDPF.ALPHAPIXELS); + header.ddspf.RGBBitCount = 24; + header.ddspf.RBitMask = (uint)R8G8B8_MASKS[0]; + header.ddspf.GBitMask = (uint)R8G8B8_MASKS[1]; + header.ddspf.BBitMask = (uint)R8G8B8_MASKS[2]; + header.ddspf.ABitMask = (uint)R8G8B8_MASKS[3]; + pixelInternalFormat = PixelInternalFormat.SrgbAlpha; + pixelFormat = OpenTK.Graphics.OpenGL.PixelFormat.Rgba; + break; case DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM_SRGB: case DXGI_FORMAT.DXGI_FORMAT_BC1_UNORM: header.ddspf.flags = (uint)DDPF.FOURCC;