diff --git a/.vs/Switch_Toolbox/v15/.suo b/.vs/Switch_Toolbox/v15/.suo index 47c4e90d..7703d95b 100644 Binary files a/.vs/Switch_Toolbox/v15/.suo and b/.vs/Switch_Toolbox/v15/.suo differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide index ae8dc469..be56e3f4 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide differ diff --git a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal index 64740a4d..ffbd8fde 100644 Binary files a/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal and b/.vs/Switch_Toolbox/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Switch_FileFormatsMain/GUI/BFRES/Materials/ShaderParams/ShaderParamEditor.Designer.cs b/Switch_FileFormatsMain/GUI/BFRES/Materials/ShaderParams/ShaderParamEditor.Designer.cs index 6ebccf94..6c3974bb 100644 --- a/Switch_FileFormatsMain/GUI/BFRES/Materials/ShaderParams/ShaderParamEditor.Designer.cs +++ b/Switch_FileFormatsMain/GUI/BFRES/Materials/ShaderParams/ShaderParamEditor.Designer.cs @@ -119,7 +119,7 @@ this.columnHeader11, this.columnHeader1, this.columnHeader2}); - this.shaderParamListView.Location = new System.Drawing.Point(3, 35); + this.shaderParamListView.Location = new System.Drawing.Point(3, 32); this.shaderParamListView.MultiSelect = false; this.shaderParamListView.Name = "shaderParamListView"; this.shaderParamListView.OwnerDraw = true; @@ -149,7 +149,7 @@ // columnHeader2 // this.columnHeader2.Text = ""; - this.columnHeader2.Width = 12; + this.columnHeader2.Width = 25; // // ShaderParamEditor // diff --git a/Switch_FileFormatsMain/obj/Release/AxInterop.WMPLib.dll b/Switch_FileFormatsMain/obj/Release/AxInterop.WMPLib.dll index 31c7aecb..c50443b9 100644 Binary files a/Switch_FileFormatsMain/obj/Release/AxInterop.WMPLib.dll and b/Switch_FileFormatsMain/obj/Release/AxInterop.WMPLib.dll differ diff --git a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache index 7c7e57ef..1a24e1fb 100644 Binary files a/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache and b/Switch_FileFormatsMain/obj/Release/DesignTimeResolveAssemblyReferences.cache differ diff --git a/Switch_FileFormatsMain/obj/Release/Interop.WMPLib.dll b/Switch_FileFormatsMain/obj/Release/Interop.WMPLib.dll index 3fcd213a..8f4b079c 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Interop.WMPLib.dll and b/Switch_FileFormatsMain/obj/Release/Interop.WMPLib.dll differ diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csproj.GenerateResource.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csproj.GenerateResource.cache index 46de86e6..4ef01b69 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csproj.GenerateResource.cache and b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csproj.GenerateResource.cache differ diff --git a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache index eb79d33a..1eae6aa0 100644 Binary files a/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache and b/Switch_FileFormatsMain/obj/Release/Switch_FileFormatsMain.csprojAssemblyReference.cache differ diff --git a/Switch_Toolbox_Library/Forms/Editors/ImageEditor/ImageEditorBase.cs b/Switch_Toolbox_Library/Forms/Editors/ImageEditor/ImageEditorBase.cs index 2496497a..a9dfa748 100644 --- a/Switch_Toolbox_Library/Forms/Editors/ImageEditor/ImageEditorBase.cs +++ b/Switch_Toolbox_Library/Forms/Editors/ImageEditor/ImageEditorBase.cs @@ -361,17 +361,32 @@ namespace Switch_Toolbox.Library.Forms BitmapExtension.SetChannel(image, STChannelType.Alpha, STChannelType.Alpha, STChannelType.Alpha, STChannelType.One); else { - if (Runtime.ImageEditor.UseComponetSelector) + STChannelType AlphaDisplay = ActiveTexture.AlphaChannel; + if (!Runtime.ImageEditor.DisplayAlpha || HasZeroAlpha()) + AlphaDisplay = STChannelType.One; + + //For RGBA types try to only load the alpha toggle to load quicker + //Loading components would not be necessary as it is default to RGBA + if (UseRGBA()) { if (Runtime.ImageEditor.DisplayAlpha) - BitmapExtension.SetChannel(image, ActiveTexture.RedChannel, ActiveTexture.GreenChannel, ActiveTexture.BlueChannel, ActiveTexture.AlphaChannel); - else - BitmapExtension.SetChannel(image, ActiveTexture.RedChannel, ActiveTexture.GreenChannel, ActiveTexture.BlueChannel, STChannelType.One); + BitmapExtension.SetChannel(image, STChannelType.Red, STChannelType.Green, STChannelType.Blue, AlphaDisplay); } else { - if (!Runtime.ImageEditor.DisplayAlpha) - BitmapExtension.SetChannel(image, STChannelType.Red, STChannelType.Green, STChannelType.Blue, STChannelType.One); + //Check components for the channels + if (Runtime.ImageEditor.UseComponetSelector) + { + BitmapExtension.SetChannel(image, ActiveTexture.RedChannel, ActiveTexture.GreenChannel, ActiveTexture.BlueChannel, AlphaDisplay); + } + else + { + if (UseRGBA()) + { + if (Runtime.ImageEditor.DisplayAlpha) + BitmapExtension.SetChannel(image, STChannelType.Red, STChannelType.Green, STChannelType.Blue, AlphaDisplay); + } + } } } @@ -383,6 +398,25 @@ namespace Switch_Toolbox.Library.Forms } + private bool HasZeroAlpha() + { + if (ActiveTexture.AlphaChannel == STChannelType.Zero) + return true; + else + return false; + } + + private bool UseRGBA() + { + if (ActiveTexture.RedChannel == STChannelType.Red && + ActiveTexture.GreenChannel == STChannelType.Green && + ActiveTexture.BlueChannel == STChannelType.Blue && + ActiveTexture.AlphaChannel == STChannelType.Alpha) + return true; + else + return false; + } + private void PushImage(Image image) { if (pictureBoxCustom1.InvokeRequired) diff --git a/Switch_Toolbox_Library/Runtime.cs b/Switch_Toolbox_Library/Runtime.cs index 8df41e59..8d9ad71f 100644 --- a/Switch_Toolbox_Library/Runtime.cs +++ b/Switch_Toolbox_Library/Runtime.cs @@ -27,7 +27,7 @@ namespace Switch_Toolbox.Library public static bool DisplayVertical = false; public static bool DisplayAlpha = true; - public static bool UseComponetSelector = false; + public static bool UseComponetSelector = true; } public class ObjectEditor