diff options
Diffstat (limited to 'src/image.zig')
| -rw-r--r-- | src/image.zig | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/image.zig b/src/image.zig index 80261d91..b5efc5fd 100644 --- a/src/image.zig +++ b/src/image.zig @@ -505,20 +505,14 @@ fn paint(ctx: ?*anyopaque, win: [*c]const Kind.c.pa_window, out: [*c]Kind.c.pa_p const st: *const State = @ptrCast(@alignCast(ctx orelse return)); const w = win.*; const o = &out.*; - const prefix = std.fmt.bufPrint(&o.prefix, "{s} petscii:{s} palette:{s} ascii:{s} {s}", .{ - config.tag_image, - if (w.glyphs != 0) "on" else "off", - if (w.palette == 0) "commodore" else "terminal", - if (w.ascii != 0) "on" else "off", - st.path, - }) catch &o.prefix; - o.prefix_len = @intCast(prefix.len); + // `img`, which the core follows with its art words and the path. + @memcpy(o.prefix[0..config.tag_image.len], config.tag_image); + o.prefix_len = config.tag_image.len; if (st.rgba.len == 0 or o.cap == 0) return; o.placements[0] = std.mem.zeroInit(Kind.c.pa_placement, .{ .rgba = st.rgba.ptr, .w = st.w, .h = st.h, - .stride = st.w * 4, .src = .{ .x = 0, .y = 0, .w = st.w, .h = st.h }, .dst = .{ .x = 0, .y = 0, .w = w.cols, .h = w.rows }, }); |
