Fix FIELD minimap camera pan

This commit is contained in:
gamer147
2026-08-16 10:31:01 -04:00
parent 3289948ce7
commit d4d9def8f4
9 changed files with 87 additions and 24 deletions

View File

@@ -182,6 +182,23 @@ public sealed partial class GfxState
}
}
/// <summary>Op 0x22f: arm the selected retained-gfx range transform's delayed one-shot
/// translation target. FIELD uses this channel to pan the world while its ordinary minimap object
/// runs a matching op-0x220 translation.</summary>
public void SetRangeTranslationChannel(long delayMs, long durationMs,
(long X, long Y, long Z) target)
{
lock (_lock)
{
_rangeTransform.TranslationDelayMs = delayMs;
_rangeTransform.TranslationDurationMs = durationMs;
_rangeTransform.TranslationTarget = target;
_rangeTransform.TranslationEnabled = durationMs > 0;
_rangeTransform.OneShotStartMs = -1;
MarkRetainedMutation();
}
}
/// <summary>Op 0x21d: clone the native 0x2d4-byte retained-object record from source to destination.</summary>
public bool CloneObject(long sourceHandle, long destinationHandle)
{

View File

@@ -39,8 +39,10 @@ public sealed partial class VirtualMachine
Gfx.SetDefaultObjectSlot((int)Read(a[0])); return pc + 1;
// ---- SC0000 anim/transform/spritesheet cluster (docs/engine-re.md §"SC0000 anim ... cluster") ----
case "u00421DD0": // 0x22f set-position: (handle)(op2)(x)(y)(z) -> base position (direct set)
Gfx.SetObjectPosition(Read(a[0]), (Read(a[2]), Read(a[3]), Read(a[4]))); return pc + 1;
case "u00421DD0": // pre-reference compatibility
case "set-gfx-range-translation-target": // 0x22f (delay)(duration)(x)(y)(z)
Gfx.SetRangeTranslationChannel(Read(a[0]), Read(a[1]),
(Read(a[2]), Read(a[3]), Read(a[4]))); return pc + 1;
case "u004219E0": // pre-reference compatibility
case "set-gfx-range-transform": // 0x229 (first)(count)(anchor x/y/z)
Gfx.SetRangeTransform(Read(a[0]), Read(a[1]), (Read(a[2]), Read(a[3]), Read(a[4])));

View File

@@ -1528,7 +1528,8 @@ public sealed partial class VirtualMachine
return StepRetainedObject(label, a, pc);
// ---- SC0000 anim/transform/spritesheet cluster (docs/engine-re.md §"SC0000 anim ... cluster") ----
case "u00421DD0": // 0x22f set-position: (handle)(op2)(x)(y)(z) -> base position (direct set)
case "u00421DD0": // pre-reference compatibility
case "set-gfx-range-translation-target": // 0x22f (delay)(duration)(x)(y)(z)
case "u004219E0": // pre-reference compatibility
case "set-gfx-range-transform": // 0x229 (first)(count)(anchor x/y/z)
case "u00421A90": // pre-reference compatibility