introduce support for coloring the frame behind a map location

Also includes support by paxed for polearm targeting using the
frame color.

Also renames USE_TILES to TILES_IN_GLYPHMAP which is a more
accurate description.

Not all window interfaces have full support for the color framing
of the background square yet.

MS-DOS needs further work (to bring it to both VESA and VGA, with
and without tiles.

Windows GUI is missing support.

X11 and Qt have been started, but may require further refinement.
This commit is contained in:
nhmall
2023-01-01 19:55:02 -05:00
parent 1972c8447f
commit 2fc0d25d45
38 changed files with 365 additions and 133 deletions

View File

@@ -132,6 +132,7 @@ int attrib_text_normal; /* text mode normal attribute */
int attrib_gr_normal; /* graphics mode normal attribute */
int attrib_text_intense; /* text mode intense attribute */
int attrib_gr_intense; /* graphics mode intense attribute */
uint32 curframecolor = NO_COLOR; /* current background text color */
boolean traditional = FALSE; /* traditonal TTY character mode */
boolean inmap = FALSE; /* in the map window */
#ifdef TEXTCOLOR
@@ -165,7 +166,7 @@ clear_screen(void)
#endif
#ifdef SCREEN_VESA
} else if (iflags.usevesa) {
vesa_clear_screen(BACKGROUND_VGA_COLOR);
vesa_clear_screen(BACKGROUND_VESA_COLOR);
#endif
}
}
@@ -302,12 +303,14 @@ term_end_attr(int attr)
default:
g_attribute = iflags.grmode ? attrib_gr_normal : attrib_text_normal;
}
curframecolor = NO_COLOR;
}
void
term_end_color(void)
{
g_attribute = iflags.grmode ? attrib_gr_normal : attrib_text_normal;
curframecolor = NO_COLOR;
}
void
@@ -370,6 +373,19 @@ term_start_color(int color)
#endif
}
void
term_start_bgcolor(int bgcolor)
{
// pline("before bgcolor = %d, curframecolor = %d", bgcolor, curframecolor);
#ifdef TEXTCOLOR
if (!monoflag) {
if (bgcolor >= 0 && bgcolor < CLR_MAX)
curframecolor = bgcolor;
}
#endif
// pline("after bgcolor = %d, curframecolor = %d", bgcolor, curframecolor);
}
void
term_start_raw_bold(void)
{
@@ -577,8 +593,12 @@ xputc(int ch) /* write out character (and attribute) */
char attribute;
i = iflags.grmode ? attrib_gr_normal : attrib_text_normal;
attribute = (char) ((g_attribute == 0) ? i : g_attribute);
if (curframecolor != NO_COLOR) {
attribute |= ((ttycolors[curframecolor]) << 4);
}
if (!iflags.grmode) {
txt_xputc(ch, attribute);
#ifdef SCREEN_VGA
@@ -594,17 +614,17 @@ xputc(int ch) /* write out character (and attribute) */
}
/* write out a glyph picture at current location */
void xputg(const glyph_info *glyphinfo)
void xputg(const glyph_info *glyphinfo, const glyph_info *bkglyphinfo)
{
if (!iflags.grmode || !iflags.tile_view) {
(void) xputc((char) glyphinfo->ttychar);
#ifdef SCREEN_VGA
} else if (iflags.grmode && iflags.usevga) {
vga_xputg(glyphinfo);
vga_xputg(glyphinfo, bkglyphinfo);
#endif
#ifdef SCREEN_VESA
} else if (iflags.grmode && iflags.usevesa) {
vesa_xputg(glyphinfo);
vesa_xputg(glyphinfo, bkglyphinfo);
#endif
}
}