From 55ce63383255b541d3644587a10db9c765b519b1 Mon Sep 17 00:00:00 2001 From: Ottermandias Date: Thu, 23 Jan 2025 18:11:35 +0100 Subject: [PATCH] Try forcing IMC files to load synchronously for now. --- Penumbra/Interop/Hooks/ResourceLoading/ResourceLoader.cs | 8 ++++---- Penumbra/Interop/Processing/ImcFilePostProcessor.cs | 1 - 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Penumbra/Interop/Hooks/ResourceLoading/ResourceLoader.cs b/Penumbra/Interop/Hooks/ResourceLoading/ResourceLoader.cs index ad9c41e6..a74a3712 100644 --- a/Penumbra/Interop/Hooks/ResourceLoading/ResourceLoader.cs +++ b/Penumbra/Interop/Hooks/ResourceLoading/ResourceLoader.cs @@ -176,7 +176,7 @@ public unsafe class ResourceLoader : IDisposable, IService gamePath.Path.IsAscii); fileDescriptor->ResourceHandle->FileNameData = path.Path; fileDescriptor->ResourceHandle->FileNameLength = path.Length; - MtrlForceSync(fileDescriptor, ref isSync); + ForceSync(fileDescriptor, ref isSync); returnValue = DefaultLoadResource(path, fileDescriptor, priority, isSync, data); // Return original resource handle path so that they can be loaded separately. fileDescriptor->ResourceHandle->FileNameData = gamePath.Path.Path; @@ -215,14 +215,14 @@ public unsafe class ResourceLoader : IDisposable, IService } } - /// Special handling for materials. - private static void MtrlForceSync(SeFileDescriptor* fileDescriptor, ref bool isSync) + /// Special handling for materials and IMCs. + private static void ForceSync(SeFileDescriptor* fileDescriptor, ref bool isSync) { // Force isSync = true for Materials. I don't really understand why, // or where the difference even comes from. // Was called with True on my client and with false on other peoples clients, // which caused problems. - isSync |= fileDescriptor->ResourceHandle->FileType is ResourceType.Mtrl; + isSync |= fileDescriptor->ResourceHandle->FileType is ResourceType.Mtrl or ResourceType.Imc; } /// diff --git a/Penumbra/Interop/Processing/ImcFilePostProcessor.cs b/Penumbra/Interop/Processing/ImcFilePostProcessor.cs index 513877d4..949baaa3 100644 --- a/Penumbra/Interop/Processing/ImcFilePostProcessor.cs +++ b/Penumbra/Interop/Processing/ImcFilePostProcessor.cs @@ -1,4 +1,3 @@ -using Dalamud.Game.ClientState.JobGauge.Types; using Penumbra.Api.Enums; using Penumbra.Collections.Manager; using Penumbra.Interop.PathResolving;