From eab50d1c040774351f332a1568fa332c377860bd Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Thu, 12 Nov 2026 11:32:59 -0300 Subject: canim: the introduction as one video, with a chapter on registers From the user. One scene, intro, in four chapters: memory, registers, the stack, code and meaning (210 s). The registers chapter builds the panel before the stack needs it: sixteen rows with their chains, rip pinned on the code band and rsp and rbp on the stack's, rdi opened into its parts as mov edi changes one byte, a call to malloc stepped over with its result in rax, the registers a scene never changes folded. The chapters join at seams that say their title and keep it as the clock's label; one recording (from push(9), no agent, the heap from --heap) and one clock. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa --- anim/src/map.zig | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'anim/src/map.zig') diff --git a/anim/src/map.zig b/anim/src/map.zig index eaec991..2a2077a 100644 --- a/anim/src/map.zig +++ b/anim/src/map.zig @@ -1133,6 +1133,19 @@ fn spanOf2(maybe: ?Window, col: *const Column) ?[2]f32 { /// The map whose columns the strips are (`context` sets it). /// shortcut: process-wide, as the drawing flags are: one scene drawn at a time. pub var current: ?*const Map = null; +/// Every context's map (a scene in chapters has one a context, `context`): a +/// pane's strip is drawn from its own context's, the one whose working +/// frame has the pane's box; `current` where none has. +pub var maps: [8]?*const Map = @splat(null); +pub var maps_frame: u64 = std.math.maxInt(u64); + +fn ownMap(panel: Panel, at: anim.Placed, box: Rect) ?*const Map { + for (maps) |maybe| if (maybe) |m| { + const b = m.frame.box(at, @enumFromInt(@intFromEnum(panel))); + if (@abs(b.x - box.x) < 0.5 and @abs(b.y - box.y) < 0.5 and @abs(b.w - box.w) < 0.5 and @abs(b.h - box.h) < 0.5) return m; + }; + return current; +} /// A mark no working window shows, `flash`ing on its pane's strip. const Flash = struct { panel: Panel, key: u64, ink: u24, p: f32 }; @@ -1220,7 +1233,7 @@ fn stripRect(box: Rect) Rect { /// pane fading through passes its faded one); drawn last, over its rows. pub fn strip(panel: Panel, u: ui.Ui, box: Rect) void { if (ui.mapping) return; - const m = current orelse return; + const m = ownMap(panel, u.at, box) orelse return; const f = u.f; if (looking(f)) return; const slot = slotOf(panel) orelse return; -- cgit v1.3