diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-10 23:36:18 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-10 23:55:42 -0300 |
| commit | 81d97a9e38c740a96af13a8a981878947a508bc0 (patch) | |
| tree | bbe53f2f4c195f378a5a8cb67dfac1277ac68c82 /anim/src/root.zig | |
| parent | 2a46b60e1d115ff5149a112bc0f800467c0efaee (diff) | |
| download | computeranim-81d97a9e38c740a96af13a8a981878947a508bc0.tar.gz computeranim-81d97a9e38c740a96af13a8a981878947a508bc0.zip | |
canim: quieter marks, the stack's roles, the loupe, arcs, the minimap, the map and the dive
From the user's notes on the second videos. The current row is a white
wash, a strike a softened vermilion, held a turned corner. A stack row
has its offset from rsp and its role from the tracer (a saved register,
a local by name, argc and argv). The loupe is the telescope as a floating
panel: the memory round what a pointer leads to, a pointer inside it
opening the next. A pointer to a row of its own panel is an arc in a
lane, in dumps, loupes and the stack. Every scene has the minimap; the
map is the same moment with every panel at full length on 3840 by 2160,
and the list opens on it and dives to the working frame, each panel
travelling to its place. Recordings hold more round each stop.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'anim/src/root.zig')
| -rw-r--r-- | anim/src/root.zig | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/anim/src/root.zig b/anim/src/root.zig index d68b99c..d8c2c76 100644 --- a/anim/src/root.zig +++ b/anim/src/root.zig @@ -44,6 +44,7 @@ const tying = @import("ties.zig"); pub const Ties = tying.Ties; pub const Place = tying.Place; pub const Array = @import("array.zig").Array; +pub const Loupe = @import("loupe.zig").Loupe; pub const syscalls = @import("syscalls.zig"); pub const Crossing = syscalls.Crossing; pub const Timeline = syscalls.Timeline; @@ -206,8 +207,13 @@ pub const Camera = struct { /// the program column (the whole source in a window, the disassembly at /// the pc), the ties between them, and the clock. A scene adds its lens in /// the band (`stage`): a lens is never shown instead of the machine. +pub const map = @import("map.zig"); + pub const Context = struct { stage: *Stage, + /// The working frame unfolded (`map.Map`): its panels, on a stage of its + /// own; drawn small as the minimap. A lens adds its drawing with `map.add`. + map: *map.Map, clock: anim.Obj, source: anim.Obj, disasm: anim.Obj, @@ -259,8 +265,17 @@ pub fn context(s: *anim.Frame, cursor_: Cursor, options: Context.Options) Contex const stage = Stage.init(s, options.split); var at = cursor_; at.levels.crossings = options.syscalls; + // The map first: while it fills the frame or falls to the minimap it is under the panels diving out of it. + const whole = s.new(map.Map{ .stage = Stage.init(s, map.split(at.rec, options.split.band.h > 0)), .frame = stage, .t = s.value(map.diving.land + map.diving.still) }); + whole.obj = s.custom(whole, .{ .x = -640, .y = -360, .scale = ui.scale }); + whole.add(s, Source{ .cursor = at, .stage = whole.stage }); + whole.add(s, Disasm{ .cursor = at, .stage = whole.stage }); + whole.add(s, Registers{ .cursor = at, .stage = whole.stage, .syscalls = options.syscalls, .quiet = options.quiet }); + whole.add(s, Stack{ .cursor = at, .stage = whole.stage, .above = theme.map.stack_above }); + whole.add(s, Backtrace{ .cursor = at, .stage = whole.stage }); return .{ .stage = stage, + .map = whole, .cursor = at, .quiet = options.quiet, .source = add(s, Source{ .cursor = at, .stage = stage }), @@ -268,7 +283,7 @@ pub fn context(s: *anim.Frame, cursor_: Cursor, options: Context.Options) Contex .registers = add(s, Registers{ .cursor = at, .stage = stage, .syscalls = options.syscalls, .quiet = options.quiet }), .stack = add(s, Stack{ .cursor = at, .stage = stage }), .backtrace = add(s, Backtrace{ .cursor = at, .stage = stage, .lens = options.backtrace }), - .clock = add(s, Clock{ .cursor = at }), + .clock = add(s, Clock{ .cursor = at, .map = whole }), }; } @@ -295,6 +310,17 @@ pub fn crossing(s: *anim.Frame, options: Crossing) anim.Obj { pub fn timeline(s: *anim.Frame, options: Timeline) anim.Obj { return add(s, options); } +/// A `loupe`, shut until its `open`: add it after the panels and the lens, +/// a deeper one after the loupe it hangs from, and the ties after them. +pub fn loupe(s: *anim.Frame, options: Loupe) *Loupe { + var l = options; + l.opening = s.value(0); + l.closing = s.value(0); + const made = s.new(l); + const o = s.custom(made, .{ .x = -640, .y = -360, .scale = ui.scale }); + s.play(.{o.fadeIn()}, .{ .seconds = 0 }); + return made; +} pub fn caption(s: *anim.Frame, text: []const u8) anim.Obj { return add(s, Caption{ .text = text }); } @@ -323,6 +349,8 @@ test { _ = calls; _ = @import("nodes.zig"); _ = @import("array.zig"); + _ = @import("loupe.zig"); + _ = map; _ = @import("syscalls.zig"); _ = objects; _ = words; |
