chunli: finalize out

pull/265/head
nick black 5 years ago
parent 19db2a5675
commit bee5be9d80
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -57,7 +57,7 @@ At any time, press 'q' to quit. The demo is best run in at least a 80x45 termina
**-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 **ixetcgpwubvlfsjo**. See above for a list of demos.
demospec: Select which demos to run, and what order to run them in. The default is **ixetbcgpwuvlfsjo**. See above for a list of demos.
# NOTES
Proper display requires:

@ -52,10 +52,12 @@ chunli_draw(struct notcurses* nc, const char* ext, int count, const cell* b){
int chunli_demo(struct notcurses* nc){
struct timespec iterdelay;
timespec_div(&demodelay, 10, &iterdelay);
int averr;
int averr, dimx, dimy;
notcurses_resize(nc, &dimy, &dimx);
cell b = CELL_TRIVIAL_INITIALIZER;
cell_set_fg_alpha(&b, CELL_ALPHA_TRANSPARENT);
cell_set_bg_alpha(&b, CELL_ALPHA_TRANSPARENT);
chunli_draw(nc, "bmp", CHUNS, &b);
char file[PATH_MAX];
for(int i = 1 ; i < 100 ; ++i){
snprintf(file, sizeof(file), "chunli%02d.png", i);
@ -74,12 +76,16 @@ int chunli_demo(struct notcurses* nc){
if(ncvisual_render(ncv, 0, 0, 0, 0)){
return -1;
}
int thisx, thisy;
ncplane_dim_yx(ncp, &thisy, &thisx);
if(ncplane_move_yx(ncp, (dimy - thisy) / 2, (dimx - thisx) / 2)){
return -1;
}
if(demo_render(nc)){
return -1;
}
demo_nanosleep(nc, &iterdelay);
ncvisual_destroy(ncv);
}
chunli_draw(nc, "bmp", CHUNS, &b);
return 0;
}

Loading…
Cancel
Save