mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-01-03 06:13:45 +01:00
ResourceTree: Are we fast yet?
This commit is contained in:
parent
b2bf6eb0f7
commit
60551c8739
5 changed files with 33 additions and 25 deletions
|
|
@ -168,11 +168,19 @@ public unsafe class ImcFile : MetaBaseFile
|
|||
if (file == null)
|
||||
throw new Exception();
|
||||
|
||||
fixed (byte* ptr = file.Data)
|
||||
return GetEntry(file.Data, slot, variantIdx, out exists);
|
||||
}
|
||||
|
||||
public static ImcEntry GetEntry(ReadOnlySpan<byte> imcFileData, EquipSlot slot, Variant variantIdx, out bool exists)
|
||||
{
|
||||
fixed (byte* ptr = imcFileData)
|
||||
{
|
||||
var entry = VariantPtr(ptr, PartIndex(slot), variantIdx);
|
||||
if (entry == null)
|
||||
{
|
||||
exists = false;
|
||||
return new ImcEntry();
|
||||
}
|
||||
|
||||
exists = true;
|
||||
return *entry;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue