aboutsummaryrefslogtreecommitdiff
path: root/screen-display.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2008-09-08 22:03:56 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2008-09-08 22:03:56 +0000
commit6674197e853ddec4ab1af04ede3ebabcdcc581c5 (patch)
tree529afe1a8b42190111f446a46c3b2d8cd8edcf21 /screen-display.c
parentcecd7c0cc8457e849c65d4971863b0010613db91 (diff)
downloadrtmux-6674197e853ddec4ab1af04ede3ebabcdcc581c5.tar.gz
rtmux-6674197e853ddec4ab1af04ede3ebabcdcc581c5.tar.bz2
rtmux-6674197e853ddec4ab1af04ede3ebabcdcc581c5.zip
Fix bold/non-bold mismatch in 256 colour mode by adding an extra 8 bits (ick) onto the attributes and using two of them to mark the fg and bg as 256 colours when necessary. If only it was 255 colours we would have one value for default and wouln't need this :-/.
Diffstat (limited to 'screen-display.c')
-rw-r--r--screen-display.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/screen-display.c b/screen-display.c
index 06ec6caf..be8c8e93 100644
--- a/screen-display.c
+++ b/screen-display.c
@@ -1,4 +1,4 @@
-/* $Id: screen-display.c,v 1.19 2008-09-08 17:40:50 nicm Exp $ */
+/* $Id: screen-display.c,v 1.20 2008-09-08 22:03:54 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -25,7 +25,7 @@
/* Set a cell. */
void
screen_display_set_cell(struct screen *s,
- u_int px, u_int py, u_char data, u_char attr, u_char fg, u_char bg)
+ u_int px, u_int py, u_char data, u_short attr, u_char fg, u_char bg)
{
screen_set_cell(
s, screen_x(s, px), screen_y(s, py), data, attr, fg, bg);
@@ -75,7 +75,7 @@ screen_display_move_lines(struct screen *s, u_int dy, u_int py, u_int ny)
/* Fill a set of cells. */
void
screen_display_fill_area(struct screen *s, u_int px, u_int py,
- u_int nx, u_int ny, u_char data, u_char attr, u_char fg, u_char bg)
+ u_int nx, u_int ny, u_char data, u_short attr, u_char fg, u_char bg)
{
if (nx == 0 || ny == 0) {
SCREEN_DEBUG4(s, px, py, nx, ny);
@@ -378,10 +378,14 @@ screen_display_insert_characters(struct screen *s, u_int px, u_int py, u_int nx)
if (px + nx != screen_last_x(s)) {
mx = screen_last_x(s) - (px + nx);
- memmove(&s->grid_data[py][px + nx], &s->grid_data[py][px], mx);
- memmove(&s->grid_attr[py][px + nx], &s->grid_attr[py][px], mx);
- memmove(&s->grid_fg[py][px + nx], &s->grid_fg[py][px], mx);
- memmove(&s->grid_bg[py][px + nx], &s->grid_bg[py][px], mx);
+ memmove(&s->grid_data[py][px + nx],
+ &s->grid_data[py][px], mx * sizeof **s->grid_data);
+ memmove(&s->grid_attr[py][px + nx],
+ &s->grid_attr[py][px], mx * sizeof **s->grid_attr);
+ memmove(&s->grid_fg[py][px + nx],
+ &s->grid_fg[py][px], mx * sizeof **s->grid_fg);
+ memmove(&s->grid_bg[py][px + nx],
+ &s->grid_bg[py][px], mx * sizeof **s->grid_bg);
}
memset(&s->grid_data[py][px], ' ', nx);
@@ -437,7 +441,8 @@ screen_display_copy_area(struct screen *dst, struct screen *src,
u_int px, u_int py, u_int nx, u_int ny, u_int ox, u_int oy)
{
u_int i, j;
- u_char data, attr, fg, bg;
+ u_short attr;
+ u_char data, fg, bg;
if (nx == 0 || ny == 0) {
SCREEN_DEBUG4(dst, px, py, nx, ny);