]> granicus.if.org Git - nethack/commitdiff
X11 - ice on black&white text map
authorPatR <rankin@nethack.org>
Mon, 6 Apr 2020 21:15:36 +0000 (14:15 -0700)
committerPatR <rankin@nethack.org>
Mon, 6 Apr 2020 21:15:36 +0000 (14:15 -0700)
Add support for black&white ice (3.7.0 feature) similar to already
supported black&white lava:  show in inverse video if it uses the
same character as floor (in the ice case; as water in the lava case).

Inverse for monster detection, black&white lava, and now black&white
ice was being done unconditionally but has been changed so that the
user can disable it by toggling the 'use_inverse' run-time option.

[Bug noticed in the process:  if you move an inverse video cursor
onto inverse video detected monster/lava/ice (when doing farlook, for
instance), the cursor disappears.  I'm not sure how to address that.]

doc/fixes37.0
win/X11/winX.c
win/X11/winmap.c

index 49b7bd2db66580892ef8e98794a353c244eda5f0..dec38a215824d35d285912eb5b3e6d0408f9a005 100644 (file)
@@ -161,6 +161,8 @@ fix door created into random wall or position opening into solid wall
        being more general; change its default to True
 X11: was still initializing map to 'stone' instead of 'unexplored' after they
        became separate glyphs
+X11: for text map without color, add support for black&white ice; draw it in
+       inverse video to distinguish from ordinary floor
 
 
 Platform- and/or Interface-Specific Fixes
index feab64a4466010bed3078a9d1bc19d2358b81271..de4849ab761ae68c9fe6d8514575cf57862780ad 100644 (file)
@@ -98,7 +98,7 @@ static XtSignalId X11_sig_id;
 /* Interface definition, for windows.c */
 struct window_procs X11_procs = {
     "X11",
-    ( WC_COLOR | WC_HILITE_PET | WC_ASCII_MAP | WC_TILED_MAP
+    ( WC_COLOR | WC_INVERSE | WC_HILITE_PET | WC_ASCII_MAP | WC_TILED_MAP
      | WC_PLAYER_SELECTION | WC_PERM_INVENT | WC_MOUSE_SUPPORT ),
     /* status requires VIA_WINDOWPORT(); WC2_FLUSH_STATUS ensures that */
     ( WC2_FLUSH_STATUS
index 74cfb4643f4785068588f239650e03da87852dd3..2d40dd6e5e66ffa7c80d91a6a5251ea944592bc2 100644 (file)
@@ -129,7 +129,8 @@ int bkglyph UNUSED;
         co_ptr = &map_info->text_map.colors[y][x];
         colordif = (((special & MG_PET) != 0 && iflags.hilite_pet)
                     || ((special & MG_OBJPILE) != 0 && iflags.hilite_pile)
-                    || ((special & (MG_DETECT | MG_BW_LAVA)) != 0))
+                    || ((special & (MG_DETECT | MG_BW_LAVA | MG_BW_ICE)) != 0
+                        && iflags.use_inverse))
                       ? CLR_MAX : 0;
         if (*co_ptr != (uchar) (color + colordif)) {
             *co_ptr = (uchar) (color + colordif);
@@ -141,9 +142,9 @@ int bkglyph UNUSED;
 
     if (update_bbox) { /* update row bbox */
         if ((uchar) x < map_info->t_start[y])
-            map_info->t_start[y] = x;
+            map_info->t_start[y] = (uchar) x;
         if ((uchar) x > map_info->t_stop[y])
-            map_info->t_stop[y] = x;
+            map_info->t_stop[y] = (uchar) x;
     }
 }