2019.1 support

This commit is contained in:
Perfare
2019-04-18 10:46:06 +08:00
parent 87e1739208
commit 8946a4fba5
11 changed files with 360 additions and 113 deletions

View File

@ -300,6 +300,8 @@ namespace AssetStudio
{
m_TOS[i] = new KeyValuePair<uint, string>(reader.ReadUInt32(), reader.ReadAlignedString());
}
//HumanDescription m_HumanDescription 2019 and up
}
public string FindBonePath(uint hash)

View File

@ -1,10 +1,23 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace AssetStudio
{
public class MinMaxAABB
{
public Vector3 m_Min;
public Vector3 m_Max;
public MinMaxAABB(BinaryReader reader)
{
m_Min = reader.ReadVector3();
m_Max = reader.ReadVector3();
}
}
public class CompressedMesh
{
public PackedFloatVector m_Vertices;
@ -490,8 +503,20 @@ namespace AssetStudio
var m_RootBoneNameHash = reader.ReadUInt32();
}
if (version[0] > 2 || (version[0] == 2 && version[1] >= 6)) //2.6.0 and later
if (version[0] > 2 || (version[0] == 2 && version[1] >= 6)) //2.6.0 and up
{
if (version[0] >= 2019) //2019 and up
{
var m_BonesAABBSize = reader.ReadInt32();
var m_BonesAABB = new MinMaxAABB[m_BonesAABBSize];
for (int i = 0; i < m_BonesAABBSize; i++)
{
m_BonesAABB[i] = new MinMaxAABB(reader);
}
var m_VariableBoneCountWeights = reader.ReadUInt32Array();
}
var m_MeshCompression = reader.ReadByte();
if (version[0] >= 4)
{
@ -719,7 +744,7 @@ namespace AssetStudio
int[] componentsIntArray = null;
float[] componentsFloatArray = null;
if (m_Channel.format == 11)
if (m_Channel.format == 10 || m_Channel.format == 11)
componentsIntArray = MeshHelper.BytesToIntArray(componentBytes);
else
componentsFloatArray = MeshHelper.BytesToFloatArray(componentBytes, componentByteSize);
@ -1075,6 +1100,10 @@ namespace AssetStudio
return 1u;
case 3: //kChannelFormatByte
return 1u;
case 4: //kChannelFormatUInt32
return 4u;
case 10: //kChannelFormatInt32
return 4u;
case 11: //kChannelFormatInt32
return 4u;
default:

View File

@ -473,11 +473,22 @@ namespace AssetStudio
m_BlobIndex = reader.ReadUInt32();
m_Channels = new ParserBindChannels(reader);
m_KeywordIndices = reader.ReadUInt16Array();
if (version[0] >= 2017) //2017 and up
if (version[0] >= 2019) //2019 and up
{
var m_GlobalKeywordIndices = reader.ReadUInt16Array();
reader.AlignStream();
var m_LocalKeywordIndices = reader.ReadUInt16Array();
reader.AlignStream();
}
else
{
m_KeywordIndices = reader.ReadUInt16Array();
if (version[0] >= 2017) //2017 and up
{
reader.AlignStream();
}
}
m_ShaderHardwareTier = reader.ReadSByte();
m_GpuProgramType = (ShaderGpuProgramType)reader.ReadSByte();
reader.AlignStream();

View File

@ -1,9 +1,22 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
namespace AssetStudio
{
public class SecondarySpriteTexture
{
public PPtr<Texture2D> texture;
public string name;
public SecondarySpriteTexture(ObjectReader reader)
{
texture = new PPtr<Texture2D>(reader);
name = reader.ReadStringToNull();
}
}
public enum SpritePackingRotation
{
kSPRNone = 0,
@ -27,7 +40,7 @@ namespace AssetStudio
public SpritePackingMode packingMode;
public SpritePackingRotation packingRotation;
public SpriteSettings(ObjectReader reader)
public SpriteSettings(BinaryReader reader)
{
settingsRaw = reader.ReadUInt32();
@ -61,6 +74,7 @@ namespace AssetStudio
{
public PPtr<Texture2D> texture;
public PPtr<Texture2D> alphaTexture;
public SecondarySpriteTexture[] secondaryTextures;
public SubMesh[] m_SubMeshes;
public byte[] m_IndexBuffer;
public VertexData m_VertexData;
@ -85,6 +99,16 @@ namespace AssetStudio
alphaTexture = new PPtr<Texture2D>(reader);
}
if (version[0] >= 2019) //2019 and up
{
var secondaryTexturesSize = reader.ReadInt32();
secondaryTextures = new SecondarySpriteTexture[secondaryTexturesSize];
for (int i = 0; i < secondaryTexturesSize; i++)
{
secondaryTextures[i] = new SecondarySpriteTexture(reader);
}
}
if (version[0] > 5 || (version[0] == 5 && version[1] >= 6)) //5.6 and up
{
var m_SubMeshesSize = reader.ReadInt32();