Fix importing textures with BC4 alpha
This commit is contained in:
parent
6aa22316e2
commit
62a822f3ab
@ -140,6 +140,9 @@ namespace FirstPlugin
|
||||
Bitmap Image = BitmapExtension.GetBitmap(DecompressedData[SurfaceLevel], (int)TexWidth, (int)TexHeight);
|
||||
if (FlipY)
|
||||
Image.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
if (UseBc4Alpha && (Format == GX2.GX2SurfaceFormat.T_BC4_UNORM || Format == GX2.GX2SurfaceFormat.T_BC4_SNORM)) {
|
||||
Image = BitmapExtension.SetChannel(Image, STChannelType.Alpha, STChannelType.Alpha, STChannelType.Alpha, STChannelType.One);
|
||||
}
|
||||
|
||||
Console.WriteLine($"FlipY {FlipY}");
|
||||
|
||||
|
@ -210,9 +210,11 @@ namespace FirstPlugin
|
||||
|
||||
if (setting.FlipY)
|
||||
bitmap.RotateFlip(RotateFlipType.RotateNoneFlipY);
|
||||
if (setting.UseBc4Alpha) {
|
||||
if (setting.UseBc4Alpha && (setting.Format == GX2.GX2SurfaceFormat.T_BC4_UNORM ||
|
||||
setting.Format == GX2.GX2SurfaceFormat.T_BC4_UNORM))
|
||||
{
|
||||
bitmap = BitmapExtension.SetChannel(bitmap,
|
||||
STChannelType.Red, STChannelType.Red, STChannelType.Red, STChannelType.Red);
|
||||
STChannelType.One, STChannelType.One, STChannelType.One, STChannelType.Red);
|
||||
}
|
||||
|
||||
if (pictureBox1.InvokeRequired)
|
||||
|
Loading…
Reference in New Issue
Block a user