RynthCore as of 2026-10-04 (internal 843c801): RynthNav auto-travel and the navigation map, plugin API v75 (server and titles), launcher with Available plugins, download progress and the update on the front page, opt-in usage statistics, NPC names, radar colours, title-bar text size, FPS limiter, client action unlocks, release 2026.10.4.6

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Tom Bohar 2026-10-04 18:34:27 -04:00
commit a24ed6df7c
322 changed files with 83009 additions and 7504 deletions

View file

@ -70,6 +70,33 @@ internal static unsafe class GameMatrixCapture
private static bool _loggedFirstCapture;
public static bool HasCapturedFrame => _hasValidViewProj;
// Landblock whose local frame the current view matrix is built in: the
// anchor (submission / player) landblock when the camera was shifted into
// it, else the viewer's own. Anything projecting a world point must first
// move that point into this landblock's frame (192 m per landblock step).
private static uint _frameLandblock;
/// <summary>
/// Landblock (cellId &gt;&gt; 16) whose local coordinates WorldToScreen expects,
/// as of the last CaptureFrame; 0 when unknown. AC's render thread.
/// </summary>
public static uint FrameLandblock => _frameLandblock;
// Camera position in the same frame as the view matrix (D3D axes: x = east,
// y = up, z = north, FrameLandblock-local), as of the last CaptureFrame.
private static float _camX, _camY, _camZ;
/// <summary>
/// The camera's position in WorldToScreen's frame (D3D axes, FrameLandblock-local).
/// False before the first capture. AC's render thread.
/// </summary>
public static bool TryGetCameraPosition(out float x, out float y, out float z)
{
x = _camX; y = _camY; z = _camZ;
return _hasValidViewProj;
}
public static uint ViewportWidth => _vpWidth;
public static uint ViewportHeight => _vpHeight;
@ -100,6 +127,10 @@ internal static unsafe class GameMatrixCapture
if (pMatrix != null && state == D3DTS_PROJECTION)
{
bool isPerspective = Math.Abs(pMatrix[11]) > 0.01f;
// Decal clients: a Virindi/Decal/UB 3D pass into its own render target must not
// replace AC's projection. Projection sets are rare; only checked with Decal.
if (isPerspective && DecalD3D9.Enabled && !ImGuiBackend.DX9Backend.IsRenderingToBackBuffer(dev))
isPerspective = false;
if (isPerspective)
{
for (int i = 0; i < 16; i++)
@ -198,6 +229,7 @@ internal static unsafe class GameMatrixCapture
uint viewerCellId = unchecked((uint)Marshal.ReadInt32(camFrame + CamCellIdOffset));
uint viewerLandblock = viewerCellId >> 16;
viewerLbForLog = viewerLandblock;
uint frameLandblock = viewerLandblock; // replaced by the anchor when the shift applies
// Prefer the landblock the plugin tick LOCKED IN when it submitted
// its Nav3D geometry (see Nav3DRenderer.ClearFrame). If we use the
@ -235,6 +267,7 @@ internal static unsafe class GameMatrixCapture
cx += dXBlocks * 192f; // EW shift back into player-landblock frame
cy += dYBlocks * 192f; // NS
shiftApplied = (dXBlocks != 0 || dYBlocks != 0);
frameLandblock = playerLandblock;
}
else
{
@ -299,6 +332,8 @@ internal static unsafe class GameMatrixCapture
RynthLog.D3D9($"GameMatrixCapture: viewport={_vpWidth}x{_vpHeight}");
}
_camX = px; _camY = py; _camZ = pz;
_frameLandblock = frameLandblock;
_hasValidViewProj = true;
}
@ -354,8 +389,8 @@ internal static unsafe class GameMatrixCapture
{
try
{
IntPtr vtable = Marshal.ReadIntPtr(pDevice);
IntPtr setTransformAddr = Marshal.ReadIntPtr(vtable, DeviceVTableIndex.SetTransform * IntPtr.Size);
IntPtr setTransformAddr = DecalD3D9.HookTarget(pDevice, DeviceVTableIndex.SetTransform);
if (setTransformAddr == IntPtr.Zero) return; // Decal client and the slot isn't d3d9's: not hooked
_hookDelegate = new SetTransformD(SetTransformDetour);
IntPtr detourPtr = Marshal.GetFunctionPointerForDelegate(_hookDelegate);