Snapshot for release 2026.10.22.2 (internal e613280)
This commit is contained in:
parent
10c58b53b6
commit
893973d0dd
16 changed files with 871 additions and 188 deletions
|
|
@ -381,18 +381,22 @@ namespace RynthLua.ScriptWindowsTests
|
|||
var (underId, under) = found.First(f => f.Id != iconId);
|
||||
AcIconImage? both = AcIconDecoder.Compose(dat, iconId, underId, 0);
|
||||
Check(both != null && both.Width == icon.Width && both.Height == icon.Height, "stacked: the icon's size");
|
||||
if (both == null) return;
|
||||
// Since 2026-10-09 (engine fd12e93) Compose repaints the dat's white outline band, as the client
|
||||
// does, so the icon on its own is Compose with no layers, not the raw Decode.
|
||||
AcIconImage? alone = AcIconDecoder.Compose(dat, iconId, 0, 0);
|
||||
Check(alone != null && alone.Pixels.Length == icon.Pixels.Length, "the icon alone: same size as decoded");
|
||||
if (both == null || alone == null) return;
|
||||
bool overOk = true, underOk = true;
|
||||
for (int i = 0; i < 1024; i++)
|
||||
{
|
||||
int a = icon.Pixels[i * 4 + 3];
|
||||
if (a == 255 && !both.Pixels.AsSpan(i * 4, 4).SequenceEqual(icon.Pixels.AsSpan(i * 4, 4))) overOk = false;
|
||||
if (a == 255 && !both.Pixels.AsSpan(i * 4, 4).SequenceEqual(alone.Pixels.AsSpan(i * 4, 4))) overOk = false;
|
||||
if (a == 0 && !both.Pixels.AsSpan(i * 4, 4).SequenceEqual(under.Pixels.AsSpan(i * 4, 4)) && under.Pixels[i * 4 + 3] == 255) underOk = false;
|
||||
}
|
||||
Check(overOk, $"stacked: opaque icon pixels win (0x{iconId:X8} over 0x{underId:X8})");
|
||||
Check(underOk, "stacked: where the icon is clear, the underlay shows");
|
||||
AcIconImage? missingLayers = AcIconDecoder.Compose(dat, iconId, 0x06FFFFFE, 0x06FFFFFD);
|
||||
Check(missingLayers != null && missingLayers.Pixels.AsSpan().SequenceEqual(icon.Pixels), "a missing underlay / overlay is left out");
|
||||
Check(missingLayers != null && missingLayers.Pixels.AsSpan().SequenceEqual(alone.Pixels), "a missing underlay / overlay is left out");
|
||||
Check(AcIconDecoder.Compose(dat, 0x06FFFFFE, underId, 0) == null, "no picture when the icon itself is missing");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1820,10 +1820,13 @@ namespace RynthLua.ScriptWindowsTests
|
|||
int Renders() => (int)r.Eval("renders").Number;
|
||||
long f = System.Diagnostics.Stopwatch.Frequency;
|
||||
|
||||
// Each pass is timed between a stamp before and one after it, not from "now" after it: on a
|
||||
// busy PC the gap after a pass can be longer than the 1/60 s being checked (2026-10-22).
|
||||
long before = System.Diagnostics.Stopwatch.GetTimestamp();
|
||||
RunHudPasses(p);
|
||||
long after = System.Diagnostics.Stopwatch.GetTimestamp();
|
||||
Check(Renders() == 1 && h.EverPassed && !h.FirstPassSinceShown && !h.PassNow, "just shown: a pass on the first tick");
|
||||
long left = h.NextPassAt - System.Diagnostics.Stopwatch.GetTimestamp();
|
||||
Check(left > 0 && left <= f / 20, "the next pass is one 20/s interval away");
|
||||
Check(h.NextPassAt > before && h.NextPassAt <= after + f / 20, "the next pass is one 20/s interval away");
|
||||
RunHudPasses(p);
|
||||
Check(Renders() == 1, "no pass before the interval");
|
||||
h.NextPassAt = 0;
|
||||
|
|
@ -1837,13 +1840,14 @@ namespace RynthLua.ScriptWindowsTests
|
|||
Check(Renders() == 3 && h.NextPassAt == due + f / 20, "interval passes keep their cadence");
|
||||
|
||||
r.Do("hud.RefreshRate = 60");
|
||||
before = System.Diagnostics.Stopwatch.GetTimestamp();
|
||||
RunHudPasses(p);
|
||||
left = h.NextPassAt - System.Diagnostics.Stopwatch.GetTimestamp();
|
||||
Check(Renders() == 4 && left > 0 && left <= f / 60, "a new RefreshRate starts at once, 60/s");
|
||||
after = System.Diagnostics.Stopwatch.GetTimestamp();
|
||||
Check(Renders() == 4 && h.NextPassAt > before && h.NextPassAt <= after + f / 60, "a new RefreshRate starts at once, 60/s");
|
||||
r.Do("hud.RefreshRate = 1");
|
||||
before = System.Diagnostics.Stopwatch.GetTimestamp();
|
||||
RunHudPasses(p);
|
||||
left = h.NextPassAt - System.Diagnostics.Stopwatch.GetTimestamp();
|
||||
Check(Renders() == 5 && left > f / 2, "1/s");
|
||||
Check(Renders() == 5 && h.NextPassAt - before > f / 2, "1/s");
|
||||
|
||||
// Input: a pass on the next tick whatever the rate.
|
||||
ApplyHudEvents(p, Ev(HudFormat.EvClicked, 1, h.Hash, Fnv("B", h.Hash), 1, 0));
|
||||
|
|
|
|||
Loading…
Reference in a new issue