mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2025-12-12 10:17:23 +01:00
Temporarily use custom address for ReadStainingTemplate.
This commit is contained in:
parent
9a684c9ff5
commit
b53124e708
2 changed files with 10 additions and 6 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Dalamud.Hooking;
|
||||
using Dalamud.Utility.Signatures;
|
||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
|
||||
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
|
||||
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
|
||||
|
|
@ -27,7 +28,8 @@ public sealed unsafe class PrepareColorSet
|
|||
: base("Prepare Color Set ")
|
||||
{
|
||||
_updateColorSets = updateColorSets;
|
||||
_task = hooks.CreateHook<Delegate>(Name, Sigs.PrepareColorSet, Detour, true);
|
||||
hooks.Provider.InitializeFromAttributes(this);
|
||||
_task = hooks.CreateHook<Delegate>(Name, Sigs.PrepareColorSet, Detour, true);
|
||||
}
|
||||
|
||||
private readonly Task<Hook<Delegate>> _task;
|
||||
|
|
@ -49,6 +51,10 @@ public sealed unsafe class PrepareColorSet
|
|||
|
||||
private delegate Texture* Delegate(MaterialResourceHandle* material, StainId stainId1, StainId stainId2);
|
||||
|
||||
// TODO use CS when stabilized in Dalamud.
|
||||
[Signature("E8 ?? ?? ?? ?? 48 8B FB EB 07")]
|
||||
private static delegate* unmanaged<MaterialResourceHandle*, ushort*, byte, Half*, uint, void> _readStainingTemplate = null;
|
||||
|
||||
private Texture* Detour(MaterialResourceHandle* material, StainId stainId1, StainId stainId2)
|
||||
{
|
||||
Glamourer.Log.Excessive($"[{Name}] Triggered with 0x{(nint)material:X} {stainId1.Id} {stainId2.Id}.");
|
||||
|
|
@ -78,12 +84,10 @@ public sealed unsafe class PrepareColorSet
|
|||
if (GetDyeTable(material, out var dyeTable))
|
||||
{
|
||||
if (stainIds.Stain1.Id != 0)
|
||||
((delegate* unmanaged<MaterialResourceHandle*, ushort*, byte, Half*, uint, void>)MaterialResourceHandle.MemberFunctionPointers
|
||||
.ReadStainingTemplate)(material, dyeTable, stainIds.Stain1.Id, (Half*)(&newTable), 0);
|
||||
_readStainingTemplate(material, dyeTable, stainIds.Stain1.Id, (Half*)(&newTable), 0);
|
||||
|
||||
if (stainIds.Stain2.Id != 0)
|
||||
((delegate* unmanaged<MaterialResourceHandle*, ushort*, byte, Half*, uint, void>)MaterialResourceHandle.MemberFunctionPointers
|
||||
.ReadStainingTemplate)(material, dyeTable, stainIds.Stain2.Id, (Half*)(&newTable), 1);
|
||||
_readStainingTemplate(material, dyeTable, stainIds.Stain2.Id, (Half*)(&newTable), 1);
|
||||
}
|
||||
|
||||
table = newTable;
|
||||
|
|
|
|||
2
OtterGui
2
OtterGui
|
|
@ -1 +1 @@
|
|||
Subproject commit d13d700796648f2a9279250052c4aa8ebeca221f
|
||||
Subproject commit abfce28e0bacdea841f029f59bc19971c43814d8
|
||||
Loading…
Add table
Add a link
Reference in a new issue