Implement tiled surface edge opcode
This commit is contained in:
@@ -205,6 +205,9 @@ public sealed class GfxState
|
||||
public int DefaultObjectSlot { get; private set; }
|
||||
/// <summary>The D3D render target selected by op 0x20d. -1 denotes the main backbuffer.</summary>
|
||||
public int CurrentRenderTargetSlot { get; private set; } = -1;
|
||||
/// <summary>Legacy mode-1 surface tile edge selected by op 0x248. The portable backend retains
|
||||
/// the native process-global value for parity but stores every surface as one contiguous image.</summary>
|
||||
public int TiledSurfaceEdgeLength { get; private set; }
|
||||
|
||||
// ---- Separate global animation service clock (op 0x238; ctx+0x51b7c total / +0x51b78 elapsed).
|
||||
// Retained for its opcode family; 0x21e scale and 0x220 translation use frame-time directly instead. ----
|
||||
@@ -250,6 +253,13 @@ public sealed class GfxState
|
||||
lock (_lock) DefaultObjectSlot = slot;
|
||||
}
|
||||
|
||||
public void SetTiledSurfaceEdgeLength(long edgeLength)
|
||||
{
|
||||
// Native stores the complete operand in one signed dword. It does not invalidate or rebuild
|
||||
// already-created mode-1 surfaces, nor does it mark the retained compositor dirty.
|
||||
lock (_lock) TiledSurfaceEdgeLength = unchecked((int)edgeLength);
|
||||
}
|
||||
|
||||
public void SetObjectAnchor(long handle, (long X, long Y, long Z) anchor)
|
||||
{
|
||||
lock (_lock) GetOrCreate(handle).V18 = anchor;
|
||||
|
||||
@@ -2367,6 +2367,10 @@ public sealed class VirtualMachine
|
||||
_host.SetTexture(resourceId, (int)Read(a[1]), colorKey);
|
||||
return pc + 1; // host still tracks dims for get-texture-size
|
||||
}
|
||||
case "u00422E80": // pre-reference compatibility
|
||||
case "set-tiled-surface-edge-length": // 0x248 (edge pixels)
|
||||
Gfx.SetTiledSurfaceEdgeLength(Read(a[0]));
|
||||
return pc + 1;
|
||||
case "u00422EB0": // pre-reference compatibility
|
||||
case "load-raw-texture-surface": // 0x249 (packed resource id)(slot)(colorkey)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user