(Unity): fixed compressed segments detection.

better recognize image entries.
This commit is contained in:
morkt 2018-01-28 10:15:34 +04:00
parent 6c0f4657ac
commit a90d3ee9b0
2 changed files with 9 additions and 2 deletions

View File

@ -203,6 +203,8 @@ namespace GameRes.Formats.Unity
Offset = input.Position, Offset = input.Position,
Size = size, Size = size,
}; };
if (name.HasAnyOfExtensions ("jpg", "png"))
entry.Type = "image";
break; break;
} }
case 128: // Font case 128: // Font

View File

@ -45,7 +45,7 @@ namespace GameRes.Formats.Unity
public UnityFSOpener () public UnityFSOpener ()
{ {
Extensions = new string[] { "" }; Extensions = new string[] { "", "unity3d" };
} }
public override ArcFile TryOpen (ArcView file) public override ArcFile TryOpen (ArcView file)
@ -180,7 +180,7 @@ namespace GameRes.Formats.Unity
public uint UnpackedSize; public uint UnpackedSize;
public int Compression; public int Compression;
public bool IsCompressed { get { return Compression != 0; } } public bool IsCompressed { get { return (Compression & 0x3F) != 0; } }
} }
internal class AssetDeserializer internal class AssetDeserializer
@ -373,6 +373,11 @@ namespace GameRes.Formats.Unity
uint signature = reader.ReadUInt32(); uint signature = reader.ReadUInt32();
if (0x0D15F641 == signature) if (0x0D15F641 == signature)
entry.Type = "image"; entry.Type = "image";
else if (0x474E5089 == signature)
{
entry.Type = "image";
entry.IsEncrypted = false;
}
} }
return entry; return entry;
} }