- [Core] fix parsing issues [ExA]

This commit is contained in:
Razmoth
2024-02-29 16:02:08 +04:00
parent 8a3517f894
commit 6c64b41e9e
3 changed files with 49 additions and 18 deletions

View File

@@ -1118,7 +1118,7 @@ namespace AssetStudio
return denseClip; return denseClip;
} }
} }
public class ArkDenseClip : DenseClip public class ACLDenseClip : DenseClip
{ {
public int m_ACLType; public int m_ACLType;
public byte[] m_ACLArray; public byte[] m_ACLArray;
@@ -1130,10 +1130,13 @@ namespace AssetStudio
public uint m_nRotationCurves; public uint m_nRotationCurves;
public uint m_nEulerCurves; public uint m_nEulerCurves;
public uint m_nScaleCurves; public uint m_nScaleCurves;
public uint m_nGenericCurves;
public ArkDenseClip(ObjectReader reader) : base(reader) public ACLDenseClip(ObjectReader reader) : base(reader)
{ {
m_ACLType = reader.ReadInt32(); m_ACLType = reader.ReadInt32();
if (reader.Game.Type.IsArknightsEndfield())
{
m_ACLArray = reader.ReadUInt8Array(); m_ACLArray = reader.ReadUInt8Array();
reader.AlignStream(); reader.AlignStream();
m_PositionFactor = reader.ReadSingle(); m_PositionFactor = reader.ReadSingle();
@@ -1144,7 +1147,21 @@ namespace AssetStudio
m_nRotationCurves = reader.ReadUInt32(); m_nRotationCurves = reader.ReadUInt32();
m_nEulerCurves = reader.ReadUInt32(); m_nEulerCurves = reader.ReadUInt32();
m_nScaleCurves = reader.ReadUInt32(); m_nScaleCurves = reader.ReadUInt32();
}
else if (reader.Game.Type.IsExAstris())
{
m_nPositionCurves = reader.ReadUInt32();
m_nRotationCurves = reader.ReadUInt32();
m_nEulerCurves = reader.ReadUInt32();
m_nScaleCurves = reader.ReadUInt32();
m_nGenericCurves = reader.ReadUInt32();
m_PositionFactor = reader.ReadSingle();
m_EulerFactor = reader.ReadSingle();
m_ScaleFactor = reader.ReadSingle();
m_FloatFactor = reader.ReadSingle();
m_ACLArray = reader.ReadUInt8Array();
reader.AlignStream();
}
Process(); Process();
} }
@@ -1181,7 +1198,7 @@ namespace AssetStudio
{ {
sampleArray.Add(ReadCurve(aclSpan, m_ScaleFactor, ref index)); sampleArray.Add(ReadCurve(aclSpan, m_ScaleFactor, ref index));
} }
var m_nFloatCurves = m_CurveCount - (m_nPositionCurves + m_nRotationCurves + m_nEulerCurves + m_nScaleCurves); var m_nFloatCurves = m_CurveCount - (m_nPositionCurves + m_nRotationCurves + m_nEulerCurves + m_nScaleCurves + m_nGenericCurves);
for (int j = 0; j < m_nFloatCurves; j++) for (int j = 0; j < m_nFloatCurves; j++)
{ {
sampleArray.Add(ReadCurve(aclSpan, m_FloatFactor, ref index)); sampleArray.Add(ReadCurve(aclSpan, m_FloatFactor, ref index));
@@ -1299,9 +1316,9 @@ namespace AssetStudio
{ {
var version = reader.version; var version = reader.version;
m_StreamedClip = new StreamedClip(reader); m_StreamedClip = new StreamedClip(reader);
if (reader.Game.Type.IsArknightsEndfield()) if (reader.Game.Type.IsArknightsEndfield() || reader.Game.Type.IsExAstris())
{ {
m_DenseClip = new ArkDenseClip(reader); m_DenseClip = new ACLDenseClip(reader);
} }
else else
{ {
@@ -1866,6 +1883,11 @@ namespace AssetStudio
m_CompressedRotationCurves.Add(new CompressedAnimationCurve(reader)); m_CompressedRotationCurves.Add(new CompressedAnimationCurve(reader));
} }
if (reader.Game.Type.IsExAstris())
{
var m_aclType = reader.ReadInt32();
}
if (version[0] > 5 || (version[0] == 5 && version[1] >= 3))//5.3 and up if (version[0] > 5 || (version[0] == 5 && version[1] >= 3))//5.3 and up
{ {
int numEulerCurves = reader.ReadInt32(); int numEulerCurves = reader.ReadInt32();

View File

@@ -155,7 +155,7 @@ namespace AssetStudio
m_Streams = new List<StreamInfo>(); m_Streams = new List<StreamInfo>();
for (int i = 0; i < numStreams; i++) for (int i = 0; i < numStreams; i++)
{ {
m_Streams[i] = new StreamInfo(reader); m_Streams.Add(new StreamInfo(reader));
} }
if (version[0] < 4) //4.0 down if (version[0] < 4) //4.0 down
@@ -706,6 +706,11 @@ namespace AssetStudio
int m_CollisionVertexCount = reader.ReadInt32(); int m_CollisionVertexCount = reader.ReadInt32();
} }
if (reader.Game.Type.IsExAstris())
{
var m_ColliderType = reader.ReadInt32();
}
int m_MeshUsageFlags = reader.ReadInt32(); int m_MeshUsageFlags = reader.ReadInt32();
if (version[0] > 2022 || (version[0] == 2022 && version[1] >= 1)) //2022.1 and up if (version[0] > 2022 || (version[0] == 2022 && version[1] >= 1)) //2022.1 and up

View File

@@ -39,6 +39,10 @@ namespace AssetStudio
m_FilterMode = reader.ReadInt32(); m_FilterMode = reader.ReadInt32();
m_Aniso = reader.ReadInt32(); m_Aniso = reader.ReadInt32();
m_MipBias = reader.ReadSingle(); m_MipBias = reader.ReadSingle();
if (reader.Game.Type.IsExAstris())
{
var m_TextureGroup = reader.ReadInt32();
}
if (version[0] >= 2017)//2017.x and up if (version[0] >= 2017)//2017.x and up
{ {
m_WrapMode = reader.ReadInt32(); //m_WrapU m_WrapMode = reader.ReadInt32(); //m_WrapU