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

@@ -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 */