]> granicus.if.org Git - nethack/commitdiff
<Someone> reported a poor display result on the win32 tty
authornethack.allison <nethack.allison>
Sun, 24 Feb 2002 15:45:05 +0000 (15:45 +0000)
committernethack.allison <nethack.allison>
Sun, 24 Feb 2002 15:45:05 +0000 (15:45 +0000)
when hilite_pet was enabled.  After checking into it, the
test was looking for the value:
(FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED)
which signifies a white color on win32 console I/O. The
problem was that in some cases that was OR'd with
something else such as FOREGROUND_INTENSITY.

Fix it by checking only the bits that matter when
turning on the attribute.

sys/winnt/nttty.c

index 0b2f21e3225a7a65c888a89137b7663a47574243..f09bfdf70e36a73b774b4ff9f49e2aa82f87e2b5 100644 (file)
@@ -791,7 +791,7 @@ term_start_attr(int attr)
                 break;
         case ATR_INVERSE:
                /* Suggestion by Lee Berger */
-               if (currentcolor == (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED))
+               if (currentcolor & (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED))
                        currentcolor = 0;
                currentbackground = (BACKGROUND_RED|BACKGROUND_BLUE|BACKGROUND_GREEN);
                colorchange = TRUE;