]> granicus.if.org Git - nethack/commitdiff
some dead code eliminations and a couple of documentation updates
authornhmall <nhmall@nethack.org>
Sat, 30 Nov 2019 18:35:14 +0000 (13:35 -0500)
committernhmall <nhmall@nethack.org>
Sat, 30 Nov 2019 18:35:14 +0000 (13:35 -0500)
doc/fixes36.3
doc/window.doc
sys/winnt/nttty.c
win/tty/termcap.c

index 0f584ac0e661540b71ab347937ff984b9fbf14d2..8fa4afc0af1ab927644c82aacda06e7354845f9e 100644 (file)
@@ -315,6 +315,11 @@ clairvoyance showed all monsters in range, then after player viewed the map,
        object at same spot, so skip it for locations where monster refresh
        is going to immediately redisplay a monster
 take holes that you avoided into consideration when you're on the brink
+update window port spec to include a color-availability table that the window
+       port can set; merge all has_color() implementations into one central
+       function in src/windows.c which uses a few data checks only and
+       elminates multiple string function calls for each map cell update
+       that were being done in some cases previously
 unix: fix double DLB definition in linux hints file
 windows: fix --showpaths output for the data file which relies on being
        constructed programmatically to incorporate the version suffix
index da1790253d2741bb6f87abf57fdb1846537442c9..3758bf55b65dd54d1c7a47720b4ef8f12e604efb 100644 (file)
@@ -663,6 +663,10 @@ port can access the fields directly.
 
 Your window port identifies what options it will react to and support
 by setting bits in the window_procs wincap mask and/or wincap2 mask. 
+Your window port can also fill in the color-availability table for
+the window port, has_color[CLR_MAX] to flag the colors it supports 
+1 it does, or 0 it doesn't. [CLR_MAX is 16 as of 3.6.3.]
+
 See section IX for details of where the wincap masks reside. 
 
 Two things control whether any preference setting appears in the 
index df817e6c9d2ac1e2bfe12fa01f2a432eccd4b39a..8a52fb6837ab7e0b92bc3ed18af28c3fa4c99bcd 100644 (file)
@@ -792,7 +792,7 @@ init_ttycolor()
 
 #if 0
 int
-has_color(int color)
+has_color(int color)        /* this function is commented out */
 {
 #ifdef TEXTCOLOR
     if ((color >= 0) && (color < CLR_MAX))
index 4d2ac1f6211aefe177eed9189f0775f329bcc0db..09a0be55e00983a342e478d5dd59389b532e320d 100644 (file)
@@ -1282,44 +1282,6 @@ int color;
         xputs(hilites[color]);
 }
 
-#if 0
-/* Replaced by src/windows.c general proc or a macro in 3.6.3 */
-
-/* not to be confused with has_colors() in unixtty.c */
-int
-has_color(color)
-int color;
-{
-#ifdef X11_GRAPHICS
-    /* XXX has_color() should be added to windowprocs */
-    if (windowprocs.name != NULL && !strcmpi(windowprocs.name, "X11"))
-        return 1;
-#endif
-#ifdef GEM_GRAPHICS
-    /* XXX has_color() should be added to windowprocs */
-    if (windowprocs.name != NULL && !strcmpi(windowprocs.name, "Gem"))
-        return 1;
-#endif
-#ifdef QT_GRAPHICS
-    /* XXX has_color() should be added to windowprocs */
-    if (windowprocs.name != NULL && !strcmpi(windowprocs.name, "Qt"))
-        return 1;
-#endif
-#ifdef CURSES_GRAPHICS
-    /* XXX has_color() should be added to windowprocs */
-    /* iflags.wc_color is set to false and the option disabled if the
-     terminal cannot display color */
-    if (windowprocs.name != NULL && !strcmpi(windowprocs.name, "curses"))
-        return iflags.wc_color;
-#endif
-#ifdef AMII_GRAPHICS
-    /* hilites[] not used */
-    return iflags.use_color ? 1 : 0;
-#else
-    return hilites[color] != (char *) 0;
-#endif
-}
-#endif /* 0 */
 #endif /* TEXTCOLOR */
 
 #endif /* TTY_GRAPHICS && !NO_TERMS */