rebuild: only free auxvec for non-animation #1895

dankamongmen/linuxfbdumb
nick black 3 years ago committed by Nick Black
parent 811bc9eb65
commit 6d6f69a02b

@ -705,8 +705,10 @@ sprite_rebuild(const notcurses* nc, sprixel* s, int ycell, int xcell){
uint8_t* auxvec = s->n->tam[idx].auxvector;
assert(auxvec);
ret = nc->tcache.pixel_rebuild(s, ycell, xcell, auxvec);
free(auxvec);
s->n->tam[idx].auxvector = NULL;
if(ret > 0){
free(auxvec);
s->n->tam[idx].auxvector = NULL;
}
}
// don't upset SPRIXEL_MOVED
if(s->invalidated == SPRIXEL_QUIESCENT){

@ -332,7 +332,7 @@ int kitty_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec){
if(--targy == 0){
s->n->tam[s->dimx * ycell + xcell].state = state;
s->invalidated = SPRIXEL_INVALIDATED;
return 0;
return 1;
}
thisrow = targx;
//fprintf(stderr, "BUMP IT: %d %d %d %d\n", nextpixel, s->pixx, targx, chomped);

@ -914,7 +914,7 @@ int sixel_rebuild(sprixel* s, int ycell, int xcell, uint8_t* auxvec){
newstate = SPRIXCELL_OPAQUE_SIXEL;
}
s->n->tam[s->dimx * ycell + xcell].state = newstate;
return 0;
return 1;
}
// 80 (sixel scrolling) is enabled by default. 8452 is not. XTSAVE/XTRESTORE

@ -148,6 +148,7 @@ wipebitmap(struct notcurses* nc){
int main(void){
struct notcurses_options opts = {
.loglevel = NCLOGLEVEL_TRACE,
};
struct notcurses* nc = notcurses_core_init(&opts, NULL);
if(notcurses_check_pixel_support(nc) < 1){

Loading…
Cancel
Save