From 3a97fce6d06dea35211191237a6ad3c2d41e5d31 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Wed, 26 Jun 2019 19:44:31 +0200 Subject: grid: attributes now track whether we've set a foreground/background color This means we don't have to explicitly set the foreground/background to the grid's default colors whenever we reset/clear a cell, and we can instead simply memset() the entire cell to 0. This also means the renderer has to get the default color when rendering a cell without a foreground/background color set. --- terminal.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 08a0e538..3eb8abce 100644 --- a/terminal.h +++ b/terminal.h @@ -19,8 +19,10 @@ struct attributes { bool blink; bool conceal; bool reverse; - uint32_t foreground; - uint32_t background; + bool have_foreground; + bool have_background; + uint32_t foreground; /* Only valid when have_foreground == true */ + uint32_t background; /* Only valid when have_background == true */ }; struct cell { -- cgit v1.3