- [Core] Adjust LZ4 namespace.

- [Core] Added support to `AnimationClip` [Ark]
This commit is contained in:
Razmoth
2023-11-13 23:06:08 +04:00
parent 5e5b6d1105
commit b768acbd9c
7 changed files with 136 additions and 51 deletions

View File

@@ -18,6 +18,23 @@ namespace AssetStudio
}
return buffer;
}
public static byte[] ToUInt8Array(this byte[] source, int offset, int size)
{
var buffer = new byte[size / 2];
for (var i = 0; i < size; i++)
{
var idx = i / 2;
if (i % 2 == 0)
{
buffer[idx] = (byte)(source[offset + i] << 4);
}
else
{
buffer[idx] |= source[offset + i];
}
}
return buffer;
}
public static int Search(this byte[] src, string value, int offset = 0) => Search(src.AsSpan(), Encoding.UTF8.GetBytes(value), offset);
public static int Search(this Span<byte> src, byte[] pattern, int offset = 0)
{