From 2978a5194dd77e0388bd9101176f0c108e86e5d9 Mon Sep 17 00:00:00 2001 From: nick black Date: Sun, 25 Apr 2021 03:29:34 -0400 Subject: [PATCH] textplay: better colorization --- src/poc/textplay.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/poc/textplay.c b/src/poc/textplay.c index a6494dd02..bd90dae26 100644 --- a/src/poc/textplay.c +++ b/src/poc/textplay.c @@ -3,7 +3,7 @@ static const uint32_t LOWCOLOR = 0x004080; static const uint32_t HICOLOR = 0x00ff80; -static const uint32_t NANOSEC = 1000000000ull / 600; // 600 cps +static const uint32_t NANOSEC = 1000000000ull / 60; // 60 cps #define MARGIN 4 static struct notcurses* @@ -31,6 +31,11 @@ colorize(struct ncplane* n){ if(egc == NULL){ return -1; } + if(strcmp(egc, "") == 0){ + free(egc); + --x; + continue; + } ncplane_set_fg_rgb(n, c); if(ncplane_putegc_yx(n, y, x, egc, NULL) < 0){ free(egc);