mirror of
https://github.com/xivdev/Penumbra.git
synced 2026-02-19 06:17: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
|
|
@ -148,7 +148,7 @@ internal partial record ResolveContext(GlobalResolveContext Global, Pointer<Char
|
|||
return GetOrCreateNode(ResourceType.Tex, (nint)tex->Texture, &tex->ResourceHandle, path);
|
||||
}
|
||||
|
||||
public unsafe ResourceNode? CreateNodeFromModel(Model* mdl, Utf8GamePath imcPath)
|
||||
public unsafe ResourceNode? CreateNodeFromModel(Model* mdl, ResourceHandle* imc)
|
||||
{
|
||||
if (mdl == null || mdl->ModelResourceHandle == null)
|
||||
return null;
|
||||
|
|
@ -169,7 +169,7 @@ internal partial record ResolveContext(GlobalResolveContext Global, Pointer<Char
|
|||
continue;
|
||||
|
||||
var mtrlFileName = GetMaterialFileNameBySlot(mdlResource, (uint)i);
|
||||
var mtrlNode = CreateNodeFromMaterial(mtrl, ResolveMaterialPath(path, imcPath, mtrlFileName));
|
||||
var mtrlNode = CreateNodeFromMaterial(mtrl, ResolveMaterialPath(path, imc, mtrlFileName));
|
||||
if (mtrlNode != null)
|
||||
{
|
||||
if (Global.WithUiData)
|
||||
|
|
@ -358,7 +358,7 @@ internal partial record ResolveContext(GlobalResolveContext Global, Pointer<Char
|
|||
return i >= 0 && i < array.Length ? array[i] : null;
|
||||
}
|
||||
|
||||
internal static unsafe ByteString GetResourceHandlePath(ResourceHandle* handle)
|
||||
internal static unsafe ByteString GetResourceHandlePath(ResourceHandle* handle, bool stripPrefix = true)
|
||||
{
|
||||
if (handle == null)
|
||||
return ByteString.Empty;
|
||||
|
|
@ -367,7 +367,7 @@ internal partial record ResolveContext(GlobalResolveContext Global, Pointer<Char
|
|||
if (name.IsEmpty)
|
||||
return ByteString.Empty;
|
||||
|
||||
if (name[0] == (byte)'|')
|
||||
if (stripPrefix && name[0] == (byte)'|')
|
||||
{
|
||||
var pos = name.IndexOf((byte)'|', 1);
|
||||
if (pos < 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue