sprite_wipe: check for ANNIHILATED_TRANS and return 0

pull/1610/head
nick black 3 years ago committed by Nick Black
parent e05ea90760
commit 9c03fdcfb5

@ -760,8 +760,7 @@ int sixel_rebuild(sprixel* s, int ycell, int xcell, const uint8_t* auxvec){
// redrawn, it's redrawn using P2=1.
int sixel_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell){
(void)nc;
if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED ||
s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED_TRANS){
if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED){
//fprintf(stderr, "CACHED WIPE %d %d/%d\n", s->id, ycell, xcell);
return 1; // already annihilated FIXME but 0 breaks things
}

@ -179,7 +179,12 @@ int sprite_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell){
s->n->tam[s->dimx * ycell + xcell].state = SPRIXCELL_ANNIHILATED_TRANS;
return 1;
}
//fprintf(stderr, "ANNIHILATED %p %d\n", s->n->tam, s->dimx * ycell + xcell);
if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED_TRANS){
// both handle this correctly; one day, we will also check for ANNIHILATED
// here, and return 0 (sixel currently must return 1) FIXME
return 0;
}
//fprintf(stderr, "ANNIHILATING %p %d\n", s->n->tam, s->dimx * ycell + xcell);
int r = nc->tcache.pixel_cell_wipe(nc, s, ycell, xcell);
//fprintf(stderr, "WIPED %d %d/%d ret=%d\n", s->id, ycell, xcell, r);
// mark the cell as annihilated whether we actually scrubbed it or not,

Loading…
Cancel
Save