mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
[intro] drop greatscott()
This commit is contained in:
parent
0124daf8b7
commit
83b3926f92
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…
x
Reference in New Issue
Block a user