-
Notifications
You must be signed in to change notification settings - Fork 218
Apricot #1660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Apricot #1660
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using FFXIVClientStructs.Apricot.Instance; | ||
| using FFXIVClientStructs.FFXIV.Client.Graphics.Vfx; | ||
|
|
||
| namespace FFXIVClientStructs.Apricot; | ||
|
|
||
| [GenerateInterop] | ||
| [StructLayout(LayoutKind.Explicit, Size = 0x2980)] | ||
| public unsafe partial struct ApricotEngine { | ||
| [FieldOffset(0x1128)] public DataContainer* Data; | ||
|
|
||
| [MemberFunction("E8 ?? ?? ?? ?? 4B 8B 0C 27")] | ||
| public static partial ApricotEngine* GetInstance(); | ||
|
|
||
| [GenerateInterop(isInherited: true)] | ||
| [StructLayout(LayoutKind.Explicit, Size = 0x83030)] | ||
| public partial struct DataContainer { | ||
| [FieldOffset(0x2030), FixedSizeArray] internal FixedSizeArray2048<InstanceContainer> _instances; | ||
|
|
||
| public DocumentInstance* GetDocument(int index) => this._instances[index].Instance; | ||
|
|
||
| public DocumentInstance* GetDocument(VfxResourceHandle handle) => this.GetDocument((int)handle.Index); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| namespace FFXIVClientStructs.Apricot.Data; | ||
|
|
||
| [StructLayout(LayoutKind.Explicit)] | ||
| public struct Document { | ||
| [FieldOffset(0x40)] public unsafe Particle* Particles; | ||
|
|
||
| [FieldOffset(0xE6)] public byte ParticleCount; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| namespace FFXIVClientStructs.Apricot.Data; | ||
|
|
||
| [StructLayout(LayoutKind.Explicit, Size = 0x238)] | ||
| public struct Particle { | ||
| [FieldOffset(0x70)] public unsafe RgbFunctionCurve* Rgb; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| using System.Numerics; | ||
|
|
||
| namespace FFXIVClientStructs.Apricot.Data; | ||
|
|
||
| [StructLayout(LayoutKind.Explicit)] | ||
| public struct RgbFunctionCurve { | ||
| [FieldOffset(0x0)] public uint Data; | ||
| // not a fixed size array, not sure how else to handle this? | ||
| [FieldOffset(0x4), FixedSizeArray] internal unsafe fixed byte _keys[0x10]; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think what you were looking for was
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could do [FieldOffset(0x4)] public RgbKey* KeyPointer;
public Span<RgbKey> Keys => new Span(KeyPointer, KeyCount);with looking at how the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Originally tried this with a
There isn't a pointer here, it's an inline array with a dynamic size. |
||
|
|
||
| public ushort KeyCount => (ushort)(this.Data >> 9); | ||
|
|
||
| public unsafe RgbKey* GetKey(int index) { | ||
| if (index < 0 || index >= this.KeyCount) | ||
| throw new IndexOutOfRangeException($"{index}"); | ||
|
|
||
| fixed (void* ptr = this._keys) | ||
| return (RgbKey*)ptr + index; | ||
| } | ||
|
|
||
| [StructLayout(LayoutKind.Explicit, Size = 0x10)] | ||
| public struct RgbKey { | ||
| [FieldOffset(0x0)] public uint Data; | ||
| [FieldOffset(0x4)] public Vector3 Color; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| using FFXIVClientStructs.Apricot.Data; | ||
|
|
||
| namespace FFXIVClientStructs.Apricot.Instance; | ||
|
|
||
| [StructLayout(LayoutKind.Explicit, Size = 0x500)] | ||
| public struct DocumentInstance { | ||
| [FieldOffset(0)] public unsafe nint* _vfTable; | ||
|
|
||
| [FieldOffset(0x1D4)] public float LocalTime; | ||
| [FieldOffset(0x1DC)] public float TimeScale; | ||
|
|
||
| [FieldOffset(0x1F8)] public unsafe DocumentInstance* Root; | ||
| [FieldOffset(0x200)] public unsafe DocumentInstance* Parent; | ||
| [FieldOffset(0x208)] public unsafe Document* Document; | ||
| [FieldOffset(0x210)] public unsafe DocumentInstance* Child; | ||
| [FieldOffset(0x218)] public unsafe DocumentInstance* ChildLast; | ||
| [FieldOffset(0x220)] public unsafe DocumentInstance* Sibling; | ||
|
|
||
| [FieldOffset(0x49D)] public byte State; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| using FFXIVClientStructs.Apricot.Instance; | ||
|
|
||
| namespace FFXIVClientStructs.Apricot; | ||
|
|
||
| [StructLayout(LayoutKind.Explicit, Size = 0x88)] | ||
| public struct InstanceContainer { | ||
| [FieldOffset(0)] public unsafe DocumentInstance* Instance; | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| namespace FFXIVClientStructs.FFXIV.Client.Graphics.Vfx; | ||
|
|
||
| [StructLayout(LayoutKind.Explicit, Size = 8)] | ||
| public struct VfxResourceHandle { | ||
| [FieldOffset(0), CExporterUnion("Value")] public ulong Value; | ||
| [FieldOffset(0), CExporterUnion("Value")] public uint Id; | ||
| [FieldOffset(4), CExporterUnion("Value")] public uint Index; | ||
|
Comment on lines
+5
to
+7
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this will export the unions as union Value {
uint64_t Value;
uint32_t Id;
uint32_t Index;
}all which are at field offset 0 |
||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.