From 84d0343d88eb96419adc6a68183bbfe6ee9f96f0 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Mon, 25 Oct 2021 17:27:24 +0000 Subject: tbi/win: add macro to set a character and its attributes --- lib/tbi/win.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib/tbi') diff --git a/lib/tbi/win.c b/lib/tbi/win.c index 9129403..49ca9d7 100644 --- a/lib/tbi/win.c +++ b/lib/tbi/win.c @@ -11,6 +11,13 @@ if(x < 0 || y < 0 || x >= w->width || y >= w->height) \ return FALSE +#define SET_WINDOW_CHAR(win, col, row, character, attrib) \ + w->text[row][col] = character; \ + w->attr[row][col] = attrib + +#define SET_WINDOW_CHAR2(win, col, row, character) \ + SET_WINDOW_CHAR(win, col, row, character, win->cur_attr) + struct window *newwin(struct screen *s, INT32 ncols, INT32 nlines, INT32 begin_x, INT32 begin_y) { -- cgit v1.2.3-18-g5258