revert early-morning idiocy #866

pull/873/head
nick black 4 years ago
parent 4232ca1427
commit 2f3fba59c8
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -19,11 +19,6 @@ int main(int argc, char** argv){
if(nc == NULL){ if(nc == NULL){
return EXIT_FAILURE; return EXIT_FAILURE;
} }
nc_err_e err;
struct ncvisual* ncv = ncvisual_from_file(fname, &err);
if(ncv == NULL){
goto err;
}
struct ncplane* std = notcurses_stdplane(nc); struct ncplane* std = notcurses_stdplane(nc);
// FIXME not all work yet; this subset does // FIXME not all work yet; this subset does
const int blitters[] = { const int blitters[] = {
@ -43,28 +38,35 @@ int main(int argc, char** argv){
for(int i = 1 ; i < argc ; ++i){ for(int i = 1 ; i < argc ; ++i){
ncplane_erase(std); ncplane_erase(std);
const char* fname = argv[i]; const char* fname = argv[i];
nc_err_e err;
struct ncvisual* ncv = ncvisual_from_file(fname, &err);
if(ncv == NULL){
goto err;
}
notcurses_render(nc);
struct ncvisual_options vopts = { struct ncvisual_options vopts = {
.n = std, .n = std,
.scaling = scaling, .scaling = scaling,
.blitter = *blitter, .blitter = *blitter,
}; };
if(!ncvisual_render(nc, ncv, &vopts)){ if(!ncvisual_render(nc, ncv, &vopts)){
ncvisual_destroy(ncv);
goto err; goto err;
} }
if(notcurses_render(nc)){ notcurses_render(nc);
goto err; struct timespec ts = {
} .tv_sec = 0,
struct timespec ts = { .tv_sec = 0, .tv_nsec = 500000000, }; .tv_nsec = 500000000,
};
clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL); clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, NULL);
ncvisual_destroy(ncv);
} }
} }
} }
ncvisual_destroy(ncv);
notcurses_stop(nc); notcurses_stop(nc);
return EXIT_SUCCESS; return EXIT_SUCCESS;
err: err:
ncvisual_destroy(ncv);
notcurses_stop(nc); notcurses_stop(nc);
return EXIT_FAILURE; return EXIT_FAILURE;
} }

Loading…
Cancel
Save