|
|
|
@ -24,8 +24,10 @@ sprixel* sprixel_recycle(ncplane* n, ncvisual* ncv){
|
|
|
|
|
assert(hides);
|
|
|
|
|
int dimy = hides->dimy;
|
|
|
|
|
int dimx = hides->dimx;
|
|
|
|
|
int y = hides->y;
|
|
|
|
|
int x = hides->x;
|
|
|
|
|
sprixel_hide(hides);
|
|
|
|
|
return sprixel_alloc(n, ncv, dimy, dimx);
|
|
|
|
|
return sprixel_alloc(n, ncv, dimy, dimx, y, x);
|
|
|
|
|
}
|
|
|
|
|
return n->sprite;
|
|
|
|
|
}
|
|
|
|
@ -35,6 +37,7 @@ sprixel* sprixel_recycle(ncplane* n, ncvisual* ncv){
|
|
|
|
|
void sprixel_movefrom(sprixel* s, int y, int x){
|
|
|
|
|
if(s->invalidated != SPRIXEL_HIDE){
|
|
|
|
|
if(s->invalidated != SPRIXEL_MOVED){
|
|
|
|
|
//fprintf(stderr, "SETTING TO MOVE: %d/%d was: %d\n", y, x, s->invalidated);
|
|
|
|
|
s->invalidated = SPRIXEL_MOVED;
|
|
|
|
|
s->movedfromy = y;
|
|
|
|
|
s->movedfromx = x;
|
|
|
|
@ -83,7 +86,8 @@ sprixel* sprixel_by_id(const notcurses* nc, uint32_t id){
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sprixel* sprixel_alloc(ncplane* n, ncvisual* ncv, int dimy, int dimx){
|
|
|
|
|
sprixel* sprixel_alloc(ncplane* n, ncvisual* ncv, int dimy, int dimx,
|
|
|
|
|
int placey, int placex){
|
|
|
|
|
sprixel* ret = malloc(sizeof(sprixel));
|
|
|
|
|
if(ret){
|
|
|
|
|
memset(ret, 0, sizeof(*ret));
|
|
|
|
@ -91,6 +95,8 @@ sprixel* sprixel_alloc(ncplane* n, ncvisual* ncv, int dimy, int dimx){
|
|
|
|
|
ret->ncv = ncv;
|
|
|
|
|
ret->dimy = dimy;
|
|
|
|
|
ret->dimx = dimx;
|
|
|
|
|
ret->y = placey;
|
|
|
|
|
ret->x = placex;
|
|
|
|
|
ret->id = ++sprixelid_nonce;
|
|
|
|
|
//fprintf(stderr, "LOOKING AT %p (p->n = %p)\n", ret, ret->n);
|
|
|
|
|
if(ncplane_pile(ret->n)){
|
|
|
|
|