From: PatR Date: Sat, 2 Jan 2021 18:46:17 +0000 (-0800) Subject: remove mapglyph() remnants from win/curses/ X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b815c470ecc44894a6b38870ed0c03cf9b6eea92;p=nethack remove mapglyph() remnants from win/curses/ 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. --- diff --git a/win/curses/cursdial.c b/win/curses/cursdial.c index df0f38c34..19996e279 100644 --- a/win/curses/cursdial.c +++ b/win/curses/cursdial.c @@ -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); diff --git a/win/curses/cursinvt.c b/win/curses/cursinvt.c index 71d9e6c1b..8c77829e8 100644 --- a/win/curses/cursinvt.c +++ b/win/curses/cursinvt.c @@ -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);