diff options
author | Rich Felker <dalias@aerifal.cx> | 2006-10-12 07:54:39 +0000 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2006-10-12 07:54:39 +0000 |
commit | 65d1709c918dc981e389d63059954dc5664c8d33 (patch) | |
tree | 40d301d0b01dd48ec398fe88397b3523304f4dfb /dblbuf.c | |
parent | 58ece9167987dbc3b88656c470244543cb3d5c32 (diff) |
factoring
Diffstat (limited to 'dblbuf.c')
-rw-r--r-- | dblbuf.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -106,7 +106,15 @@ static unsigned long expand_color(struct uudisp *d, int color) return color * (unsigned long)0x0101010101010101; } -void uudisp_draw_glyph(struct uudisp *d, int idx, int x, const void *glyph, int color) +void uudisp_predraw_cell(struct uudisp *d, int idx, int x, int color) +{ + struct dblbuf *b = (void *)&d->priv; + + b->slices[idx].colors[2*x] = expand_color(d, color&15); + b->slices[idx].colors[2*x+1] = expand_color(d, color>>4) ^ b->slices[idx].colors[2*x]; +} + +void uudisp_draw_glyph(struct uudisp *d, int idx, int x, const void *glyph) { struct dblbuf *b = (void *)&d->priv; int i; @@ -115,8 +123,6 @@ void uudisp_draw_glyph(struct uudisp *d, int idx, int x, const void *glyph, int unsigned char *src = (void *)glyph; unsigned char *dest = b->slices[idx].bitmap + cs * x; - b->slices[idx].colors[2*x] = expand_color(d, color&15); - b->slices[idx].colors[2*x+1] = expand_color(d, color>>4) ^ b->slices[idx].colors[2*x]; for (i=d->cell_h; i; i--, dest += stride) *dest |= *src++; } |