1
0
mirror of synced 2024-12-01 02:27:22 +01:00

Fix importing textures with BC4 alpha

This commit is contained in:
KillzXGaming 2020-05-04 20:39:28 -04:00
parent 6aa22316e2
commit 62a822f3ab
2 changed files with 7 additions and 2 deletions

View File

@ -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}");

View File

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