summaryrefslogtreecommitdiff
path: root/core/term/TerminalImages.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/term/TerminalImages.zig')
-rw-r--r--core/term/TerminalImages.zig9
1 files changed, 4 insertions, 5 deletions
diff --git a/core/term/TerminalImages.zig b/core/term/TerminalImages.zig
index feba5ddc..d0d364a1 100644
--- a/core/term/TerminalImages.zig
+++ b/core/term/TerminalImages.zig
@@ -24,9 +24,6 @@ const image_decode_pixels: usize = 64 * 1024 * 1024;
/// oldest past this): a 4K picture in RGBA, with room for a second.
pub const storage_limit = 64 * 1024 * 1024;
-/// This pane asks for its images as glyph art even where pixels could be
-/// drawn (the Petscii builtin).
-petscii: bool = false,
/// Pixels in RGBA for images ghostty-vt holds in another format (RGB,
/// grey): only for images on screen, dropped the frame they are not.
/// The emulator's own allocator's, as the emulator is (`draw`'s `own`):
@@ -191,7 +188,7 @@ pub fn draw(
const bottom = pages.getBottomRight(.viewport) orelse return;
const cw: u32 = @max(1, where.cell_w);
const ch: u32 = @max(1, where.cell_h);
- const ctx: Ctx = .{ .ti = ti, .own = own, .gpa = gpa, .out = out, .pane = where.pane, .serial = where.serial, .tx = where.tx, .body_y = where.body_y, .cols = where.cols, .rows_of = rows_of, .cw = cw, .ch = ch };
+ const ctx: Ctx = .{ .ti = ti, .own = own, .gpa = gpa, .out = out, .pane = where.pane, .serial = where.serial, .tx = where.tx, .body_y = where.body_y, .cols = where.cols, .rows_of = rows_of, .cw = cw, .ch = ch, .glyph = where.petscii };
// Handed on lowest z first (the storage's order is a hash map's), the
// order a shell draws them in; equal z keeps the order they came in.
const first = out.items.len;
@@ -283,6 +280,8 @@ const Ctx = struct {
rows_of: []const ?u16,
cw: u32,
ch: u32,
+ /// Its images as glyph art (the pane's Petscii).
+ glyph: bool,
/// Draw `src` of `img` over `dst`, one cell row of it at a time: a row
/// is shown, or not, or shown elsewhere, as the body lays it out.
@@ -323,7 +322,7 @@ const Ctx = struct {
},
.key = plain.Placement.keyOf(ctx.serial, img.id, @truncate(img.generation)),
.z = z,
- .art = .{ .glyph = ctx.ti.petscii },
+ .art = .{ .glyph = ctx.glyph },
}) catch {};
}
}