summaryrefslogtreecommitdiff
path: root/anim/src/nodes.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-11 06:49:10 -0300
committerGabriel Schneider <[email protected]>2026-11-11 06:50:11 -0300
commit378379807fb4cd751e90808c8363caddb365bcd8 (patch)
treef84c7d0e7cbd42a9b9c93e791ab2b5376499d23d /anim/src/nodes.zig
parent5922ee911b9a6604f60dc83be36ba9e6c9abac98 (diff)
downloadcomputeranim-378379807fb4cd751e90808c8363caddb365bcd8.tar.gz
computeranim-378379807fb4cd751e90808c8363caddb365bcd8.zip
canim: nothing changes in one frame; the map's space is used; the heap scene at its storyboard's length
The motion check counts a third of the one-frame changes it did: the minimap's changes fade, and a register's value, a flag, a role, a pin's names, a tag's note, a backtrace row, a call tree's node and a dump row crossfade where they changed at once. What still fires is named in the README; an encoder's keyframe and the gallery's cuts are exempt by name. No caption stands over twelve seconds or under its reading time. The heap scene is 78 s: what the storyboard does not narrate runs, and each free's line cascades onto its call row (line stepping stops at a breakpoint for that). On the map, leftover space holds the stack continued, dumps round what the registers and the stack point at, open loupes and the key: between 1% and 13% of a map is page, where it was 14% to 42%. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/nodes.zig')
-rw-r--r--anim/src/nodes.zig18
1 files changed, 13 insertions, 5 deletions
diff --git a/anim/src/nodes.zig b/anim/src/nodes.zig
index 81a9953..7c842d3 100644
--- a/anim/src/nodes.zig
+++ b/anim/src/nodes.zig
@@ -77,7 +77,7 @@ pub const Nodes = struct {
const shown = @min(count, (hi - first) / 16);
const v = hexdump.panel(f, placed, g.stage, u.print("the heap, {x} to {x}", .{ first, first + 16 * shown - 1 }), &legend);
if (v.rows > 0) hexdump.draw(v.u, now, 0, m.tag + m.pad, first, @min(shown, v.rows), .{ .things = things });
- if (v.rows > 0) @import("map.zig").window(.view, first, first + 16 * (@min(shown, v.rows) -| 1));
+ if (v.rows > 0) @import("map.zig").window(.view, .{ first, first + 16 * (@min(shown, v.rows) -| 1) }, .{ first, first + 16 * (@min(shown, v.rows) -| 1) }, 1);
v.veil(now);
u.clip(.{ .x = 0, .y = 0, .w = box.w, .h = box.h });
}
@@ -221,7 +221,10 @@ pub const Nodes = struct {
const names = g.pins(u, now, o.addr);
const cx = r.x + r.w / 2;
ties.anchor(u, .{ .node_pin = o.addr }, .{ .x = cx - 1, .y = r.y + r.h, .w = 2, .h = label + 10 });
- if (names.names.len > 0 and names.shows > 0) u.faded(names.shows).pinUnderInked(cx, r.y + r.h, names.names, names.inks, heap, label);
+ if (names.names.len > 0 and names.shows > 0) {
+ u.faded(names.shows).pinUnderInked(cx, r.y + r.h, &.{}, &.{}, heap, label);
+ u.faded(names.shows * names.text).pinNames(cx, r.y + r.h, names.names, names.inks, label);
+ }
}
/// Where variable `name`'s tag is: it travels from node to node in the
@@ -279,7 +282,10 @@ pub const Nodes = struct {
}
}
- const Pins = struct { names: []const []const u8, inks: []const u24, shows: f32 };
+ /// `text`: how much its names show: a register joining or leaving
+ /// crosses the middle of its change with them faded out, so the names
+ /// it leaves and those it gets never swap in a frame.
+ const Pins = struct { names: []const []const u8, inks: []const u24, shows: f32, text: f32 = 1 };
/// The registers that hold `addr` (before this step, and after it once
/// their link has landed), then the scene's variables that do.
@@ -288,6 +294,7 @@ pub const Nodes = struct {
var out: std.ArrayList([]const u8) = .empty;
var inks: std.ArrayList(u24) = .empty;
var shows: f32 = 0;
+ var text: f32 = 1;
const is = (now.moment().regs(rec.tid) catch null) orelse zt.Regs{};
const was = (now.before().regs(rec.tid) catch null) orelse is;
// The scene's variables first: what the narration names, in the ink
@@ -309,6 +316,7 @@ pub const Nodes = struct {
if (!before and !after) continue;
const s = ties.pinShows(now, i, .node);
const this = if (before and after) 1 else if (after) s.new else s.old;
+ if (before != after) text = @min(text, @abs(2 * this - 1));
if (this < 0.5) continue;
out.append(u.f.scratch, name) catch break;
inks.append(u.f.scratch, t.primary) catch break;
@@ -317,7 +325,7 @@ pub const Nodes = struct {
// Names keep their side: the first to come is on the left, the next
// on the right, and a name that lands where another is stays on the
// right it travelled on; one left alone where it was on the right stays there.
- const came = u.f.scratch.alloc(u64, out.items.len) catch return .{ .names = out.items, .inks = inks.items, .shows = shows };
+ const came = u.f.scratch.alloc(u64, out.items.len) catch return .{ .names = out.items, .inks = inks.items, .shows = shows, .text = text };
for (out.items, came) |name, *at| at.* = g.arrival(u, now, name, addr);
for (1..@max(out.items.len, 1)) |i| {
var k = i;
@@ -345,7 +353,7 @@ pub const Nodes = struct {
inks.insert(u.f.scratch, 0, t.primary) catch {};
}
}
- return .{ .names = out.items, .inks = inks.items, .shows = shows };
+ return .{ .names = out.items, .inks = inks.items, .shows = shows, .text = text };
}
/// When `name` came to point at `addr`: the moment its value last