From 85ef9df586dfca22d16d04c9777dc38ff896223a Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 30 Jul 2019 18:03:03 +0200 Subject: render: add a 'clean' bit to each cell; only render cells that aren't clean This patch takes a bit from the foreground color value in a cell (todo: split up foreground/background into bitfields with a separate field for 'foreground/background' has been set), and only re-renders cells that aren't marked as clean. Note: we use a 'clean' bit rather than a 'dirty' bit to make it easy to erase cells - we can (keep doing) do that by simply memsetting a cell range to 0. --- main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 0368c687..bdb1de3e 100644 --- a/main.c +++ b/main.c @@ -831,9 +831,11 @@ main(int argc, char *const *argv) for (int r = 0; r < term.rows; r++) { struct row *row = grid_row_in_view(term.grid, r); for (int col = 0; col < term.cols; col++) { - if (row->cells[col].attrs.blink) { + struct cell *cell = &row->cells[col]; + + if (cell->attrs.blink) { + cell->attrs.clean = 0; row->dirty = true; - break; } } } -- cgit v1.3