add an mgflags parameter to mapglyph() to alter how it behaves internally

avoid a recent save-value,call,restore-value kludge by adding
an mgflags parameter to mapglyph() to control its behavior

 Changes to be committed:
	modified:   doc/window.doc
	modified:   include/extern.h
	modified:   include/hack.h
	modified:   src/detect.c
	modified:   src/mapglyph.c
	modified:   src/pager.c
	modified:   sys/amiga/winfuncs.c
	modified:   sys/wince/mhmap.c
	modified:   win/Qt/qt_win.cpp
	modified:   win/Qt4/qt4map.cpp
	modified:   win/X11/winmap.c
	modified:   win/curses/cursdial.c
	modified:   win/curses/cursinvt.c
	modified:   win/curses/cursmain.c
	modified:   win/gem/wingem.c
	modified:   win/tty/wintty.c
	modified:   win/win32/mhmap.c
	modified:   win/win32/mswproc.c
This commit is contained in:
nhmall
2019-11-16 22:49:36 -05:00
parent 2a07924063
commit a364348098
18 changed files with 32 additions and 37 deletions

View File

@@ -1934,7 +1934,7 @@ dump_map()
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;

View File

@@ -59,10 +59,11 @@ static const int explcolors[] = {
/*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;
@@ -223,7 +224,7 @@ unsigned *ospecial;
}
/* 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) {
@@ -300,7 +301,7 @@ const char *str;
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 */

View File

@@ -826,7 +826,7 @@ struct permonst **for_supplement;
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
@@ -1055,21 +1055,10 @@ struct permonst **for_supplement;
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;