ClientStructs-ify ResourceTree stuff

This commit is contained in:
Exter-N 2025-07-05 05:20:24 +02:00
parent a97d9e4953
commit 278bf43b29

View file

@ -70,8 +70,7 @@ public class ResourceTree(
var genericContext = globalContext.CreateContext(model); var genericContext = globalContext.CreateContext(model);
// TODO ClientStructs-ify (aers/FFXIVClientStructs#1312) var mpapArrayPtr = model->MaterialAnimationPacks;
var mpapArrayPtr = *(ResourceHandle***)((nint)model + 0x948);
var mpapArray = mpapArrayPtr is not null ? new ReadOnlySpan<Pointer<ResourceHandle>>(mpapArrayPtr, model->SlotCount) : []; var mpapArray = mpapArrayPtr is not null ? new ReadOnlySpan<Pointer<ResourceHandle>>(mpapArrayPtr, model->SlotCount) : [];
// TODO ClientStructs-ify (aers/FFXIVClientStructs#1474) // TODO ClientStructs-ify (aers/FFXIVClientStructs#1474)
var skinMtrlArray = modelType switch var skinMtrlArray = modelType switch
@ -124,8 +123,7 @@ public class ResourceTree(
} }
AddSkeleton(Nodes, genericContext, model->EID, model->Skeleton, model->BonePhysicsModule); AddSkeleton(Nodes, genericContext, model->EID, model->Skeleton, model->BonePhysicsModule);
// TODO ClientStructs-ify (aers/FFXIVClientStructs#1312) AddMaterialAnimationSkeleton(Nodes, genericContext, model->MaterialAnimationSkeleton);
AddMaterialAnimationSkeleton(Nodes, genericContext, *(SkeletonResourceHandle**)((nint)model + 0x940));
AddWeapons(globalContext, model); AddWeapons(globalContext, model);
@ -156,8 +154,7 @@ public class ResourceTree(
var genericContext = globalContext.CreateContext(subObject, 0xFFFFFFFFu, slot, equipment, weaponType); var genericContext = globalContext.CreateContext(subObject, 0xFFFFFFFFu, slot, equipment, weaponType);
// TODO ClientStructs-ify (aers/FFXIVClientStructs#1312) var mpapArrayPtr = subObject->MaterialAnimationPacks;
var mpapArrayPtr = *(ResourceHandle***)((nint)subObject + 0x948);
var mpapArray = mpapArrayPtr is not null ? new ReadOnlySpan<Pointer<ResourceHandle>>(mpapArrayPtr, subObject->SlotCount) : []; var mpapArray = mpapArrayPtr is not null ? new ReadOnlySpan<Pointer<ResourceHandle>>(mpapArrayPtr, subObject->SlotCount) : [];
for (var i = 0; i < subObject->SlotCount; ++i) for (var i = 0; i < subObject->SlotCount; ++i)
@ -184,8 +181,7 @@ public class ResourceTree(
AddSkeleton(weaponNodes, genericContext, subObject->EID, subObject->Skeleton, subObject->BonePhysicsModule, AddSkeleton(weaponNodes, genericContext, subObject->EID, subObject->Skeleton, subObject->BonePhysicsModule,
$"Weapon #{weaponIndex}, "); $"Weapon #{weaponIndex}, ");
// TODO ClientStructs-ify (aers/FFXIVClientStructs#1312) AddMaterialAnimationSkeleton(weaponNodes, genericContext, subObject->MaterialAnimationSkeleton,
AddMaterialAnimationSkeleton(weaponNodes, genericContext, *(SkeletonResourceHandle**)((nint)subObject + 0x940),
$"Weapon #{weaponIndex}, "); $"Weapon #{weaponIndex}, ");
++weaponIndex; ++weaponIndex;
@ -263,7 +259,7 @@ public class ResourceTree(
for (var i = 0; i < skeleton->PartialSkeletonCount; ++i) for (var i = 0; i < skeleton->PartialSkeletonCount; ++i)
{ {
// TODO ClientStructs-ify (aers/FFXIVClientStructs#1312) // TODO ClientStructs-ify (aers/FFXIVClientStructs#1475)
var phybHandle = physics != null ? ((ResourceHandle**)((nint)physics + 0x190))[i] : null; var phybHandle = physics != null ? ((ResourceHandle**)((nint)physics + 0x190))[i] : null;
if (context.CreateNodeFromPartialSkeleton(&skeleton->PartialSkeletons[i], phybHandle, (uint)i) is { } sklbNode) if (context.CreateNodeFromPartialSkeleton(&skeleton->PartialSkeletons[i], phybHandle, (uint)i) is { } sklbNode)
{ {