rename sixel/kitty_delete -> destroy to match sprixel_destroy()

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

@ -932,8 +932,8 @@ sprixel* sprixel_recycle(ncplane* n);
// takes ownership of s on success.
int sprixel_load(sprixel* spx, char* s, int bytes, int placey, int placex,
int pixy, int pixx, int parse_start);
int sixel_delete(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s);
int kitty_delete(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s);
int sixel_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s);
int kitty_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s);
int kitty_remove(int id, FILE* out);
int kitty_init(int fd);
int sixel_init(int fd);

@ -381,7 +381,7 @@ int kitty_remove(int id, FILE* out){
// removes the kitty bitmap graphic identified by s->id, and damages those
// cells which weren't SPRIXCEL_OPAQUE
int kitty_delete(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){
int kitty_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){
(void)p;
(void)nc;
if(kitty_remove(s->id, out)){
@ -415,7 +415,6 @@ int kitty_delete(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){
int kitty_draw(const notcurses* nc, const ncpile* p, sprixel* s, FILE* out){
(void)nc;
(void)p;
(void)out;
int ret = 0;
if(fwrite(s->glyph, s->glyphlen, 1, out) != 1){
ret = -1;

@ -512,12 +512,14 @@ int sixel_blit(ncplane* n, int linesize, const void* data,
return r;
}
int sixel_delete(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){
int sixel_destroy(const notcurses* nc, const ncpile* p, FILE* out, sprixel* s){
//fprintf(stderr, "%d] %d %p\n", s->id, s->invalidated, s->n);
(void)nc;
(void)out;
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){
const ncplane* stdn = notcurses_stdplane_const(nc);
int starty = s->movedfromy;
int startx = s->movedfromx;
for(int yy = starty ; yy < starty + s->dimy && yy < p->dimy ; ++yy){
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;

@ -35,7 +35,7 @@ void sprixel_free(sprixel* s){
sprixel* sprixel_recycle(ncplane* n){
assert(n->sprite);
const notcurses* nc = ncplane_notcurses_const(n);
if(nc->tcache.pixel_destroy == kitty_delete){
if(sprixel_kitty_p(&nc->tcache)){
sprixel* hides = n->sprite;
int dimy = hides->dimy;
int dimx = hides->dimx;

@ -12,7 +12,7 @@ setup_sixel_bitmaps(tinfo* ti){
ti->sixel_maxx = 4096; // whee!
ti->sixel_maxy = 4096;
ti->pixel_remove = NULL;
ti->pixel_destroy = sixel_delete;
ti->pixel_destroy = sixel_destroy;
ti->pixel_cell_wipe = sixel_wipe;
ti->pixel_shutdown = sixel_shutdown;
ti->sprixel_height_factor = 6;
@ -21,7 +21,7 @@ setup_sixel_bitmaps(tinfo* ti){
static inline void
setup_kitty_bitmaps(tinfo* ti){
ti->pixel_cell_wipe = kitty_wipe;
ti->pixel_destroy = kitty_delete;
ti->pixel_destroy = kitty_destroy;
ti->pixel_init = kitty_init;
ti->pixel_remove = kitty_remove;
ti->pixel_draw = kitty_draw;

Loading…
Cancel
Save