From 297d4d11e765a4f2ee8e60d7a19bdec8af1253bc Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 1 Feb 2016 21:57:35 -0500 Subject: [PATCH] ensure raw_printf has visible output Changes to be committed: modified: sys/winnt/nttty.c --- sys/winnt/nttty.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 9e6e70e70..7a77e4612 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 nttty.c $NHDT-Date: 1454282169 2016/01/31 23:16:09 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.66 $ */ +/* NetHack 3.6 nttty.c $NHDT-Date: 1454381842 2016/02/02 02:57:22 $ $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.67 $ */ /* Copyright (c) NetHack PC Development Team 1993 */ /* NetHack may be freely redistributed. See license for details. */ @@ -69,6 +69,7 @@ extern int redirect_stdout; int GUILaunched; /* Flag for whether unicode is supported */ static boolean has_unicode; +static boolean init_ttycolor_completed; #ifdef PORT_DEBUG static boolean display_cursor_info = FALSE; #endif @@ -727,6 +728,7 @@ init_ttycolor() ttycolors_inv[CLR_BRIGHT_CYAN] = BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_INTENSITY; ttycolors_inv[CLR_WHITE] = BACKGROUND_GREEN | BACKGROUND_BLUE | BACKGROUND_RED | BACKGROUND_INTENSITY; + init_ttycolor_completed = TRUE; } #endif /* TEXTCOLOR */ @@ -1025,6 +1027,9 @@ VA_DECL(const char *, fmt) if (redirect_stdout) fprintf(stdout, "%s", buf); else { + if(!init_ttycolor_completed) + init_ttycolor(); + xputs(buf); if (ttyDisplay) curs(BASE_WINDOW, console.cursor.X + 1, console.cursor.Y);