sixel_debug() for #1561

pull/1567/head
nick black 3 years ago
parent 0ec15fa920
commit c008d50b03
No known key found for this signature in database
GPG Key ID: 5F43400C21CBFACC

@ -4,6 +4,22 @@
// FIXME needs be atomic
static uint32_t sprixelid_nonce;
static inline void
sprixel_debug(FILE* out, const sprixel* s){
fprintf(out, "Sprixel %d (%p) %dx%d (%dx%d) n: %p state: %d\n",
s->id, s, s->dimy, s->dimx, s->pixy, s->pixx, s->n, s->invalidated);
if(s->n){
int idx = 0;
for(int y = 0 ; y < s->dimy ; ++y){
for(int x = 0 ; x < s->dimx ; ++x){
fprintf(out, "%d ", s->n->tacache[idx]);
++idx;
}
fprintf(out, "\n");
}
}
}
void sprixel_free(sprixel* s){
if(s){
if(s->n){
@ -138,6 +154,7 @@ int sprite_wipe(const notcurses* nc, sprixel* s, int ycell, int xcell){
// precondition: s->invalidated is SPRIXEL_INVALIDATED or SPRIXEL_MOVED.
int sprite_draw(const notcurses* n, const ncpile* p, sprixel* s, FILE* out){
//sprixel_debug(stderr, s);
int r = n->tcache.pixel_draw(n, p, s, out);
return r;
}

Loading…
Cancel
Save