Promote 0x208 from stub to a real VM op that writes the loaded texture's width/height into its two output globals, via new IHost.GetTextureSize. This is the single native primitive the CG-load subroutine (SC0000 label_12649) needs; all downstream centering/anchor geometry is already computed in bytecode. Non-Godot hosts return (0,0) so trace/selftest parity holds (engine 9/9 incl. TraceDiffTests). Godot host gets a temporary (0,0) stub; real impl in the compositor task. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
18 lines
904 B
C#
18 lines
904 B
C#
namespace Age.Engine.Hosting;
|
|
public sealed class CaptureHost : IHost
|
|
{
|
|
public List<(int Offset, string Text)> Emitted { get; } = new();
|
|
public int CallScriptCount { get; private set; }
|
|
public Dictionary<int, int> Stubs { get; } = new();
|
|
public void ShowText(int offset, string text) => Emitted.Add((offset, text));
|
|
public void CallScript(long id) => CallScriptCount++;
|
|
public void OnStub(int opcode) { Stubs.TryGetValue(opcode, out var c); Stubs[opcode] = c + 1; }
|
|
public void WaitForInput() { }
|
|
public void CreateTexture(int slot, int width, int height) { }
|
|
public void SetTexture(long resourceId, int slot) { }
|
|
public void DrawTexture(int slot, int srcX, int srcY, int width, int height, int dstX, int dstY) { }
|
|
public (int Width, int Height) GetTextureSize(int slot) => (0, 0);
|
|
public void PlayBgm(long id) { }
|
|
public void PlayVoice(long id) { }
|
|
}
|