1
0
mirror of synced 2024-11-12 02:00:50 +01:00

Change FTEX R8G8B8 compression method to new one. .

This commit is contained in:
KillzXGaming 2018-11-19 13:14:35 -05:00
parent d302808d24
commit 029f350526
2 changed files with 8 additions and 3 deletions

Binary file not shown.

View File

@ -201,7 +201,7 @@ namespace FirstPlugin
internal void SaveBinaryTexture(string FileName)
{
Console.WriteLine("Test");
// Texture.Export(FileName, bntxFile);
// Texture.Export(FileName, bntxFile);
}
internal void SaveDDS(string FileName)
{
@ -470,9 +470,14 @@ namespace FirstPlugin
case ((int)GTX.GX2SurfaceFormat.GX2_SURFACE_FORMAT_T_BC5_SNORM):
decomp = DDSCompressor.DecompressBC5(data, (int)Width, (int)Height, true); break;
case ((int)GTX.GX2SurfaceFormat.GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_SNORM):
decomp = DDS_PixelDecode.DecodeR8G8B8A8(data, (int)Width, (int)Height); break;
byte[] dec = DDSCompressor.DecodePixelBlock(data, (int)Width, (int)Height, DDS.DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM_SRGB);
decomp = BitmapExtension.GetBitmap(dec, (int)Width, (int)Height);
decomp = TextureData.SwapBlueRedChannels(decomp);
break;
case ((int)GTX.GX2SurfaceFormat.GX2_SURFACE_FORMAT_TC_R8_G8_B8_A8_UINT):
decomp = DDS_PixelDecode.DecodeR8G8B8A8(data, (int)Width, (int)Height); break;
decomp = BitmapExtension.GetBitmap(data, (int)Width, (int)Height);
decomp = TextureData.SwapBlueRedChannels(decomp);
break;
default:
decomp = Properties.Resources.TextureError;
Console.WriteLine($"Format {Format} not supported!");