diff --git a/FFXIVClientStructs/FFXIV/Client/Graphics/Scene/BgObject.cs b/FFXIVClientStructs/FFXIV/Client/Graphics/Scene/BgObject.cs index efc108373a..140ba0c89f 100644 --- a/FFXIVClientStructs/FFXIV/Client/Graphics/Scene/BgObject.cs +++ b/FFXIVClientStructs/FFXIV/Client/Graphics/Scene/BgObject.cs @@ -71,8 +71,9 @@ public bool TrySetStainColor(ByteColor srgbStainColor) { } } -[StructLayout(LayoutKind.Explicit, Size = 0x14)] -public struct BgObjectStainBuffer { +[GenerateInterop] +[StructLayout(LayoutKind.Explicit, Size = 0x38, Pack = 0x04)] +public unsafe partial struct BgObjectStainBuffer { /// /// The original byte color for the stain. /// @@ -85,6 +86,30 @@ public struct BgObjectStainBuffer { /// The formula is: pow(value / 255.0f, 2.0f) /// [FieldOffset(0x04)] public Vector4 LinearFloatColor; + + // Unclear what kind of resource handle these are. They are loaded from a path in the mdl file, and I haven't seen them actually used. + [FieldOffset(0x18)] public ResourceHandle* LoadedResource; + [FieldOffset(0x20)] public ResourceHandle* LoadingResource; + + /// + /// Three flags populated from the model resource. + /// + [BitField(nameof(Flag0), 0)] + [BitField(nameof(Flag1), 1)] // Seems to control whether the staining resources are loaded + [BitField(nameof(Flag2), 2)] + [FieldOffset(0x30)] private byte _flags; + + internal partial bool Flag0 { get; set; } + internal partial bool Flag1 { get; set; } + internal partial bool Flag2 { get; set; } + + /// + /// Sets up this stain buffer to be used with an instance of the given model resource. + /// + /// The handle of the model resource to set this stain buffer up for. + /// Always true. + [MemberFunction("E8 ?? ?? ?? ?? 48 8B 07 41 0F B6 D6")] + public partial bool Initialize(ModelResourceHandle* modelResource); } [StructLayout(LayoutKind.Explicit, Size = 0x120)] @@ -92,4 +117,5 @@ public unsafe struct BgObjectAnimationData { [FieldOffset(0x00)] public CharacterBase.SkeletonAnimationContainer SkeletonAnimationContainer; [FieldOffset(0x100)] public SkeletonResourceHandle* AsyncSkeletonResourceHandle; [FieldOffset(0x108)] public ResourceHandle* AsyncPapResourceHandle; + [FieldOffset(0x110)] public Render.Skeleton* RenderSkeleton; } diff --git a/ida/data.yml b/ida/data.yml index ab6ab17954..5b7a84bf6f 100644 --- a/ida/data.yml +++ b/ida/data.yml @@ -7488,6 +7488,9 @@ classes: 0x140453160: LoadAnimationData 0x140450B50: ResetFlags 0x140450F70: SetModel + Client::Graphics::Scene::BgObjectStainBuffer: + funcs: + 0x140277070: Initialize Client::Graphics::Scene::EnvScene: vtbls: - ea: 0x1421622F8