summaryrefslogtreecommitdiff
path: root/src/surface.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-09-28 12:57:47 -0300
committerGabriel Schneider <[email protected]>2026-10-01 00:12:14 -0300
commit30c2c8a154e770b3920bcfd7d553825fe9182bf4 (patch)
treeecdce274f1cb25095c72f4da62b7c35e23aee04c /src/surface.zig
parent8f31fc6bfaae2d29b2bb5cc2149fcd7033cd9724 (diff)
downloadpardes-30c2c8a154e770b3920bcfd7d553825fe9182bf4.tar.gz
pardes-30c2c8a154e770b3920bcfd7d553825fe9182bf4.zip
Move the frame into draw.zig and the transitions out of layout.zig
Pure moves, no behaviour change. draw.zig holds the whole core frame in order: render, the pane, tag, header and notice painters it calls, and the character-effect composition (Pardes.render stays a declaration alias). Presentation.zig is the panel presentation state as a file struct, and animation.zig the easing curves, transition kinds, tracks and boxes, the character effects' sources and the generic displayed-value transition, all of which lived in layout.zig. layout.zig keeps only layout.
Diffstat (limited to 'src/surface.zig')
-rw-r--r--src/surface.zig7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/surface.zig b/src/surface.zig
index a9e69cca..eef787b4 100644
--- a/src/surface.zig
+++ b/src/surface.zig
@@ -3,6 +3,7 @@
const pardes = @import("pardes.zig");
const std = @import("std");
const layout = @import("layout.zig");
+const animation = @import("animation.zig");
const uucode = @import("uucode");
const vaxis = @import("vaxis");
const panes = @import("panes.zig");
@@ -70,7 +71,7 @@ pub const AsciiDiff = struct {
/// Long printable-byte walks complete in about the same time as the other
/// panel effects. Extra distance is crossed by eased character skips.
- pub const max_movement_frames = layout.ascii_max_movement_frames;
+ pub const max_movement_frames = animation.ascii_max_movement_frames;
pub fn between(old: *const Cell, new: *const Cell) ?AsciiDiff {
const from = old.printableAscii() orelse return null;
@@ -341,7 +342,7 @@ pub const Surface = struct {
cursor: ?struct { x: u16, y: u16, bar: bool = false } = null,
images: []?ImagePlace = &.{},
nimages: usize = 0,
- panel_tracks: [MAX_PANES * 2]layout.Track = undefined,
+ panel_tracks: [MAX_PANES * 2]animation.Track = undefined,
npanel_tracks: usize = 0,
previous_cells: []const Cell = &.{},
previous_body_layers: []const BodyLayer = &.{},
@@ -356,7 +357,7 @@ pub const Surface = struct {
return &s.body_layers;
}
- pub fn panelTracks(s: *const Surface) []const layout.Track {
+ pub fn panelTracks(s: *const Surface) []const animation.Track {
return s.panel_tracks[0..s.npanel_tracks];
}