From 1d530f0e310f6569f6ca4a4af98e3919bc832479 Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 25 Mar 2013 20:38:40 +0100 Subject: mp_msg: don't change text color for normal output Normal text was set to gray foreground color. This didn't work for terminals with white background. Instead of setting a color for normal text, reset the color attributes. This way, only errors and warnings are formatted differently. Also change the default color for MSGL_HINT from bold white to yellow. --- core/mp_msg.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'core') diff --git a/core/mp_msg.c b/core/mp_msg.c index e06d53c0d9..0661416c55 100644 --- a/core/mp_msg.c +++ b/core/mp_msg.c @@ -121,7 +121,7 @@ int mp_msg_test(int mod, int lev) static void set_msg_color(FILE* stream, int lev) { - static const unsigned char v_colors[10] = {9, 1, 3, 15, 7, 7, 2, 8, 8, 8}; + static const int v_colors[10] = {9, 1, 3, 3, -1, -1, 2, 8, 8, 8}; int c = v_colors[lev]; #ifdef MP_ANNOY_ME /* that's only a silly color test */ @@ -138,9 +138,15 @@ static void set_msg_color(FILE* stream, int lev) { #ifdef _WIN32 HANDLE *wstream = stream == stderr ? hSTDERR : hSTDOUT; + if (c == -1) + c = 7; SetConsoleTextAttribute(wstream, ansi2win32[c] | FOREGROUND_INTENSITY); #else - fprintf(stream, "\033[%d;3%dm", c >> 3, c & 7); + if (c == -1) { + fprintf(stream, "\033[0m"); + } else { + fprintf(stream, "\033[%d;3%dm", c >> 3, c & 7); + } #endif } } -- cgit v1.2.3