From e4654f8dff3d4ef4235d0f19e5d86b7ee843920d Mon Sep 17 00:00:00 2001 From: KillzXGaming Date: Sun, 20 Oct 2019 20:37:37 -0400 Subject: [PATCH] Add support for exporting gamma correction if enabled --- File_Format_Library/FileFormats/Layout/CAFE/BFLYT.cs | 10 +++++----- .../Generics/Texture/GenericTexture.cs | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/File_Format_Library/FileFormats/Layout/CAFE/BFLYT.cs b/File_Format_Library/FileFormats/Layout/CAFE/BFLYT.cs index 6982dec5..51523644 100644 --- a/File_Format_Library/FileFormats/Layout/CAFE/BFLYT.cs +++ b/File_Format_Library/FileFormats/Layout/CAFE/BFLYT.cs @@ -1633,12 +1633,12 @@ namespace LayoutBXLYT.Cafe ExternalLayout.header.TextureManager = layoutFile.TextureManager; - /* var textureList = ExternalLayout.GetTextures(); - foreach (var tex in textureList) - if (!textures.ContainsKey(tex.Key)) - textures.Add(tex.Key, tex.Value); + var textureList = ExternalLayout.GetTextures(); + foreach (var tex in textureList) + if (!textures.ContainsKey(tex.Key)) + textures.Add(tex.Key, tex.Value); - textureList.Clear();*/ + textureList.Clear(); } } diff --git a/Switch_Toolbox_Library/Generics/Texture/GenericTexture.cs b/Switch_Toolbox_Library/Generics/Texture/GenericTexture.cs index 1109ee5c..6d267497 100644 --- a/Switch_Toolbox_Library/Generics/Texture/GenericTexture.cs +++ b/Switch_Toolbox_Library/Generics/Texture/GenericTexture.cs @@ -939,9 +939,9 @@ namespace Toolbox.Library Bitmap bitMap = GetBitmap(SurfaceLevel, MipLevel); if (Runtime.ImageEditor.UseComponetSelector) - { - BitmapExtension.SetChannel(bitMap, RedChannel, GreenChannel, BlueChannel, AlphaChannel); - } + bitMap = BitmapExtension.SetChannel(bitMap, RedChannel, GreenChannel, BlueChannel, AlphaChannel); + if (Runtime.ImageEditor.PreviewGammaFix) + bitMap = BitmapExtension.AdjustGamma(bitMap, 1.0f / 2.2f); if (Parameters.FlipY) bitMap.RotateFlip(RotateFlipType.RotateNoneFlipY);