diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 14:36:54 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 14:53:45 -0300 |
| commit | b5bb5e8ccf71a5755dde95f04440ee9c6aaa18da (patch) | |
| tree | 801403ea35508b571b34b0a750faed47be102f3d /addons/life/life.zig | |
| parent | 333cdea69956adda91f462980a18f5bac6548dda (diff) | |
| download | pardes-b5bb5e8ccf71a5755dde95f04440ee9c6aaa18da.tar.gz pardes-b5bb5e8ccf71a5755dde95f04440ee9c6aaa18da.zip | |
kinds #28, the Life dogfood's fixes: Deadline.every steps a period from when it was due while that is under a period behind and re-arms a period from now when it is further behind or more than one ahead (a restored record's), which Life's catch-up and guard lines were and snake's 150 ms now keep without drift; the tick after a key or a focus is told the clock's now, not the last stepped frame's, which lags it while the next wake is to come (the core's, Kind.step: Life's resume no longer jumps four generations); ops refuses at compile time a word that opens no pane, there being no ctl, and its doc names the functions it handles; reference.typ says how a script's key, tick and size work and that a pane a dump loads is a new pane with a new seed, as the header now does
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'addons/life/life.zig')
| -rw-r--r-- | addons/life/life.zig | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/addons/life/life.zig b/addons/life/life.zig index 5ea9c302..2ef26c56 100644 --- a/addons/life/life.zig +++ b/addons/life/life.zig @@ -29,13 +29,8 @@ const Life = extern struct { pub fn tick(s: *Life, now: u64, flags: addon.Flags) u64 { if (!flags.focused or s.paused) return s.next.stop(); - // A record's deadline is of another clock's origin. - if (s.next.at > now + period) s.next.at = 0; - if (!s.next.due(now)) return s.next.every(now, period); - s.step(); - // From the step's due time, not now: a tick comes on a frame, late. - s.next.at = if (now - s.next.at < period) s.next.at + period else now + period; - return s.next.at; + if (s.next.due(now)) s.step(); + return s.next.every(now, period); } pub fn key(s: *Life, k: addon.Key) bool { |
