mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
Improve support of Texture2DArray assets
This commit is contained in:
parent
341612be16
commit
188ee088a2
@ -1,4 +1,6 @@
|
||||
namespace AssetStudio
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace AssetStudio
|
||||
{
|
||||
public class GLTextureSettings
|
||||
{
|
||||
@ -6,6 +8,8 @@
|
||||
public int m_Aniso;
|
||||
public float m_MipBias;
|
||||
public int m_WrapMode;
|
||||
[JsonInclude]
|
||||
private int m_WrapU { set => m_WrapMode = value; }
|
||||
|
||||
public GLTextureSettings() { }
|
||||
|
||||
@ -19,8 +23,8 @@
|
||||
if (version >= 2017)//2017.x and up
|
||||
{
|
||||
m_WrapMode = reader.ReadInt32(); //m_WrapU
|
||||
int m_WrapV = reader.ReadInt32();
|
||||
int m_WrapW = reader.ReadInt32();
|
||||
var m_WrapV = reader.ReadInt32();
|
||||
var m_WrapW = reader.ReadInt32();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -23,23 +23,46 @@ namespace AssetStudio
|
||||
|
||||
public Texture2DArray(ObjectReader reader) : base(reader)
|
||||
{
|
||||
m_ColorSpace = reader.ReadInt32();
|
||||
m_Format = (GraphicsFormat)reader.ReadInt32();
|
||||
if (version >= 2019) //2019 and up
|
||||
{
|
||||
m_ColorSpace = reader.ReadInt32();
|
||||
m_Format = (GraphicsFormat)reader.ReadInt32();
|
||||
}
|
||||
m_Width = reader.ReadInt32();
|
||||
m_Height = reader.ReadInt32();
|
||||
m_Depth = reader.ReadInt32();
|
||||
if (version < 2019) //2019 down
|
||||
{
|
||||
m_Format = (GraphicsFormat)reader.ReadInt32();
|
||||
}
|
||||
m_MipCount = reader.ReadInt32();
|
||||
if (version >= (2023, 2)) //2023.2 and up
|
||||
{
|
||||
var m_MipsStripped = reader.ReadInt32();
|
||||
}
|
||||
m_DataSize = reader.ReadUInt32();
|
||||
m_TextureSettings = new GLTextureSettings(reader);
|
||||
if (version < 2019) //2019 down
|
||||
{
|
||||
m_ColorSpace = reader.ReadInt32();
|
||||
}
|
||||
if (version >= (2020, 2)) //2020.2 and up
|
||||
{
|
||||
var m_UsageMode = reader.ReadInt32();
|
||||
}
|
||||
var m_IsReadable = reader.ReadBoolean();
|
||||
reader.AlignStream();
|
||||
|
||||
if (version > (2023, 2)) //2023.2 and up
|
||||
{
|
||||
var m_IgnoreMipmapLimit = reader.ReadBoolean();
|
||||
reader.AlignStream();
|
||||
var m_MipmapLimitGroupName = reader.ReadAlignedString();
|
||||
}
|
||||
else
|
||||
{
|
||||
reader.AlignStream();
|
||||
}
|
||||
var image_data_size = reader.ReadInt32();
|
||||
if (image_data_size == 0)
|
||||
if (image_data_size == 0 && version >= (5, 6)) //5.6 and up
|
||||
{
|
||||
m_StreamData = new StreamingInfo(reader);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user