Add support for latest Tuanjie versions (up to v1.9)

still partial
This commit is contained in:
VaDiM
2026-05-27 02:50:58 +03:00
parent 22e4b0e8a1
commit 7adfdef62f
12 changed files with 392 additions and 181 deletions
+19
View File
@@ -322,6 +322,11 @@ namespace AssetStudio
case TextureFormat.RGBA64: //test pass
flag = DecodeRGBA64(buff, destSpan);
break;
case TextureFormat.PNG_8_RGBA:
case TextureFormat.PNG_24_RGB: //test pass
case TextureFormat.PNG_32_RGBA: //test pass
flag = DecodePng(buff, destSpan);
break;
}
}
finally
@@ -811,6 +816,20 @@ namespace AssetStudio
return true;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private bool DecodePng(ReadOnlySpan<byte> buff, Span<byte> destSpan)
{
try
{
Image.Load<Bgra32>(buff).CopyPixelDataTo(destSpan);
return true;
}
catch (Exception)
{
return false;
}
}
private bool TryUnpackCrunch(ReadOnlySpan<byte> buff, out ReadOnlySpan<byte> result)
{
if (m_Texture2D.version >= (2017, 3) //2017.3 and up