]> granicus.if.org Git - nethack/commitdiff
remove mapglyph() remnants from win/curses/
authorPatR <rankin@nethack.org>
Sat, 2 Jan 2021 18:46:17 +0000 (10:46 -0800)
committerPatR <rankin@nethack.org>
Sat, 2 Jan 2021 18:46:17 +0000 (10:46 -0800)
Remove a couple of leftover references to mapglyph() from the
curses code (present inside '#if 0' blocks).  I've tried to
substitute code which should work but have no idea whether it
actually will.

win/curses/cursdial.c
win/curses/cursinvt.c

index df0f38c344b993942f3b937161367d56408bc6e8..19996e2794a3ed88be7f9d9a10d5f87af2ef85af 100644 (file)
@@ -1180,10 +1180,11 @@ menu_display_page(nhmenu *menu, WINDOW * win, int page_num, char *selectors)
 #if 0
         /* FIXME: menuglyphs not implemented yet */
         if (menu_item_ptr->glyph != NO_GLYPH && iflags.use_menu_glyphs) {
-            unsigned special;  /*notused */
+            unsigned glyphmod[NUM_GLYPHMOD];
+
+            map_glyphmod(0, 0, menu_item_ptr->glyph, 0U, glyphmod);
+            color = (int) glyphmod[GM_COLOR];
 
-            /*mapglyph(menu_item_ptr->glyph, &curletter, &color, &special,
-                       0, 0, 0);*/
             curses_toggle_color_attr(win, color, NONE, ON);
             mvwaddch(win, menu_item_ptr->line_num + 1, start_col, curletter);
             curses_toggle_color_attr(win, color, NONE, OFF);
index 71d9e6c1b7761299cbec3eb043fefeff2d5ee7d1..8c77829e8bd9319ae1e1a98d7d93390e2f25aadd 100644 (file)
@@ -120,12 +120,14 @@ curses_add_inv(int y,
     }
 #if 0 /* FIXME: MENU GLYPHS */
     if (accelerator && glyph != NO_GLYPH && iflags.use_menu_glyphs) {
-        unsigned dummy = 0; /* Not used */
-        int color = 0;
-        int symbol = 0;
+        unsigned glyphmod[NUM_GLYPHMOD];
+        int symbol;
         attr_t glyphclr;
 
-        /* mapglyph(glyph, &symbol, &color, &dummy, u.ux, u.uy, 0); */
+        map_glyphmod(0, 0, glyph, 0U, glyphmod);
+        symbol = (int) glyphmod[GM_TTYCHAR];
+        color = (int) glyphmod[GM_COLOR];
+
         glyphclr = curses_color_attr(color, 0);
         wattron(win, glyphclr);
         wprintw(win, "%c ", symbol);