properly bound paint_sprixel on sprixel geom #1598

pull/1610/head
nick black 3 years ago committed by Nick Black
parent dd4eb3e5c2
commit 8cef88b251

@ -1052,7 +1052,7 @@ sprixel_state(const sprixel* s, int y, int x){
const ncplane* stdn = notcurses_stdplane_const(ncplane_notcurses_const(s->n));
int localy = y - (s->n->absy - stdn->absy);
int localx = x - (s->n->absx - stdn->absx);
//fprintf(stderr, "TAM %d at %d/%d (%d/%d)\n", s->n->tacache[localy * s->dimx + localx], localy, localx, y, x);
//fprintf(stderr, "TAM %d at %d/%d (%d/%d)\n", s->n->tam[localy * s->dimx + localx].state, localy, localx, y, x);
assert(localy >= 0);
assert(localy < s->dimy);
assert(localx >= 0);

@ -149,6 +149,7 @@ paint_sprixel(ncplane* p, struct crender* rvec, int starty, int startx,
sprixel* s = p->sprite;
int dimy = s->dimy;
int dimx = s->dimx;
//fprintf(stderr, "STARTY: %d DIMY: %d dim(p): %d/%d dim(s): %d/%d\n", starty, dimy, ncplane_dim_y(p), ncplane_dim_x(p), s->dimy, s->dimx);
for(int y = starty ; y < dimy ; ++y){
const int absy = y + offy;
// once we've passed the physical screen's bottom, we're done

@ -813,6 +813,7 @@ extract_palette(const sprixel* spx, sixeltable* stable){
// is redrawn, and annihilated sprixcells still require a glyph to be emitted.
static int
sixel_update(const notcurses* n, sprixel* s){
/* FIXME
int sixelcount = s->pixx * (s->pixy + 5) / 6;
sixeltable stable = {
.colorregs = n->tcache.color_registers,
@ -830,6 +831,7 @@ sixel_update(const notcurses* n, sprixel* s){
return -1;
}
free(stable.table);
*/
return 0;
}

@ -152,6 +152,7 @@ ncvisual_blitset_geom(const notcurses* nc, const ncvisual* n,
}
// FIXME clamp to sprixel limits
if(vopts->scaling == NCSCALE_NONE || vopts->scaling == NCSCALE_NONE_HIRES){
/*
int rows = (*leny + nc->tcache.cellpixy - 1) / nc->tcache.cellpixy;
if(rows > ncplane_dim_y(vopts->n)){
logerror(nc, "Sprixel too tall %d for plane %d\n", *leny, ncplane_dim_y(vopts->n) * nc->tcache.cellpixy);
@ -162,6 +163,7 @@ ncvisual_blitset_geom(const notcurses* nc, const ncvisual* n,
logerror(nc, "Sprixel too wide %d for plane %d\n", *lenx, ncplane_dim_x(vopts->n) * nc->tcache.cellpixx);
return -1;
}
*/
}
}
}

Loading…
Cancel
Save