Skip to content

Commit

Permalink
init_rvec: run a single loop
Browse files Browse the repository at this point in the history
  • Loading branch information
dankamongmen committed Feb 24, 2021
1 parent d1825db commit 2550286
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/render.c
Original file line number Diff line number Diff line change
Expand Up @@ -415,11 +415,11 @@ paint(const ncplane* p, struct crender* rvec, int dstleny, int dstlenx,
// we need CELL_ALPHA_TRANSPARENT
static inline void
init_rvec(struct crender* rvec, int totalcells){
memset(rvec, 0, sizeof(*rvec) * totalcells);
struct crender c = {};
cell_set_fg_alpha(&c.c, CELL_ALPHA_TRANSPARENT);
cell_set_bg_alpha(&c.c, CELL_ALPHA_TRANSPARENT);
for(int t = 0 ; t < totalcells ; ++t){
struct crender* c = &rvec[t];
cell_set_fg_alpha(&c->c, CELL_ALPHA_TRANSPARENT);
cell_set_bg_alpha(&c->c, CELL_ALPHA_TRANSPARENT);
memcpy(&rvec[t], &c, sizeof(c));
}
}

Expand Down

0 comments on commit 2550286

Please sign in to comment.