mirror of
https://github.com/aelurum/AssetStudio.git
synced 2026-11-14 11:18:47 -05:00
Improve support for Tuanjie 1.10+
This commit is contained in:
@@ -62,5 +62,6 @@
|
||||
ArmLinuxServer,
|
||||
VisionOS,
|
||||
PlayableAds,
|
||||
Switch2,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -881,6 +881,11 @@ namespace AssetStudio
|
||||
m_KeepOriginalPositionY = reader.ReadBoolean();
|
||||
m_KeepOriginalPositionXZ = reader.ReadBoolean();
|
||||
m_HeightFromFeet = reader.ReadBoolean();
|
||||
if (version.IsTuanjie && version >= (2022, 3, 62, 13)) //2022.3.62t13(1.10.1) and up
|
||||
{
|
||||
var m_AdditiveType = reader.ReadInt32();
|
||||
var m_BasePoseType = reader.ReadInt32();
|
||||
}
|
||||
reader.AlignStream();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,12 +162,23 @@ namespace AssetStudio
|
||||
m_CanTransitionToSelf = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
if (version.IsTuanjie && version >= (2022, 3, 62, 8)) //2022.3.62t8(1.9.0) and up
|
||||
if (version.IsTuanjie && version.IsInRange((2022, 3, 62, 8), (2022, 3, 62, 12))) //2022.3.62t8-t11(1.9.x)))
|
||||
{
|
||||
var m_UseInertialization = reader.ReadBoolean();
|
||||
}
|
||||
|
||||
reader.AlignStream();
|
||||
|
||||
if (version.IsTuanjie && version >= (2022, 3, 62, 12)) //2022.3.62t12(1.10.0) and up
|
||||
{
|
||||
var m_TransitionBlendMode = reader.ReadInt32();
|
||||
var m_PoseBlendCurveMode = reader.ReadInt32();
|
||||
var m_RootMotionBlendCurveMode = reader.ReadInt32();
|
||||
var m_PoseBlendCurveKeyframeArraySize = reader.ReadInt32();
|
||||
reader.Position += m_PoseBlendCurveKeyframeArraySize * 28; //skip m_PoseBlendCurveKeyframeArray[]
|
||||
var m_RootMotionBlendCurveKeyframeArraySize = reader.ReadInt32();
|
||||
reader.Position += m_RootMotionBlendCurveKeyframeArraySize * 28; //skip m_RootMotionBlendCurveKeyframeArray[]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +83,10 @@ namespace AssetStudio
|
||||
{
|
||||
var m_ForceDisableGRD = reader.ReadByte();
|
||||
}
|
||||
if (version >= (2022, 3, 62, 12)) //2022.3.62t12(1.10.0) and up
|
||||
{
|
||||
var m_ForceDisableSmallMeshCull = reader.ReadByte();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (version >= (2023, 2)) //2023.2 and up
|
||||
|
||||
@@ -330,6 +330,14 @@
|
||||
/// PNG (8 bits) compressed RGBA texture format.
|
||||
/// </summary>
|
||||
PNG_8_RGBA = TUANJIE_OFFSET + 77,
|
||||
/// <summary>
|
||||
/// WebP (32 bits) compressed RGBA texture format.
|
||||
/// </summary>
|
||||
WebP_32 = TUANJIE_OFFSET + 78,
|
||||
/// <summary>
|
||||
/// WebP (24 bits) compressed RGB texture format.
|
||||
/// </summary>
|
||||
WebP_24 = TUANJIE_OFFSET + 79,
|
||||
}
|
||||
|
||||
public static class TextureFormatExtensions
|
||||
@@ -342,5 +350,7 @@
|
||||
}
|
||||
|
||||
public static bool IsPng(this TextureFormat format) => format >= TextureFormat.PNG_32_RGBA && format <= TextureFormat.PNG_8_RGBA;
|
||||
|
||||
public static bool IsWebP(this TextureFormat format) => format == TextureFormat.WebP_24 || format == TextureFormat.WebP_32;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,8 @@ namespace AssetStudioCLI
|
||||
debugLog += sb.ToString();
|
||||
}
|
||||
|
||||
if (type == ImageFormat.Png && m_Texture2D.m_TextureFormat.IsPng())
|
||||
if ((type == ImageFormat.Png && m_Texture2D.m_TextureFormat.IsPng())
|
||||
|| (type == ImageFormat.Webp && m_Texture2D.m_TextureFormat.IsWebP()))
|
||||
{
|
||||
File.WriteAllBytes(exportFullPath, m_Texture2D.image_data.GetData());
|
||||
debugLog += $"{item.TypeString} \"{item.Text}\" exported to \"{exportFullPath}\"";
|
||||
|
||||
@@ -46,7 +46,8 @@ namespace AssetStudioGUI
|
||||
debugLog += sb.ToString();
|
||||
}
|
||||
|
||||
if (type == ImageFormat.Png && m_Texture2D.m_TextureFormat.IsPng())
|
||||
if ((type == ImageFormat.Png && m_Texture2D.m_TextureFormat.IsPng())
|
||||
|| (type == ImageFormat.Webp && m_Texture2D.m_TextureFormat.IsWebP()))
|
||||
{
|
||||
File.WriteAllBytes(exportFullPath, m_Texture2D.image_data.GetData());
|
||||
debugLog += $"{item.TypeString} \"{item.Text}\" exported to \"{exportFullPath}\"";
|
||||
|
||||
@@ -323,10 +323,13 @@ namespace AssetStudio
|
||||
case TextureFormat.RGBA64: //test pass
|
||||
flag = DecodeRGBA64(buff, destSpan);
|
||||
break;
|
||||
//Tuanjie
|
||||
case TextureFormat.PNG_8_RGBA:
|
||||
case TextureFormat.PNG_24_RGB: //test pass
|
||||
case TextureFormat.PNG_32_RGBA: //test pass
|
||||
flag = DecodePng(buff, destSpan);
|
||||
case TextureFormat.WebP_24:
|
||||
case TextureFormat.WebP_32:
|
||||
flag = DecodeImage(buff, destSpan);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -825,7 +828,7 @@ namespace AssetStudio
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private bool DecodePng(ReadOnlySpan<byte> buff, Span<byte> destSpan)
|
||||
private bool DecodeImage(ReadOnlySpan<byte> buff, Span<byte> destSpan)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user