1
0
mirror of synced 2025-01-19 01:14:08 +01:00

Load components by default now

This commit is contained in:
KillzXGaming 2019-05-04 17:38:51 -04:00
parent 7cdd454466
commit 8962f34e50
11 changed files with 43 additions and 9 deletions

Binary file not shown.

View File

@ -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
//

View File

@ -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)

View File

@ -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