introduce X11 support for coloring map frame

This commit is contained in:
nhmall
2023-01-01 20:04:27 -05:00
parent 0a03ca1e99
commit 32a030c8c6

View File

@@ -87,7 +87,7 @@ X11_print_glyph(
winid window,
coordxy x, coordxy y,
const glyph_info *glyphinfo,
const glyph_info *bkglyphinfo UNUSED)
const glyph_info *bkglyphinfo)
{
struct map_info_t *map_info;
boolean update_bbox = FALSE;
@@ -114,6 +114,11 @@ X11_print_glyph(
if (map_info->is_tile)
update_bbox = TRUE;
}
if (map_info->tile_map.glyphs[y][x].framecolor != bkglyphinfo->framecolor) {
map_info->tile_map.glyphs[y][x].framecolor = bkglyphinfo->framecolor;
update_bbox = TRUE;
}
}
{
X11_map_symbol ch;
@@ -162,6 +167,10 @@ X11_print_glyph(
if (!map_info->is_tile)
update_bbox = TRUE;
}
if (map_info->text_map.framecolors[y][x] != bkglyphinfo->framecolor) {
map_info->text_map.framecolors[y][x] = bkglyphinfo->framecolor;
update_bbox = TRUE;
}
#endif
}
@@ -1049,10 +1058,12 @@ map_all_unexplored(struct map_info_t *map_info) /* [was map_all_stone()] */
tile_map->glyphs[y][x].glyph = !x ? g_nothg : g_unexp;
tile_map->glyphs[y][x].glyphflags = 0;
tile_map->glyphs[y][x].tileidx = !x ? nothg_idx : unexp_idx;
tile_map->glyphs[y][x].framecolor = NO_COLOR;
text_map->text[y][x] = (uchar) (!x ? mgnothg : mgunexp);
#ifdef TEXTCOLOR
text_map->colors[y][x] = NO_COLOR;
text_map->framecolors[y][x] = NO_COLOR;
#endif
}
}
@@ -1425,6 +1436,13 @@ map_update(struct xwindow *wp, int start_row, int stop_row, int start_col, int s
XSetForeground(dpy, tile_map->black_gc,
BlackPixelOfScreen(screen));
}
if (tile_map->glyphs[row][cur_col].framecolor != NO_COLOR) {
XDrawRectangle(dpy, XtWindow(wp->w),
map_info->text_map.color_gcs[tile_map->glyphs[row][cur_col].framecolor],
dest_x, dest_y,
tile_map->square_width - 1 ,
tile_map->square_height - 1);
}
}
}