sixel: deepclean on any draw

Whether a draw is due to a move or a simple invalidation,
we need to go ahead and apply any outstanding deepclean to
the sixel beforehand. This eliminates the last bit of
flicker in the intro demo, at the orca's first location.
Also, never emit a '-$' sequence when deepcleaning a sixel.
Closes #1574. Closes #1568.
pull/1573/head
nick black 3 years ago
parent c57a7b33cf
commit f665828712
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -654,7 +654,7 @@ deepclean_stream(sprixel* s, FILE* fp){
y += 6;
x = 0;
state = SIXEL_WANT_HASH;
needclosure = needclosure | printed;
needclosure = 0;
fputc('-', fp);
}else if(c == '$'){
x = 0;
@ -704,6 +704,14 @@ err:
int sixel_draw(const notcurses* n, const ncpile* p, sprixel* s, FILE* out){
(void)n;
// if we've wiped any cells, we need actually wipe them out now, or else
// we'll get flicker when we move to the new location
if(s->wipes_outstanding){
if(sixel_deepclean(s)){
return -1;
}
s->wipes_outstanding = false;
}
if(s->invalidated == SPRIXEL_MOVED){
for(int yy = s->movedfromy ; yy < s->movedfromy + s->dimy && yy < p->dimy ; ++yy){
for(int xx = s->movedfromx ; xx < s->movedfromx + s->dimx && xx < p->dimx ; ++xx){
@ -713,14 +721,6 @@ int sixel_draw(const notcurses* n, const ncpile* p, sprixel* s, FILE* out){
}
}
}
// if we've wiped any cells, we need actually wipe them out now, or else
// we'll get flicker when we move to the new location
if(s->wipes_outstanding){
if(sixel_deepclean(s)){
return -1;
}
s->wipes_outstanding = false;
}
s->invalidated = SPRIXEL_INVALIDATED;
}else{
if(fwrite(s->glyph, s->glyphlen, 1, out) != 1){

Loading…
Cancel
Save