From f533ae66671c49682451982656f268d13192d7a0 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Fri, 19 Jul 2024 17:33:54 +0200 Subject: [PATCH] Some cleanup. --- .../ResolveContext.PathResolution.cs | 2 -- .../ResourceTree/ResourceTreeFactory.cs | 18 ++++++++++-------- .../Interop/Structs/CharacterUtilityData.cs | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Penumbra/Interop/ResourceTree/ResolveContext.PathResolution.cs b/Penumbra/Interop/ResourceTree/ResolveContext.PathResolution.cs index 07f305ac..678dd8a9 100644 --- a/Penumbra/Interop/ResourceTree/ResolveContext.PathResolution.cs +++ b/Penumbra/Interop/ResourceTree/ResolveContext.PathResolution.cs @@ -199,8 +199,6 @@ internal partial record ResolveContext ByteString? path; try { - Penumbra.Log.Information($"{(nint)CharacterBase:X} {ModelType} {SlotIndex} 0x{(ulong)mtrlFileName:X}"); - Penumbra.Log.Information($"{new ByteString(mtrlFileName)}"); path = CharacterBase->ResolveMtrlPathAsByteString(SlotIndex, mtrlFileName); } catch (AccessViolationException) diff --git a/Penumbra/Interop/ResourceTree/ResourceTreeFactory.cs b/Penumbra/Interop/ResourceTree/ResourceTreeFactory.cs index 46c7ce35..65fac68f 100644 --- a/Penumbra/Interop/ResourceTree/ResourceTreeFactory.cs +++ b/Penumbra/Interop/ResourceTree/ResourceTreeFactory.cs @@ -18,7 +18,7 @@ public class ResourceTreeFactory( ObjectManager objects, MetaFileManager metaFileManager, CollectionResolver resolver, - ObjectIdentification identifier, + ObjectIdentification objectIdentifier, Configuration config, ActorManager actors, PathState pathState) : IService @@ -80,7 +80,7 @@ public class ResourceTreeFactory( var networked = character.EntityId != 0xE0000000; var tree = new ResourceTree(name, anonymizedName, character.ObjectIndex, (nint)gameObjStruct, (nint)drawObjStruct, localPlayerRelated, related, networked, collectionResolveData.ModCollection.Name, collectionResolveData.ModCollection.AnonymizedName); - var globalContext = new GlobalResolveContext(metaFileManager, identifier, collectionResolveData.ModCollection, + var globalContext = new GlobalResolveContext(metaFileManager, objectIdentifier, collectionResolveData.ModCollection, cache, (flags & Flags.WithUiData) != 0); using (var _ = pathState.EnterInternalResolve()) { @@ -125,6 +125,14 @@ public class ResourceTreeFactory( private static void FilterFullPaths(ResourceTree tree, string? onlyWithinPath) { + foreach (var node in tree.FlatNodes) + { + if (!ShallKeepPath(node.FullPath, onlyWithinPath)) + node.FullPath = FullPath.Empty; + } + + return; + static bool ShallKeepPath(FullPath fullPath, string? onlyWithinPath) { if (!fullPath.IsRooted) @@ -139,12 +147,6 @@ public class ResourceTreeFactory( return fullPath.Exists; } - - foreach (var node in tree.FlatNodes) - { - if (!ShallKeepPath(node.FullPath, onlyWithinPath)) - node.FullPath = FullPath.Empty; - } } private static void Cleanup(ResourceTree tree) diff --git a/Penumbra/Interop/Structs/CharacterUtilityData.cs b/Penumbra/Interop/Structs/CharacterUtilityData.cs index d33da477..197de0bb 100644 --- a/Penumbra/Interop/Structs/CharacterUtilityData.cs +++ b/Penumbra/Interop/Structs/CharacterUtilityData.cs @@ -15,7 +15,7 @@ public unsafe struct CharacterUtilityData .Where(n => n.First.StartsWith("Eqdp")) .Select(n => n.Second).ToArray(); - public const int TotalNumResources = 89; + public const int TotalNumResources = 114; /// Obtain the index for the eqdp file corresponding to the given race code and accessory. public static MetaIndex EqdpIdx(GenderRace raceCode, bool accessory)