mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 17:19:03 -04:00
sixel: restore bad 1 on cached wipe
This commit is contained in:
parent
f067f03832
commit
e4a1b44ffa
@ -586,17 +586,17 @@ int kitty_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){
|
||||
sprixcell_e state = sprixel_state(s, yy - s->movedfromy + s->n->absy - stdn->absy,
|
||||
xx - s->movedfromx + s->n->absx - stdn->absx);
|
||||
if(state == SPRIXCELL_OPAQUE_KITTY){
|
||||
fprintf(stderr, "DAMAGED 1\n");
|
||||
//fprintf(stderr, "DAMAGED 1\n");
|
||||
r->s.damaged = 1;
|
||||
}else if(s->invalidated == SPRIXEL_MOVED){
|
||||
// ideally, we wouldn't damage our annihilated sprixcells, but if
|
||||
// we're being annihilated only during this cycle, we need to go
|
||||
// ahead and damage it.
|
||||
fprintf(stderr, "DAMAGED 2\n");
|
||||
//fprintf(stderr, "DAMAGED 2\n");
|
||||
r->s.damaged = 1;
|
||||
}
|
||||
}else{
|
||||
fprintf(stderr, "DAMAGED 3\n");
|
||||
//fprintf(stderr, "DAMAGED 3\n");
|
||||
//r->s.damaged = 1;
|
||||
}
|
||||
}
|
||||
|
@ -923,7 +923,7 @@ clean_sprixels(notcurses* nc, ncpile* p, FILE* out){
|
||||
int ret = 0;
|
||||
while( (s = *parent) ){
|
||||
if(s->invalidated == SPRIXEL_HIDE){
|
||||
//fprintf(stderr, "OUGHT HIDE %d [%dx%d] %p\n", s->id, s->dimy, s->dimx, s);
|
||||
fprintf(stderr, "OUGHT HIDE %d [%dx%d] %p\n", s->id, s->dimy, s->dimx, s);
|
||||
if(sprite_destroy(nc, p, out, s) == 0){
|
||||
if( (*parent = s->next) ){
|
||||
s->next->prev = s->prev;
|
||||
|
@ -696,7 +696,7 @@ int sixel_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){
|
||||
for(int xx = startx ; xx < startx + s->dimx && xx < p->dimx ; ++xx){
|
||||
struct crender *r = &p->crender[yy * p->dimx + xx];
|
||||
if(!r->sprixel){
|
||||
//r->s.damaged = 1;
|
||||
r->s.damaged = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -846,7 +846,7 @@ wipe_color(sixelmap* smap, int color, int sband, int eband,
|
||||
int sixel_wipe(sprixel* s, int ycell, int xcell){
|
||||
if(s->n->tam[s->dimx * ycell + xcell].state == SPRIXCELL_ANNIHILATED){
|
||||
//fprintf(stderr, "CACHED WIPE %d %d/%d\n", s->id, ycell, xcell);
|
||||
return 0; // already annihilated FIXME but 0 breaks things
|
||||
return 1; // already annihilated FIXME but 0 breaks things
|
||||
}
|
||||
//fprintf(stderr, "WIPING %d/%d\n", ycell, xcell);
|
||||
uint8_t* auxvec = sprixel_auxiliary_vector(s);
|
||||
|
@ -82,6 +82,7 @@ void sprixel_movefrom(sprixel* s, int y, int x){
|
||||
|
||||
void sprixel_hide(sprixel* s){
|
||||
if(ncplane_pile(s->n) == NULL){ // ncdirect case; destroy now
|
||||
fprintf(stderr, "DESTROY IMMEDIATELY\n");
|
||||
sprixel_free(s);
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user