From 5fb40899e5c6ed839302b93f965e04d77a03945a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lucas?= Date: Fri, 25 Jul 2025 01:33:57 -0300 Subject: [PATCH] refactor: remove termbox_extras in favor of the fork --- src/tui/TerminalBuffer.zig | 5 ++--- src/tui/termbox_extras.zig | 26 -------------------------- 2 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 src/tui/termbox_extras.zig diff --git a/src/tui/TerminalBuffer.zig b/src/tui/TerminalBuffer.zig index 86240b9..555f26b 100644 --- a/src/tui/TerminalBuffer.zig +++ b/src/tui/TerminalBuffer.zig @@ -2,7 +2,6 @@ const std = @import("std"); const builtin = @import("builtin"); const interop = @import("../interop.zig"); const Cell = @import("Cell.zig"); -const termbox_extras = @import("termbox_extras.zig"); const Random = std.Random; @@ -114,8 +113,8 @@ pub fn cascade(self: TerminalBuffer) bool { var cell: termbox.tb_cell = undefined; var cell_under: termbox.tb_cell = undefined; - _ = termbox_extras.tb_get_cell(@intCast(x), @intCast(y - 1), 1, &cell); - _ = termbox_extras.tb_get_cell(@intCast(x), @intCast(y), 1, &cell_under); + _ = termbox.tb_get_cell(@intCast(x), @intCast(y - 1), 1, &cell); + _ = termbox.tb_get_cell(@intCast(x), @intCast(y), 1, &cell_under); const char: u8 = @truncate(cell.ch); if (std.ascii.isWhitespace(char)) continue; diff --git a/src/tui/termbox_extras.zig b/src/tui/termbox_extras.zig deleted file mode 100644 index 314a1d8..0000000 --- a/src/tui/termbox_extras.zig +++ /dev/null @@ -1,26 +0,0 @@ -const std = @import("std"); -const interop = @import("../interop.zig"); -const termbox = interop.termbox; - -pub fn tb_get_cell(x: c_int, y: c_int, back: c_int, cell: *termbox.tb_cell) c_int { - if (back == 0) { - return termbox.TB_ERR; - } - - const width = termbox.tb_width(); - const height = termbox.tb_height(); - - if (x < 0 or x >= width or y < 0 or y >= height) { - return termbox.TB_ERR_OUT_OF_BOUNDS; - } - - const buffer = termbox.tb_cell_buffer(); - if (buffer == null) { - return termbox.TB_ERR_NOT_INIT; - } - - const index = y * width + x; - cell.* = buffer[@intCast(index)]; - - return termbox.TB_OK; -}