Try forcing IMC files to load synchronously for now.

This commit is contained in:
Ottermandias 2025-01-23 18:11:35 +01:00
parent 40168d7daf
commit 55ce633832
2 changed files with 4 additions and 5 deletions

View file

@ -176,7 +176,7 @@ public unsafe class ResourceLoader : IDisposable, IService
gamePath.Path.IsAscii); gamePath.Path.IsAscii);
fileDescriptor->ResourceHandle->FileNameData = path.Path; fileDescriptor->ResourceHandle->FileNameData = path.Path;
fileDescriptor->ResourceHandle->FileNameLength = path.Length; fileDescriptor->ResourceHandle->FileNameLength = path.Length;
MtrlForceSync(fileDescriptor, ref isSync); ForceSync(fileDescriptor, ref isSync);
returnValue = DefaultLoadResource(path, fileDescriptor, priority, isSync, data); returnValue = DefaultLoadResource(path, fileDescriptor, priority, isSync, data);
// Return original resource handle path so that they can be loaded separately. // Return original resource handle path so that they can be loaded separately.
fileDescriptor->ResourceHandle->FileNameData = gamePath.Path.Path; fileDescriptor->ResourceHandle->FileNameData = gamePath.Path.Path;
@ -215,14 +215,14 @@ public unsafe class ResourceLoader : IDisposable, IService
} }
} }
/// <summary> Special handling for materials. </summary> /// <summary> Special handling for materials and IMCs. </summary>
private static void MtrlForceSync(SeFileDescriptor* fileDescriptor, ref bool isSync) private static void ForceSync(SeFileDescriptor* fileDescriptor, ref bool isSync)
{ {
// Force isSync = true for Materials. I don't really understand why, // Force isSync = true for Materials. I don't really understand why,
// or where the difference even comes from. // or where the difference even comes from.
// Was called with True on my client and with false on other peoples clients, // Was called with True on my client and with false on other peoples clients,
// which caused problems. // which caused problems.
isSync |= fileDescriptor->ResourceHandle->FileType is ResourceType.Mtrl; isSync |= fileDescriptor->ResourceHandle->FileType is ResourceType.Mtrl or ResourceType.Imc;
} }
/// <summary> /// <summary>

View file

@ -1,4 +1,3 @@
using Dalamud.Game.ClientState.JobGauge.Types;
using Penumbra.Api.Enums; using Penumbra.Api.Enums;
using Penumbra.Collections.Manager; using Penumbra.Collections.Manager;
using Penumbra.Interop.PathResolving; using Penumbra.Interop.PathResolving;