Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion FFXIVClientStructs/FFXIV/Client/Graphics/Scene/EnvLocation.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;
using FFXIVClientStructs.FFXIV.Client.System.File;
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;

namespace FFXIVClientStructs.FFXIV.Client.Graphics.Scene;

// Client::Graphics::Scene::EnvLocation
Expand All @@ -6,4 +10,21 @@ namespace FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
[GenerateInterop]
[Inherits<DrawObject>]
[StructLayout(LayoutKind.Explicit, Size = 0x4E0)]
public unsafe partial struct EnvLocation;
public unsafe partial struct EnvLocation {
[FieldOffset(0x90)] public AmbientSetResourceHandle* AmbientSetResource;
[FieldOffset(0x98)] public TextureResourceHandle* EnvironmentCubemapResource;
[FieldOffset(0xA0)] public void* AmbientSet;
[FieldOffset(0xA8)] public Texture* EnvironmentCubemap;
[FieldOffset(0xB0)] private float UnkB0;
[FieldOffset(0xB8)] private byte UnkB8;
[FieldOffset(0xB9)] private ushort UnkB9;
[FieldOffset(0xC0)] public FileAccessPath AmbientSetResourcePath;
[FieldOffset(0x2D0)] public FileAccessPath EnvironmentCubemapResourcePath;

// There can only be 32 at once. Beyond that it returns null.
[MemberFunction("40 53 48 83 EC 20 83 3D ?? ?? ?? ?? ?? 7D 4E")]
public static partial EnvLocation* TryCreate();

[MemberFunction("E9 ?? ?? ?? ?? 48 83 C4 20 5B C3 CC CC CC CC CC CC C2 00 00")]
public static partial void TryDestroy(EnvLocation** locationPointer);
}
15 changes: 15 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Graphics/Scene/EnvScene.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
using FFXIVClientStructs.FFXIV.Client.Graphics.Kernel;

namespace FFXIVClientStructs.FFXIV.Client.Graphics.Scene;

// Client::Graphics::Scene::EnvScene
// Created by the LayoutEnvironment
[GenerateInterop]
[StructLayout(LayoutKind.Explicit, Size = 0x8F0)]
public unsafe partial struct EnvScene {
[FieldOffset(0x30), FixedSizeArray] internal FixedSizeArray32<byte> _weatherIds;

[FieldOffset(0xF0), FixedSizeArray] internal FixedSizeArray8<EnvSpace> _envSpaces;

[FieldOffset(0x880)] public EnvLocation** Locations; // array that can store 32 pointers
[FieldOffset(0x888)] public uint LocationCount; // How many valid EnvLocation pointers in Locations
[FieldOffset(0x8D0)] public Texture* CubemapArray;
[FieldOffset(0x8D8)] public ConstantBuffer* ConstantBuffer; // constant buffer size: 0x10

// Returns true but does nothing if the given location is already in this scene.
[MemberFunction("4C 8B D1 48 85 D2 74 3F")]
public partial bool AddLocation(EnvLocation* location);

[MemberFunction("4C 8B D1 48 85 D2 74 25 44 8B 81")]
public partial bool RemoveLocation(EnvLocation* location);
}
4 changes: 4 additions & 0 deletions FFXIVClientStructs/FFXIV/Client/Graphics/Scene/EnvSpace.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;

namespace FFXIVClientStructs.FFXIV.Client.Graphics.Scene;

// Client::Graphics::Scene::EnvSpace
Expand All @@ -7,5 +9,7 @@ namespace FFXIVClientStructs.FFXIV.Client.Graphics.Scene;
[Inherits<DrawObject>]
[StructLayout(LayoutKind.Explicit, Size = 0xF0)]
public unsafe partial struct EnvSpace {
[FieldOffset(0x90)] public EnvSetResourceHandle* EnvSetResourceHandle;
[FieldOffset(0x98)] public SoundSetResourceHandle* SoundSetResourceHandle;
[FieldOffset(0xB0)] public EnvLocation* EnvLocation;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;

namespace FFXIVClientStructs.FFXIV.Client.LayoutEngine.Environment;

// Client::LayoutEngine::Environment::LayoutEnvironment
[StructLayout(LayoutKind.Explicit, Size = 0x28)]
public unsafe struct LayoutEnvironment {
[FieldOffset(0x08)] public LayoutManager* LayoutManager;
[FieldOffset(0x10)] public EnvScene* GraphicsEnvironment; // Only set in the ActiveLayout, null in the GlobalLayout
[FieldOffset(0x18)] private void* Unk18;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using FFXIVClientStructs.FFXIV.Client.Graphics.Scene;

namespace FFXIVClientStructs.FFXIV.Client.LayoutEngine.Layer;

// Client::LayoutEngine::Layer::EnvLocationLayoutInstance
// Client::LayoutEngine::ILayoutInstance
[GenerateInterop]
[Inherits<ILayoutInstance>]
[StructLayout(LayoutKind.Explicit, Size = 0x48)]
public unsafe partial struct EnvLocationLayoutInstance {
[FieldOffset(0x30)] public EnvLocation* GraphicsObject;
[FieldOffset(0x38)] private void* Unk38; // Array of 0x4C structures memcpy'd from the file
[FieldOffset(0x40)] private int Unk40; // Count of Unk38
[FieldOffset(0x44)] private uint Unk44;
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public unsafe partial struct LayoutManager {
[FieldOffset(0x080)] public float FestivalLayersAddTimer; // dt * 30
[FieldOffset(0x084)] public float FestivalLayersRemoveTimer; // dt * 30
[FieldOffset(0x088)] public void* StreamingManager;
[FieldOffset(0x090)] public void* Environment;
[FieldOffset(0x090)] public void* Environment; // TODO: Change to LayoutEnvironment*
[FieldOffset(0x098)] public void* OBSetManager;
[FieldOffset(0x0A0)] public OutdoorAreaLayoutData* OutdoorAreaData;
[FieldOffset(0x0A8)] public OutdoorExteriorLayoutData* OutdoorExteriorData;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;

// Client::System::Resource::Handle::AmbientSetResourceHandle
// Client::System::Resource::Handle::DefaultResourceHandle
// Client::System::Resource::Handle::ResourceHandle
// Client::System::Common::NonCopyable
[GenerateInterop]
[Inherits<DefaultResourceHandle>]
[StructLayout(LayoutKind.Explicit, Size = 0xC8)]
public partial struct AmbientSetResourceHandle; // .amb
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ namespace FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;
[GenerateInterop]
[Inherits<DefaultResourceHandle>]
[StructLayout(LayoutKind.Explicit, Size = 0xC8)]
public unsafe partial struct ApricotResourceHandle { }
public partial struct ApricotResourceHandle;
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;

// Client::System::Resource::Handle::EnvSetResourceHandle
// Client::System::Resource::Handle::DefaultResourceHandle
// Client::System::Resource::Handle::ResourceHandle
// Client::System::Common::NonCopyable
[GenerateInterop]
[Inherits<DefaultResourceHandle>]
[StructLayout(LayoutKind.Explicit, Size = 0xC8)]
public partial struct EnvSetResourceHandle; // .envb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
namespace FFXIVClientStructs.FFXIV.Client.System.Resource.Handle;

// Client::System::Resource::Handle::SoundSetResourceHandle
// Client::System::Resource::Handle::DefaultResourceHandle
// Client::System::Resource::Handle::ResourceHandle
// Client::System::Common::NonCopyable
[GenerateInterop]
[Inherits<DefaultResourceHandle>]
[StructLayout(LayoutKind.Explicit, Size = 0xC8)]
public partial struct SoundSetResourceHandle; // .essb
4 changes: 4 additions & 0 deletions ida/data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7466,6 +7466,8 @@ classes:
base: Client::Graphics::Scene::DrawObject
funcs:
0x140455530: ctor
0x140798B70: TryCreate
0x140798BF0: TryDestroy
Client::Graphics::Scene::EnvSpace:
vtbls:
- ea: 0x142162168
Expand Down Expand Up @@ -7493,6 +7495,8 @@ classes:
- ea: 0x1421622F8
funcs:
0x1404582A0: ctor
0x1404590E0: AddLocation
0x140459130: RemoveLocation
Client::Graphics::Scene::ResidentResourceManager::ResourceList:
vtbls:
- ea: 0x1421625B8
Expand Down
Loading