From c9d680901400bfa375ab25828c4dc1a0ec7188ec Mon Sep 17 00:00:00 2001 From: nick black Date: Thu, 12 Nov 2020 13:41:10 -0500 Subject: [PATCH] view: replay current media on blitter change #1111 --- src/demo/hud.c | 1 + src/view/view.cpp | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/demo/hud.c b/src/demo/hud.c index 2df32eaec..c9265e3bb 100644 --- a/src/demo/hud.c +++ b/src/demo/hud.c @@ -633,6 +633,7 @@ int fpsgraph_init(struct notcurses* nc){ memset(&opts, 0, sizeof(opts)); opts.flags = NCPLOT_OPTION_LABELTICKSD | NCPLOT_OPTION_EXPONENTIALD; opts.legendstyle = NCSTYLE_ITALIC; + opts.gridtype = NCBLIT_3x2; opts.title = "frames per second"; channels_set_fg_rgb8(&opts.minchannels, 0x80, 0x80, 0xff); channels_set_bg_rgb(&opts.minchannels, 0x201020); diff --git a/src/view/view.cpp b/src/view/view.cpp index e58f4fbc1..e83334f8c 100644 --- a/src/view/view.cpp +++ b/src/view/view.cpp @@ -304,7 +304,7 @@ auto main(int argc, char** argv) -> int { if(r == 0){ vopts.blitter = marsh.blitter; if(!loop){ - stdn->printf(0, NCAlign::Center, "press any key to advance"); + stdn->printf(0, NCAlign::Center, "press key to advance"); if(!nc.render()){ failed = true; break; @@ -314,10 +314,10 @@ auto main(int argc, char** argv) -> int { failed = true; break; }else if(ie == 'q'){ - break; + goto done; }else if(ie >= '0' && ie <= '8'){ --i; // rerun same input with the new blitter - vopts.blitter = static_cast(ie - '0'); + vopts.blitter = blitter = static_cast(ie - '0'); }else if(ie == NCKey::Resize){ --i; // rerun with the new size if(!nc.refresh(&dimy, &dimx)){ @@ -337,6 +337,7 @@ auto main(int argc, char** argv) -> int { } } } +done: if(!nc.stop()){ return EXIT_FAILURE; }