areatemplate added
This commit is contained in:
parent
0c14d78d8a
commit
94b460bbc8
8 changed files with 125 additions and 20 deletions
|
|
@ -7,7 +7,6 @@ namespace Roboto.Memory.Objects;
|
|||
/// <summary>
|
||||
/// Reads WorldData struct (168B, 1 RPM) and resolves the camera matrix.
|
||||
/// Primary camera source: WorldData.CameraPtr. Fallback: InGameState.CameraPtr (set via FallbackCameraPtr).
|
||||
/// Owns AreaTemplate child for area metadata.
|
||||
/// </summary>
|
||||
public sealed class WorldData : RemoteObject
|
||||
{
|
||||
|
|
@ -21,12 +20,7 @@ public sealed class WorldData : RemoteObject
|
|||
/// <summary>Resolved address of the camera matrix for hot-path caching.</summary>
|
||||
public nint CameraMatrixAddress { get; private set; }
|
||||
|
||||
public AreaTemplate AreaTemplate { get; }
|
||||
|
||||
public WorldData(MemoryContext ctx, MsvcStringReader strings) : base(ctx)
|
||||
{
|
||||
AreaTemplate = new AreaTemplate(ctx, strings);
|
||||
}
|
||||
public WorldData(MemoryContext ctx) : base(ctx) { }
|
||||
|
||||
protected override bool ReadData()
|
||||
{
|
||||
|
|
@ -36,12 +30,6 @@ public sealed class WorldData : RemoteObject
|
|||
// Read the full WorldData struct (0xA8 = 168 bytes, 1 RPM)
|
||||
_data = mem.Read<WdStruct>(Address);
|
||||
|
||||
// Cascade to AreaTemplate
|
||||
if (_data.WorldAreaDetailsPtr != 0)
|
||||
AreaTemplate.Update(_data.WorldAreaDetailsPtr);
|
||||
else
|
||||
AreaTemplate.Reset();
|
||||
|
||||
// Resolve camera: primary from WorldData, fallback from InGameState
|
||||
if (offsets.CameraMatrixOffset <= 0)
|
||||
return true;
|
||||
|
|
@ -69,6 +57,5 @@ public sealed class WorldData : RemoteObject
|
|||
FallbackCameraPtr = 0;
|
||||
CameraMatrix = null;
|
||||
CameraMatrixAddress = 0;
|
||||
AreaTemplate.Reset();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue