window port routines to perform the desired task, instead of duplicating
the necessary code in each window port.
-int mapglyph(int glyph, int *ochar, int *ocolor, unsigned *special, int x, int y)
+int mapglyph(int glyph, int *ochar, int *ocolor, unsigned *special,
+ int x, int y, unsigned mgflags)
-- Maps glyph at x,y to NetHack ascii character and color.
The return value is an index into the showsyms[] array, in
case a port wants to index into its own alternative
/* ### mapglyph.c ### */
-E int FDECL(mapglyph, (int, int *, int *, unsigned *, int, int));
+E int FDECL(mapglyph, (int, int *, int *, unsigned *, int, int, unsigned));
E char *FDECL(encglyph, (int));
E char *FDECL(decode_mixed, (char *, const char *));
E void FDECL(genl_putmixed, (winid, int, const char *));
DISMOUNT_BYCHOICE = 6
};
+/* mgflags for mapglyph() */
+#define MG_FLAG_NORMAL 0x00
+#define MG_FLAG_NOOVERRIDE 0x01
+
/* Special returns from mapglyph() */
#define MG_CORPSE 0x01
#define MG_INVIS 0x02
glyph = reveal_terrain_getglyph(x, y, FALSE, u.uswallow,
default_glyph, subset);
- (void) mapglyph(glyph, &ch, &color, &special, x, y);
+ (void) mapglyph(glyph, &ch, &color, &special, x, y, 0);
buf[x - 1] = ch;
if (ch != ' ') {
blankrow = FALSE;
/*ARGSUSED*/
int
-mapglyph(glyph, ochar, ocolor, ospecial, x, y)
+mapglyph(glyph, ochar, ocolor, ospecial, x, y, mgflags)
int glyph, *ocolor, x, y;
int *ochar;
unsigned *ospecial;
+unsigned mgflags;
{
register int offset, idx;
int color = NO_COLOR;
}
/* These were requested by a blind player to enhance screen reader use */
- if (sysopt.accessibility == 1) {
+ if (sysopt.accessibility == 1 && !(mgflags & MG_FLAG_NOOVERRIDE)) {
int ovidx;
if ((special & MG_PET) != 0) {
gv = (gv * 16) + ((int) (dp - hex) / 2);
else
break;
- so = mapglyph(gv, &ch, &oc, &os, 0, 0);
+ so = mapglyph(gv, &ch, &oc, &os, 0, 0, 0);
*put++ = showsyms[so];
/* 'str' is ready for the next loop iteration and '*str'
should not be copied at the end of this iteration */
glyph = glyph_at(cc.x, cc.y);
/* Convert glyph at selected position to a symbol for use below. */
- (void) mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y);
+ (void) mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y, 0);
Sprintf(prefix, "%s ", encglyph(glyph));
} else
if (looked) {
int oc = 0, idx = SYM_PET_OVERRIDE + SYM_OFF_X;
unsigned os = 0;
- nhsym save_override;
-
- if (Is_rogue_level(&u.uz)) {
- save_override = ov_rogue_syms[idx];
- ov_rogue_syms[idx] = 0;
- } else {
- save_override = ov_primary_syms[idx];
- ov_primary_syms[idx] = 0;
- }
+
/* convert to symbol without override in effect */
- (void) mapglyph(glyph, &sym, &oc, &os, cc.x, cc.y);
- if (Is_rogue_level(&u.uz))
- ov_rogue_syms[idx] = save_override;
- else
- ov_primary_syms[idx] = save_override;
+ (void) mapglyph(glyph, &sym, &oc, &os,
+ cc.x, cc.y, MG_FLAG_NOOVERRIDE);
goto check_monsters;
}
break;
} else /* AMII, or Rogue level in either version */
{
/* map glyph to character and color */
- (void) mapglyph(glyph, &och, &color, &special, x, y);
+ (void) mapglyph(glyph, &och, &color, &special, x, y, 0);
ch = (uchar) och;
if (WINVERS_AMIV) { /* implies Rogue level here */
amii_curs(win, x, y);
#else
/* rely on NetHack core helper routine */
(void) mapglyph(data->map[i][j], &mgch, &color,
- &special, i, j);
+ &special, i, j, 0);
ch = (char) mgch;
if (((special & MG_PET) && iflags.hilite_pet)
|| ((special & MG_DETECT)
painter.setPen( green );
/* map glyph to character and color */
- (void)mapglyph(g, &och, &color, &special, i, j);
+ (void)mapglyph(g, &och, &color, &special, i, j, 0);
ch = (uchar)och;
#ifdef TEXTCOLOR
painter.setPen( nhcolor_to_pen(color) );
painter.setPen( Qt::green );
/* map glyph to character and color */
- mapglyph(g, &ch, &color, &special, i, j);
+ mapglyph(g, &ch, &color, &special, i, j, 0);
ch = cp437(ch);
#ifdef TEXTCOLOR
painter.setPen( nhcolor_to_pen(color) );
int color;
int ch;
unsigned special;
- mapglyph(g, &ch, &color, &special, i, j);
+ mapglyph(g, &ch, &color, &special, i, j, 0);
qt_settings->glyphs().drawCell(painter, g, i, j);
#ifdef TEXTCOLOR
if (((special & MG_PET) != 0) && ::iflags.hilite_pet) {
painter.setPen( Qt::green );
/* map glyph to character and color */
- mapglyph(g, &ch, &color, &special, i, j);
+ mapglyph(g, &ch, &color, &special, i, j, 0);
#ifdef TEXTCOLOR
painter.setPen( nhcolor_to_pen(color) );
#endif
int color;
int ch;
unsigned special;
- mapglyph(g, &ch, &color, &special, i, j);
+ mapglyph(g, &ch, &color, &special, i, j, 0);
qt_settings->glyphs().drawCell(painter, g, i, j);
#ifdef TEXTCOLOR
if (((special & MG_PET) != 0) && ::iflags.hilite_pet) {
#endif
/* map glyph to character and color */
- (void) mapglyph(glyph, &och, &color, &special, x, y);
+ (void) mapglyph(glyph, &och, &color, &special, x, y, 0);
ch = (uchar) och;
if (special != map_info->tile_map.glyphs[y][x].special) {
if (menu_item_ptr->glyph != NO_GLYPH && iflags.use_menu_glyphs) {
unsigned special; /*notused */
- mapglyph(menu_item_ptr->glyph, &curletter, &color, &special, 0, 0);
+ 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);
int symbol = 0;
attr_t glyphclr;
- mapglyph(glyph, &symbol, &color, &dummy, u.ux, u.uy);
+ mapglyph(glyph, &symbol, &color, &dummy, u.ux, u.uy, 0);
glyphclr = curses_color_attr(color, 0);
wattron(win, glyphclr);
wprintw(win, "%c ", symbol);
int attr = -1;
/* map glyph to character and color */
- mapglyph(glyph, &ch, &color, &special, x, y);
+ mapglyph(glyph, &ch, &color, &special, x, y, 0);
if ((special & MG_PET) && iflags.hilite_pet) {
attr = iflags.wc2_petattr;
}
unsigned special;
/* map glyph to character and color */
- (void) mapglyph(glyph, &ch, &color, &special, x, y);
+ (void) mapglyph(glyph, &ch, &color, &special, x, y, 0);
#ifdef TEXTCOLOR
/* Turn off color if rogue level. */
}
#endif
/* map glyph to character and color */
- (void) mapglyph(glyph, &ch, &color, &special, x, y);
+ (void) mapglyph(glyph, &ch, &color, &special, x, y, 0);
print_vt_code2(AVTC_SELECT_WINDOW, window);
mgch = ' ';
} else {
(void) mapglyph(data->map[col][row], &mgch, &color,
- &special, col, row);
+ &special, col, row, 0);
}
msg_data->buffer[index] = mgch;
index++;
#ifdef USE_PILEMARK
/* rely on NetHack core helper routine */
(void) mapglyph(data->map[i][j], &mgch, &color, &special,
- i, j);
+ i, j, 0);
if ((glyph != NO_GLYPH) && (special & MG_PET)
#else
if ((glyph != NO_GLYPH) && glyph_is_pet(glyph)
#else
/* rely on NetHack core helper routine */
(void) mapglyph(data->map[i][j], &mgch, &color,
- &special, i, j);
+ &special, i, j, 0);
ch = (char) mgch;
if (((special & MG_PET) && iflags.hilite_pet)
|| ((special & (MG_DETECT | MG_BW_LAVA))
ochar = GOLD_SYM;
else
mapglyph(objnum_to_glyph(GOLD_PIECE),
- &ochar, &ocolor, &ospecial, 0, 0);
+ &ochar, &ocolor, &ospecial, 0, 0, 0);
buf[0] = ochar;
p = strchr(text, ':');
if (p) {