diff options
Diffstat (limited to 'anim/scenes/heap.zig')
| -rw-r--r-- | anim/scenes/heap.zig | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/anim/scenes/heap.zig b/anim/scenes/heap.zig index 6e521d0..07eccea 100644 --- a/anim/scenes/heap.zig +++ b/anim/scenes/heap.zig @@ -176,7 +176,10 @@ const Lists = struct { const changed = counts[0] == null or !real[0] or counts[0].? != counts[1].?; const comes = !real[0] or counts[0] == null; const bv = v.faded(if (comes) after(now, 42, 6) else 1); - const heat = if (changed and now.walking()) now.heat(0, null, now.since(.idea, 0) - 60.0 / 60.0) else if (changed) canim.ui.Heat.ember else canim.ui.Heat.none; + // Changed in the step before: its mark leaves as any does (with a run's ease, or its embers' steps), never in a frame. + const before = if (heapAt(a, rec, now.stops[2])) |hp| holds(hp) else null; + const changed_before = now.stops[2] != now.stops[1] and real[0] and counts[0] != null and before != counts[0]; + const heat = if (changed and now.walking()) now.heat(0, null, now.since(.idea, 0) - 60.0 / 60.0) else if (changed) canim.ui.Heat.ember else if (changed_before) now.heat(1, null, std.math.inf(f32)) else canim.ui.Heat.none; bv.fill(badge, theme.color.page); const ink = bv.cellWritten(badge, heat, theme.color.page); // Framed, but while the strike's paper is on it. @@ -199,7 +202,15 @@ const Lists = struct { const sx = top_r.x + top_r.w - 16 - tv.width(.mono, theme.size.mono.context, size_text); tv.text(.mono, theme.size.mono.context, top_r.x + 16, theme.baseline(top_r.y, h, theme.size.mono.context), "top", t.dim); var ink: canim.ui.Ink = .{ .ink = ui.rgb(t.dim) }; - if (side == 1 and moved and tops[0] != null and now.walking()) ink = tv.cellWritten(.{ .x = sx - 4, .y = top_r.y + 10, .w = tv.width(.mono, theme.size.mono.context, size_text) + 8, .h = 24 }, now.heat(0, null, now.since(.idea, 0) - 12.0 / 60.0), null); + const cell: canim.Rect = .{ .x = sx - 4, .y = top_r.y + 10, .w = tv.width(.mono, theme.size.mono.context, size_text) + 8, .h = 24 }; + if (side == 1 and moved and tops[0] != null) ink = tv.cellWritten(cell, if (now.resting() and now.gaits[0] == .walk) canim.ui.Heat.ember else now.heat(0, null, now.since(.idea, 0) - 12.0 / 60.0), null) else if (side == 1 and !moved and now.stops[2] != now.stops[1] and now.gaits[1] == .walk) { + // Moved in the step before: its mark leaves as any does, never in a frame. + const old = heapAt(a, rec, now.stops[2]); + const was = if (old) |hp| (if (hp.chunks.len > 0) hp.chunks[hp.chunks.len - 1] else null) else null; + if (was) |top_was| if (top_was.addr != top.addr or top_was.size() != top.size()) { + ink = tv.cellWritten(cell, now.heat(1, null, std.math.inf(f32)), null); + }; + } tv.text(ink.face, theme.size.mono.context, sx, theme.baseline(top_r.y, h, theme.size.mono.context), size_text, ink.ink); _ = tv.address(top_r.x + 16, top_r.y - 8, top.addr, .{ .ink = ui.rgb(theme.color.region.heap) }); }; |
