don't ncvisual_decode+stream #246

pull/251/head
nick black 5 years ago committed by Nick Black
parent 9ceb708c00
commit bd27e056e7

@ -60,6 +60,8 @@ zoom_map(struct notcurses* nc, const char* map){
ncvisual_destroy(ncv);
return NULL;
}
// don't actually display--we only call this to free up the ncvisual internals
ncvisual_render(ncv, 0, 0, 0, 0);
int vheight;
int vwidth;
ncplane_dim_yx(ncvisual_plane(ncv), &vheight, &vwidth);

@ -36,10 +36,6 @@ fadethread(void* vnc){
if(ncv == NULL){
return NULL;
}
if(ncvisual_decode(ncv, &averr) == NULL){
ncvisual_destroy(ncv);
return NULL;
}
int rows, cols;
notcurses_term_dim_yx(nc, &rows, &cols);
struct ncplane* apiap = ncplane_new(nc, 1, cols, rows - 1, 0, NULL);

@ -178,7 +178,7 @@ int sliding_puzzle_demo(struct notcurses* nc){
const int chunkcount = CHUNKS_VERT * CHUNKS_HORZ;
struct ncplane** chunks = malloc(sizeof(*chunks) * chunkcount);
if(chunks == NULL){
return -1;
goto done;
}
memset(chunks, 0, sizeof(*chunks) * chunkcount);
// draw the 72 boxes in a nice color pattern, in order
@ -197,7 +197,7 @@ int sliding_puzzle_demo(struct notcurses* nc){
}
// draw a box around the playing area
if(draw_bounding_box(n, wastey, wastex, chunky, chunkx)){
return -1;
goto done;
}
if(demo_render(nc)){
goto done;
@ -240,6 +240,7 @@ int sliding_puzzle_demo(struct notcurses* nc){
ret = 0;
done:
ncvisual_destroy(ncv);
for(z = 0 ; z < chunkcount ; ++z){
ncplane_destroy(chunks[z]);
}

@ -103,9 +103,6 @@ int xray_demo(struct notcurses* nc){
if(ncv == NULL){
return -1;
}
if(ncvisual_decode(ncv, &averr) == NULL){
return -1;
}
struct ncplane* newpanel = NULL;
ncvisual_stream(nc, ncv, &averr, perframecb, &newpanel);
ncvisual_destroy(ncv);

Loading…
Cancel
Save