Rev 3767 | Rev 3793 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3767 | Rev 3792 | ||
---|---|---|---|
Line 183... | Line 183... | ||
183 | [8 + COLOR_MAGENTA] = 0xff00ff, |
183 | [8 + COLOR_MAGENTA] = 0xff00ff, |
184 | [8 + COLOR_YELLOW] = 0xffff00, |
184 | [8 + COLOR_YELLOW] = 0xffff00, |
185 | [8 + COLOR_WHITE] = 0xffffff, |
185 | [8 + COLOR_WHITE] = 0xffffff, |
186 | }; |
186 | }; |
187 | 187 | ||
- | 188 | static int rgb_from_attr(attr_rgb_t *rgb, const attrs_t *a); |
|
188 | static int rgb_from_style(attr_rgb_t *rgb, int style); |
189 | static int rgb_from_style(attr_rgb_t *rgb, int style); |
189 | static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color, |
190 | static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color, |
190 | ipcarg_t bg_color, ipcarg_t flags); |
191 | ipcarg_t bg_color, ipcarg_t flags); |
191 | 192 | ||
192 | static int fb_set_color(viewport_t *vport, ipcarg_t fg_color, |
193 | static int fb_set_color(viewport_t *vport, ipcarg_t fg_color, |
Line 875... | Line 876... | ||
875 | unsigned int row = i / vport->cols; |
876 | unsigned int row = i / vport->cols; |
876 | 877 | ||
877 | bbp = &vport->backbuf[BB_POS(vport, col, row)]; |
878 | bbp = &vport->backbuf[BB_POS(vport, col, row)]; |
878 | uint8_t glyph = bbp->glyph; |
879 | uint8_t glyph = bbp->glyph; |
879 | 880 | ||
880 | if (glyph != data[i].character) { |
- | |
881 | bbp->glyph = data[i].character; |
881 | a = &data[i].attrs; |
882 | a = &data[i].attrs; |
882 | rgb_from_attr(&rgb, a); |
883 | 883 | ||
884 | switch (a->t) { |
- | |
885 | case at_style: |
- | |
886 | rgb_from_style(&rgb, a->a.s.style); |
884 | if (glyph != data[i].character || |
887 | break; |
- | |
888 | case at_idx: |
- | |
889 | rgb_from_idx(&rgb, a->a.i.fg_color, |
885 | rgb.fg_color != bbp->fg_color || |
890 | a->a.i.bg_color, a->a.i.flags); |
886 | rgb.bg_color != bbp->bg_color) { |
891 | break; |
- | |
892 | case at_rgb: |
- | |
893 | rgb = a->a.r; |
887 | bbp->glyph = data[i].character; |
894 | break; |
- | |
895 | } |
- | |
896 | 888 | ||
897 | bbp->fg_color = rgb.fg_color; |
889 | bbp->fg_color = rgb.fg_color; |
898 | bbp->bg_color = rgb.bg_color; |
890 | bbp->bg_color = rgb.bg_color; |
899 | 891 | ||
900 | draw_vp_glyph(vport, false, col, row); |
892 | draw_vp_glyph(vport, false, col, row); |
Line 1442... | Line 1434... | ||
1442 | rgb->bg_color = color_table[bg_color]; |
1434 | rgb->bg_color = color_table[bg_color]; |
1443 | 1435 | ||
1444 | return EOK; |
1436 | return EOK; |
1445 | } |
1437 | } |
1446 | 1438 | ||
- | 1439 | static int rgb_from_attr(attr_rgb_t *rgb, const attrs_t *a) |
|
- | 1440 | { |
|
- | 1441 | int rc; |
|
- | 1442 | ||
- | 1443 | switch (a->t) { |
|
- | 1444 | case at_style: |
|
- | 1445 | rc = rgb_from_style(rgb, a->a.s.style); |
|
- | 1446 | break; |
|
- | 1447 | case at_idx: |
|
- | 1448 | rc = rgb_from_idx(rgb, a->a.i.fg_color, |
|
- | 1449 | a->a.i.bg_color, a->a.i.flags); |
|
- | 1450 | break; |
|
- | 1451 | case at_rgb: |
|
- | 1452 | *rgb = a->a.r; |
|
- | 1453 | rc = EOK; |
|
- | 1454 | break; |
|
- | 1455 | } |
|
- | 1456 | ||
- | 1457 | return rc; |
|
- | 1458 | } |
|
- | 1459 | ||
1447 | static int fb_set_style(viewport_t *vport, ipcarg_t style) |
1460 | static int fb_set_style(viewport_t *vport, ipcarg_t style) |
1448 | { |
1461 | { |
1449 | return rgb_from_style(&vport->attr, (int) style); |
1462 | return rgb_from_style(&vport->attr, (int) style); |
1450 | } |
1463 | } |
1451 | 1464 |