paint(): return void rather than int

This commit is contained in:
nick black 2020-09-17 03:53:01 -04:00
parent 2c0cf54f96
commit 77a0dbbe94
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

View File

@ -221,7 +221,7 @@ lock_in_highcontrast(cell* targc, struct crender* crender){
// //
// only those cells where 'p' intersects with the target rendering area are // only those cells where 'p' intersects with the target rendering area are
// rendered. // rendered.
static int static void
paint(const ncplane* p, struct crender* rvec, int dstleny, int dstlenx, paint(const ncplane* p, struct crender* rvec, int dstleny, int dstlenx,
int dstabsy, int dstabsx){ int dstabsy, int dstabsx){
int y, x, dimy, dimx, offy, offx; int y, x, dimy, dimx, offy, offx;
@ -341,7 +341,6 @@ paint(const ncplane* p, struct crender* rvec, int dstleny, int dstlenx,
} }
} }
} }
return 0;
} }
// it's not a pure memset(), because CELL_ALPHA_OPAQUE is the zero value, and // it's not a pure memset(), because CELL_ALPHA_OPAQUE is the zero value, and
@ -421,16 +420,8 @@ int ncplane_mergedown(const ncplane* restrict src, ncplane* restrict dst,
return -1; return -1;
} }
init_rvec(rvec, totalcells); init_rvec(rvec, totalcells);
if(paint(src, rvec, dst->leny, dst->lenx, dst->absy, dst->absx)){ paint(src, rvec, dst->leny, dst->lenx, dst->absy, dst->absx);
free(rvec); paint(dst, rvec, dst->leny, dst->lenx, dst->absy, dst->absx);
free(rendfb);
return -1;
}
if(paint(dst, rvec, dst->leny, dst->lenx, dst->absy, dst->absx)){
free(rvec);
free(rendfb);
return -1;
}
//fprintf(stderr, "Postpaint start (%dx%d)\n", dst->leny, dst->lenx); //fprintf(stderr, "Postpaint start (%dx%d)\n", dst->leny, dst->lenx);
postpaint(rendfb, dst->leny, dst->lenx, rvec, &dst->pool); postpaint(rendfb, dst->leny, dst->lenx, rvec, &dst->pool);
//fprintf(stderr, "Postpaint done (%dx%d)\n", dst->leny, dst->lenx); //fprintf(stderr, "Postpaint done (%dx%d)\n", dst->leny, dst->lenx);
@ -1012,10 +1003,8 @@ notcurses_render_internal(notcurses* nc, struct crender* rvec){
ncplane_dim_yx(nc->stdplane, &dimy, &dimx); ncplane_dim_yx(nc->stdplane, &dimy, &dimx);
ncplane* p = nc->top; ncplane* p = nc->top;
while(p){ while(p){
if(paint(p, rvec, nc->stdplane->leny, nc->stdplane->lenx, paint(p, rvec, nc->stdplane->leny, nc->stdplane->lenx,
nc->stdplane->absy, nc->stdplane->absx)){ nc->stdplane->absy, nc->stdplane->absx);
return -1;
}
p = p->below; p = p->below;
} }
postpaint(nc->lastframe, dimy, dimx, rvec, &nc->pool); postpaint(nc->lastframe, dimy, dimx, rvec, &nc->pool);