[intro] drop greatscott()

dankamongmen/windows-tester
nick black 3 years ago
parent 0124daf8b7
commit 83b3926f92
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

@ -28,41 +28,6 @@ animate(struct notcurses* nc, struct ncplane* ncp, void* curry){
return 0;
}
static struct ncplane*
greatscott(struct notcurses* nc, int dimx){
char* path = find_data("greatscott.jpg");
if(path == NULL){
return NULL;
}
struct ncvisual* ncv = ncvisual_from_file(path);
free(path);
if(ncv == NULL){
return NULL;
}
struct ncplane_options opts = {
.y = 2,
.x = NCALIGN_CENTER,
.rows = 18,
.cols = dimx - 2,
.flags = NCPLANE_OPTION_HORALIGNED,
.name = "gsct",
};
struct ncplane* n = ncplane_create(notcurses_stdplane(nc), &opts);
if(n == NULL){
ncvisual_destroy(ncv);
return NULL;
}
struct ncvisual_options vopts = {
.n = n,
.blitter = NCBLIT_PIXEL,
.scaling = NCSCALE_STRETCH,
.flags = NCVISUAL_OPTION_NODEGRADE,
};
struct ncplane* ret = ncvisual_blit(nc, ncv, &vopts);
ncvisual_destroy(ncv);
return ret;
}
static struct ncplane*
orcashow(struct notcurses* nc, unsigned dimy, unsigned dimx){
char* path = find_data("natasha-blur.png");
@ -270,14 +235,6 @@ int intro(struct notcurses* nc){
}
}while(timespec_to_ns(&now) < deadline || flipmode < expected_iter);
ncplane_destroy(on);
struct ncplane* gscott = NULL;
if(notcurses_check_pixel_support(nc) && notcurses_canopen_images(nc)){
if((gscott = greatscott(nc, cols)) == NULL){
return -1;
}
DEMO_RENDER(nc);
demo_nanosleep(nc, &demodelay);
}
if(notcurses_canfade(nc)){
struct timespec fade = demodelay;
int err;
@ -285,6 +242,5 @@ int intro(struct notcurses* nc){
return err;
}
}
ncplane_destroy(gscott);
return 0;
}

@ -11,13 +11,19 @@ ncprogbar* ncprogbar_create(ncplane* n, const ncprogbar_options* opts){
logwarn("Invalid flags %016" PRIx64 "\n", opts->flags);
}
ncprogbar* ret = malloc(sizeof(*ret));
if(ret){
ret->ncp = n;
ret->ulchannel = opts->ulchannel;
ret->urchannel = opts->urchannel;
ret->blchannel = opts->blchannel;
ret->brchannel = opts->brchannel;
ret->retrograde = opts->flags & NCPROGBAR_OPTION_RETROGRADE;
if(ret == NULL){
ncplane_destroy(n);
return NULL;
}
ret->ncp = n;
ret->ulchannel = opts->ulchannel;
ret->urchannel = opts->urchannel;
ret->blchannel = opts->blchannel;
ret->brchannel = opts->brchannel;
ret->retrograde = opts->flags & NCPROGBAR_OPTION_RETROGRADE;
if(ncplane_set_widget(n, ret, (void(*)(void*))ncprogbar_destroy)){
ncplane_destroy(n);
return NULL;
}
return ret;
}

Loading…
Cancel
Save