From ec5c1ad9f16772434f0f49811c87ec58a3569e83 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sun, 23 Apr 2023 18:48:32 +0200 Subject: Add conditional redrawing This covers most of the previous functionality, but separating the input handling and rendering functions. Only cursor drawing and a few corner cases missing. --- src/drawing.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/drawing.c') diff --git a/src/drawing.c b/src/drawing.c index b790595..89d3ef6 100644 --- a/src/drawing.c +++ b/src/drawing.c @@ -29,7 +29,7 @@ draw_channels(void) { } u8 clr = active ? COL_FG : COL_GREY; size_t y = CHAN_START_Y + i * CHAN_OFFSET_Y; - draw_channel_sprite(CHAN_START_X, y, active, i); + draw_channel_sprite(CHAN_START_X, y, clr, i); } } @@ -175,8 +175,12 @@ draw_bank_buttons() { void draw_pattern_buttons() { + // Clear patterns. size_t x = PAT_START_X; size_t y = PAT_START_Y; + + draw_filled_rect(x, y, x + PAT_W, y + PAT_H * 8, COL_BG); + txt_drawf_small("PAT", x, y - 10, COL_FG); char pat_names[] = { 'A', 'B', 'C', 'D', @@ -190,7 +194,6 @@ draw_pattern_buttons() { if (i == next_pattern && current_pattern != next_pattern) { color = COL_BLUE; } - draw_filled_rect(x, y, x + PAT_W, y + PAT_H, COL_BG); draw_rect(x, y, x + PAT_W, y + PAT_H, color); txt_drawc(pat_names[i], x + 4, y + 2, color); y += PAT_OFFSET_Y; -- cgit v1.2.1