mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-14 11:18:47 -05:00
Add support for latest Tuanjie versions (up to v1.9)
still partial
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user