mirror of
https://github.com/crskycode/GARbro.git
synced 2026-06-29 07:07:31 +08:00
(UnityFS): deserialize textures with "StreamingInfo".
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
//
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.IO;
|
||||
using System.Windows.Media;
|
||||
using GameRes.Formats.DirectDraw;
|
||||
@@ -100,6 +101,20 @@ namespace GameRes.Formats.Unity
|
||||
{
|
||||
m_Data = reader.ReadBytes (m_DataLength);
|
||||
}
|
||||
|
||||
public void Import (IDictionary fields)
|
||||
{
|
||||
m_Name = fields["m_Name"] as string ?? "";
|
||||
m_Width = (int)(fields["m_Width"] ?? 0);
|
||||
m_Height = (int)(fields["m_Height"] ?? 0);
|
||||
m_CompleteImageSize = (int)(fields["m_CompleteImageSize"] ?? 0);
|
||||
m_TextureFormat = (TextureFormat)(fields["m_TextureFormat"] ?? 0);
|
||||
m_MipCount = (int)(fields["m_MipCount"] ?? 0);
|
||||
m_ImageCount = (int)(fields["m_ImageCount"] ?? 0);
|
||||
m_TextureDimension = (int)(fields["m_TextureDimension"] ?? 0);
|
||||
m_IsReadable = (bool)(fields["m_IsReadable"] ?? false);
|
||||
m_Data = fields["image data"] as byte[] ?? Array.Empty<byte>();
|
||||
}
|
||||
}
|
||||
|
||||
internal class Texture2DDecoder : IImageDecoder
|
||||
|
||||
Reference in New Issue
Block a user