diff --git a/Penumbra.GameData b/Penumbra.GameData index f97df642..34e3299f 160000 --- a/Penumbra.GameData +++ b/Penumbra.GameData @@ -1 +1 @@ -Subproject commit f97df642999d4edc6dce7fac64903485b5a2fa11 +Subproject commit 34e3299f28c5e1d2b7d071ba8a3f851f5d1fa057 diff --git a/Penumbra/Interop/ResourceLoading/ResourceLoader.cs b/Penumbra/Interop/ResourceLoading/ResourceLoader.cs index b8cc4742..8ccdfa80 100644 --- a/Penumbra/Interop/ResourceLoading/ResourceLoader.cs +++ b/Penumbra/Interop/ResourceLoading/ResourceLoader.cs @@ -92,7 +92,7 @@ public unsafe class ResourceLoader : IDisposable if (resolvedPath == null || !Utf8GamePath.FromByteString(resolvedPath.Value.InternalName, out var p)) { - returnValue = _resources.GetOriginalResource(sync, ref category, ref type, ref hash, path.Path, parameters); + returnValue = _resources.GetOriginalResource(sync, category, type, hash, path.Path, parameters); ResourceLoaded?.Invoke(returnValue, path, resolvedPath, data); return; } @@ -102,7 +102,7 @@ public unsafe class ResourceLoader : IDisposable hash = ComputeHash(resolvedPath.Value.InternalName, parameters); var oldPath = path; path = p; - returnValue = _resources.GetOriginalResource(sync, ref category, ref type, ref hash, path.Path, parameters); + returnValue = _resources.GetOriginalResource(sync, category, type, hash, path.Path, parameters); ResourceLoaded?.Invoke(returnValue, oldPath, resolvedPath.Value, data); } diff --git a/Penumbra/Interop/ResourceLoading/ResourceService.cs b/Penumbra/Interop/ResourceLoading/ResourceService.cs index 792f8a8e..6fb2e560 100644 --- a/Penumbra/Interop/ResourceLoading/ResourceService.cs +++ b/Penumbra/Interop/ResourceLoading/ResourceService.cs @@ -110,26 +110,17 @@ public unsafe class ResourceService : IDisposable if (returnValue != null) return returnValue; - return GetOriginalResource(isSync, categoryId, resourceType, resourceHash, gamePath.Path.Path, pGetResParams, isUnk); + return GetOriginalResource(isSync, *categoryId, *resourceType, *resourceHash, gamePath.Path, pGetResParams, isUnk); } - private ResourceHandle* GetOriginalResource(bool sync, ResourceCategory* categoryId, ResourceType* type, int* hash, byte* path, - GetResourceParameters* resourceParameters = null, bool unk = false) - => sync - ? _getResourceSyncHook.OriginalDisposeSafe(_resourceManager.ResourceManager, categoryId, type, hash, path, - resourceParameters) - : _getResourceAsyncHook.OriginalDisposeSafe(_resourceManager.ResourceManager, categoryId, type, hash, path, - resourceParameters, unk); - /// Call the original GetResource function. - public ResourceHandle* GetOriginalResource(bool sync, ref ResourceCategory categoryId, ref ResourceType type, ref int hash, ByteString path, + public ResourceHandle* GetOriginalResource(bool sync, ResourceCategory categoryId, ResourceType type, int hash, ByteString path, GetResourceParameters* resourceParameters = null, bool unk = false) - { - var ptrCategory = (ResourceCategory*)Unsafe.AsPointer(ref categoryId); - var ptrType = (ResourceType*)Unsafe.AsPointer(ref type); - var ptrHash = (int*)Unsafe.AsPointer(ref hash); - return GetOriginalResource(sync, ptrCategory, ptrType, ptrHash, path.Path, resourceParameters, unk); - } + => sync + ? _getResourceSyncHook.OriginalDisposeSafe(_resourceManager.ResourceManager, &categoryId, &type, &hash, path.Path, + resourceParameters) + : _getResourceAsyncHook.OriginalDisposeSafe(_resourceManager.ResourceManager, &categoryId, &type, &hash, path.Path, + resourceParameters, unk); #endregion diff --git a/Penumbra/UI/Tabs/DebugTab.cs b/Penumbra/UI/Tabs/DebugTab.cs index b0715da1..5abb3c2f 100644 --- a/Penumbra/UI/Tabs/DebugTab.cs +++ b/Penumbra/UI/Tabs/DebugTab.cs @@ -858,7 +858,7 @@ public class DebugTab : Window, ITab return; ImGui.TableNextColumn(); - ImGui.TextUnformatted(r->Category.ToString()); + ImGui.TextUnformatted(((ResourceCategory)r->Type.Value).ToString()); ImGui.TableNextColumn(); ImGui.TextUnformatted(r->FileType.ToString("X")); ImGui.TableNextColumn();