fbcon_wipe: build up auxvec

pull/1968/head
nick black 3 years ago
parent f008c75275
commit b278d16f67
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -387,6 +387,9 @@ sprixel* kitty_recycle(ncplane* n){
int kitty_wipe(sprixel* s, int ycell, int xcell){
//fprintf(stderr, "NEW WIPE %d %d/%d\n", s->id, ycell, xcell);
uint8_t* auxvec = sprixel_auxiliary_vector(s);
if(auxvec == NULL){
return -1;
}
const int totalpixels = s->pixy * s->pixx;
const int xpixels = s->cellpxx;
const int ypixels = s->cellpxy;

@ -2,11 +2,17 @@
#include "internal.h"
int fbcon_wipe(sprixel* s, int ycell, int xcell){
uint8_t* auxvec = sprixel_auxiliary_vector(s);
if(auxvec == NULL){
return -1;
}
char* glyph = s->glyph;
for(int y = 0 ; y < s->cellpxy ; ++y){
size_t offset = (ycell * s->dimx + xcell) * 4;
// FIXME need preserve auxvec
for(int x = 0 ; x < s->cellpxx ; ++x){
const int vyx = (y % s->cellpxy) * s->cellpxx + (x % s->cellpxx);
auxvec[vyx] = glyph[offset + 3];
glyph[offset + 3] = 0;
offset += 4;
}

@ -210,6 +210,9 @@ wipe_color(sixelmap* smap, int color, int sband, int eband,
int sixel_wipe(sprixel* s, int ycell, int xcell){
//fprintf(stderr, "WIPING %d/%d\n", ycell, xcell);
uint8_t* auxvec = sprixel_auxiliary_vector(s);
if(auxvec == NULL){
return -1;
}
memset(auxvec + s->cellpxx * s->cellpxy, 0xff, s->cellpxx * s->cellpxy);
sixelmap* smap = s->smap;
const int startx = xcell * s->cellpxx;

Loading…
Cancel
Save