version 1.101, 2016/12/09 21:39:27 |
version 1.102, 2017/01/05 09:07:16 |
|
|
/* Copy from another screen. */ |
/* Copy from another screen. */ |
void |
void |
screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px, |
screen_write_copy(struct screen_write_ctx *ctx, struct screen *src, u_int px, |
u_int py, u_int nx, u_int ny) |
u_int py, u_int nx, u_int ny, bitstr_t *markbs, |
|
const struct grid_cell *markgc) |
{ |
{ |
struct screen *s = ctx->s; |
struct screen *s = ctx->s; |
struct grid *gd = src->grid; |
struct grid *gd = src->grid; |
struct grid_cell gc; |
struct grid_cell gc; |
u_int xx, yy, cx, cy; |
u_int xx, yy, cx, cy, b; |
|
|
cx = s->cx; |
cx = s->cx; |
cy = s->cy; |
cy = s->cy; |
|
|
for (yy = py; yy < py + ny; yy++) { |
for (yy = py; yy < py + ny; yy++) { |
for (xx = px; xx < px + nx; xx++) { |
for (xx = px; xx < px + nx; xx++) { |
grid_get_cell(gd, xx, yy, &gc); |
grid_get_cell(gd, xx, yy, &gc); |
|
if (markbs != NULL) { |
|
b = (yy * screen_size_x(src)) + xx; |
|
if (bit_test(markbs, b)) { |
|
gc.attr = markgc->attr; |
|
gc.fg = markgc->fg; |
|
gc.bg = markgc->bg; |
|
} |
|
} |
screen_write_cell(ctx, &gc); |
screen_write_cell(ctx, &gc); |
} |
} |
|
|