demo: reset standard plane base char for each demo #675

This commit is contained in:
nick black 2020-06-05 01:12:48 -04:00
parent deb3c8bfcb
commit e268301a42
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -148,6 +148,7 @@ ext_demos(struct notcurses* nc, const char* spec, bool ignore_failures){
for(size_t i = 0 ; i < strlen(spec) ; ++i){
results[i].selector = spec[i];
}
struct ncplane* n = notcurses_stdplane(nc);
for(size_t i = 0 ; i < strlen(spec) ; ++i){
if(interrupted){
break;
@ -158,6 +159,15 @@ ext_demos(struct notcurses* nc, const char* spec, bool ignore_failures){
continue;
}
#endif
// set the standard plane's base character to an opaque black, but don't
// erase the plane (we let one demo bleed through to the next, an effect
// we exploit in a few transitions).
cell c = CELL_TRIVIAL_INITIALIZER;
cell_set_fg_rgb(&c, 0, 0, 0);
cell_set_bg_rgb(&c, 0, 0, 0);
ncplane_set_base_cell(n, &c);
cell_release(n, &c);
hud_schedule(demos[idx].name);
ret = demos[idx].fxn(nc);
notcurses_reset_stats(nc, &results[i].stats);