Initial API13 / 7.3 update.

This commit is contained in:
Ottermandias 2025-08-08 00:45:24 +02:00
parent 6689e326ee
commit 3f18ad50de
123 changed files with 158 additions and 160 deletions

View file

@ -16,7 +16,7 @@ public sealed unsafe class ChangeCustomize : FastHook<ChangeCustomize.Delegate>
{
_collectionResolver = collectionResolver;
_metaState = metaState;
Task = hooks.CreateHook<Delegate>("Change Customize", Sigs.ChangeCustomize, Detour, !HookOverrides.Instance.Meta.ChangeCustomize);
Task = hooks.CreateHook<Delegate>("Change Customize", Sigs.UpdateDrawData, Detour, !HookOverrides.Instance.Meta.ChangeCustomize);
}
public delegate bool Delegate(Human* human, CustomizeArray* data, byte skipEquipment);

View file

@ -85,7 +85,7 @@ public readonly record struct MaterialInfo(ObjectIndex ObjectIndex, DrawObjectTy
if (mtrlHandle == null)
continue;
PathDataHandler.Split(mtrlHandle->ResourceHandle.FileName.AsSpan(), out var path, out _);
PathDataHandler.Split(mtrlHandle->FileName.AsSpan(), out var path, out _);
var fileName = CiByteString.FromSpanUnsafe(path, true);
if (fileName == needle)
result.Add(new MaterialInfo(index, type, i, j));

View file

@ -59,7 +59,7 @@ internal unsafe partial record ResolveContext(
if (!Utf8GamePath.FromByteString(CiByteString.Join((byte)'/', ShpkPrefix, gamePath), out var path))
return null;
return GetOrCreateNode(ResourceType.Shpk, (nint)resourceHandle->ShaderPackage, &resourceHandle->ResourceHandle, path);
return GetOrCreateNode(ResourceType.Shpk, (nint)resourceHandle->ShaderPackage, (ResourceHandle*)resourceHandle, path);
}
[SkipLocalsInit]
@ -245,7 +245,7 @@ internal unsafe partial record ResolveContext(
if (Global.Nodes.TryGetValue((path, (nint)resource), out var cached))
return cached;
var node = CreateNode(ResourceType.Mtrl, (nint)mtrl, &resource->ResourceHandle, path, false);
var node = CreateNode(ResourceType.Mtrl, (nint)mtrl, (ResourceHandle*)resource, path, false);
var shpkNode = CreateNodeFromShpk(resource->ShaderPackageResourceHandle, new CiByteString(resource->ShpkName.Value));
if (shpkNode is not null)
{

View file

@ -72,15 +72,14 @@ public class ResourceTree(
var mpapArrayPtr = model->MaterialAnimationPacks;
var mpapArray = mpapArrayPtr is not null ? new ReadOnlySpan<Pointer<ResourceHandle>>(mpapArrayPtr, model->SlotCount) : [];
// TODO ClientStructs-ify (aers/FFXIVClientStructs#1474)
var skinMtrlArray = modelType switch
{
ModelType.Human => new ReadOnlySpan<Pointer<MaterialResourceHandle>>((MaterialResourceHandle**)((nint)model + 0xB48), 5),
ModelType.Human => ((Human*) model)->SlotSkinMaterials,
_ => [],
};
var decalArray = modelType switch
{
ModelType.Human => human->SlotDecalsSpan,
ModelType.Human => human->SlotDecals,
ModelType.DemiHuman => ((Demihuman*)model)->SlotDecals,
ModelType.Weapon => [((Weapon*)model)->Decal],
ModelType.Monster => [((Monster*)model)->Decal],

View file

@ -1,3 +1,4 @@
using Dalamud.Bindings.ImGui;
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
using OtterGui.Services;
using SharpDX.Direct3D;
@ -16,7 +17,7 @@ public sealed unsafe class TextureArraySlicer : IUiService, IDisposable
private readonly HashSet<(nint XivTexture, byte SliceIndex)> _expiredKeys = [];
/// <remarks> Caching this across frames will cause a crash to desktop. </remarks>
public nint GetImGuiHandle(Texture* texture, byte sliceIndex)
public ImTextureID GetImGuiHandle(Texture* texture, byte sliceIndex)
{
if (texture == null)
throw new ArgumentNullException(nameof(texture));
@ -25,7 +26,7 @@ public sealed unsafe class TextureArraySlicer : IUiService, IDisposable
if (_activeSlices.TryGetValue(((nint)texture, sliceIndex), out var state))
{
state.Refresh();
return (nint)state.ShaderResourceView;
return new ImTextureID((nint)state.ShaderResourceView);
}
var srv = (ShaderResourceView)(nint)texture->D3D11ShaderResourceView;
var description = srv.Description;
@ -60,7 +61,7 @@ public sealed unsafe class TextureArraySlicer : IUiService, IDisposable
}
state = new SliceState(new ShaderResourceView(srv.Device, srv.Resource, description));
_activeSlices.Add(((nint)texture, sliceIndex), state);
return (nint)state.ShaderResourceView;
return new ImTextureID((nint)state.ShaderResourceView);
}
public void Tick()