demo changes

* Tighten up the HUD, now only as large as it needs be
* Show another digit on timer (milliseconds)
* Move allgraph towards the back
pull/893/head
nick black 4 years ago committed by Nick Black
parent 2add9bacd6
commit 935ae0378b

@ -74,7 +74,7 @@ At any time, press 'q' to quit. The demo is best run in at least an 80x45 termin
**-V**: Print the program name and version, and exit with success.
demospec: Select which demos to run, and what order to run them in. The
default is **ixezaydthnbcmgrwuvlsfjqo**. See above for a list of demos.
default is **ixezydthnbcmgarwuvlsfjqo**. See above for a list of demos.
Default margins are all 0, and thus the full screen will be rendered. Using
**-m**, margins can be supplied. Provide a single number to set all four margins

@ -20,7 +20,7 @@ static int democount;
static demoresult* results;
static char *datadir = NOTCURSES_SHARE;
static const char DEFAULT_DEMO[] = "ixezaydthnbcmgrwuvlsfjqo";
static const char DEFAULT_DEMO[] = "ixezydthnbcmgarwuvlsfjqo";
atomic_bool interrupted = ATOMIC_VAR_INIT(false);
// checked following demos, whether aborted, failed, or otherwise

@ -28,7 +28,7 @@ static int plot_pos_y;
// how many columns for runtime?
#define HUD_ROWS (3 + 2) // 2 for borders
static const int HUD_COLS = 30 + 2; // 2 for borders
static const int HUD_COLS = 24 + 2; // 2 for borders
typedef struct elem {
char* name;
@ -304,11 +304,11 @@ hud_print_finished(elem* list){
if(ncplane_printf_yx(hud, line, 1, "%d", e->frames) < 0){
return -1;
}
if(ncplane_printf_yx(hud, line, 7, "%ju.%02jus", e->totalns / GIG,
(e->totalns % GIG) / (GIG / 100)) < 0){
if(ncplane_printf_yx(hud, line, 7, "%ju.%03jus", e->totalns / GIG,
(e->totalns % GIG) / 1000000) < 0){
return -1;
}
if(ncplane_putstr_yx(hud, line, 18, e->name) < 0){
if(ncplane_putstr_yx(hud, line, 16, e->name) < 0){
return -1;
}
}
@ -504,11 +504,11 @@ int demo_render(struct notcurses* nc){
if(ncplane_printf_yx(hud, 1, 1, "%d", elems->frames) < 0){
return -1;
}
if(ncplane_printf_yx(hud, 1, 7, "%ju.%02jus",
ns / GIG, (ns % GIG) / (GIG / 100)) < 0){
if(ncplane_printf_yx(hud, 1, 7, "%ju.%03jus", ns / GIG,
(ns % GIG) / 1000000) < 0){
return -1;
}
if(ncplane_putstr_yx(hud, 1, 18, elems->name) < 0){
if(ncplane_putstr_yx(hud, 1, 16, elems->name) < 0){
return -1;
}
}

Loading…
Cancel
Save