diff options
author | Simon Howard | 2012-03-01 20:26:56 +0000 |
---|---|---|
committer | Simon Howard | 2012-03-01 20:26:56 +0000 |
commit | 9ffd1cc4d4bbd2b2799cbd0bf927fc4f30aed63e (patch) | |
tree | 06e5d3599db4c7bec3bcc032a241424d0bccc7e3 /textscreen/txt_gui.c | |
parent | 920ffea9b631e712ff0826911db01a76edbe7521 (diff) | |
download | chocolate-doom-9ffd1cc4d4bbd2b2799cbd0bf927fc4f30aed63e.tar.gz chocolate-doom-9ffd1cc4d4bbd2b2799cbd0bf927fc4f30aed63e.tar.bz2 chocolate-doom-9ffd1cc4d4bbd2b2799cbd0bf927fc4f30aed63e.zip |
Rework the way that window background colors are set, and change the
background color of inactive windows to black, to give better contrast
when viewing many layered windows.
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 2507
Diffstat (limited to 'textscreen/txt_gui.c')
-rw-r--r-- | textscreen/txt_gui.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/textscreen/txt_gui.c b/textscreen/txt_gui.c index 30d43808..09ba87ef 100644 --- a/textscreen/txt_gui.c +++ b/textscreen/txt_gui.c @@ -173,11 +173,12 @@ void TXT_DrawShadow(int x, int y, int w, int h) void TXT_DrawWindowFrame(const char *title, int x, int y, int w, int h) { + txt_saved_colors_t colors; int x1, y1; int bx, by; + TXT_SaveColors(&colors); TXT_FGColor(TXT_COLOR_BRIGHT_CYAN); - TXT_BGColor(TXT_WINDOW_BACKGROUND, 0); for (y1=y; y1<y+h; ++y1) { @@ -226,18 +227,21 @@ void TXT_DrawWindowFrame(const char *title, int x, int y, int w, int h) TXT_DrawShadow(x + 2, y + h, w, 1); TXT_DrawShadow(x + w, y + 1, 2, h); + + TXT_RestoreColors(&colors); } void TXT_DrawSeparator(int x, int y, int w) { + txt_saved_colors_t colors; unsigned char *data; int x1; int b; data = TXT_GetScreenData(); + TXT_SaveColors(&colors); TXT_FGColor(TXT_COLOR_BRIGHT_CYAN); - TXT_BGColor(TXT_WINDOW_BACKGROUND, 0); if (!VALID_Y(y)) { @@ -268,6 +272,8 @@ void TXT_DrawSeparator(int x, int y, int w) data += 2; } + + TXT_RestoreColors(&colors); } void TXT_DrawString(const char *s) @@ -360,6 +366,7 @@ void TXT_DrawUTF8String(const char *s) void TXT_DrawHorizScrollbar(int x, int y, int w, int cursor, int range) { + txt_saved_colors_t colors; int x1; int cursor_x; @@ -368,6 +375,7 @@ void TXT_DrawHorizScrollbar(int x, int y, int w, int cursor, int range) return; } + TXT_SaveColors(&colors); TXT_FGColor(TXT_COLOR_BLACK); TXT_BGColor(TXT_COLOR_GREY, 0); @@ -402,10 +410,12 @@ void TXT_DrawHorizScrollbar(int x, int y, int w, int cursor, int range) } TXT_PutChar('\x1a'); + TXT_RestoreColors(&colors); } void TXT_DrawVertScrollbar(int x, int y, int h, int cursor, int range) { + txt_saved_colors_t colors; int y1; int cursor_y; @@ -414,6 +424,7 @@ void TXT_DrawVertScrollbar(int x, int y, int h, int cursor, int range) return; } + TXT_SaveColors(&colors); TXT_FGColor(TXT_COLOR_BLACK); TXT_BGColor(TXT_COLOR_GREY, 0); @@ -451,6 +462,7 @@ void TXT_DrawVertScrollbar(int x, int y, int h, int cursor, int range) TXT_GotoXY(x, y + h - 1); TXT_PutChar('\x19'); + TXT_RestoreColors(&colors); } void TXT_InitClipArea(void) |