more window port interface adjustments

further adjustments to the window port interface to pass a pointer
to a glyph_info struct which describes not just the glyph number
itself, but also the ttychar, the color, the glyphflags, and the
symset index.

This affects two existing window port calls that get passed glyphs
and does the parameter consistently for both of them using the
glyph_info struct pointer:
	print_glyph()
	add_menu().

The recently added glyphmod parameter is now unnecessary and has been
removed.
This commit is contained in:
nhmall
2021-01-05 10:09:37 -05:00
parent 2a9a18fa2f
commit c9673b3d9e
63 changed files with 841 additions and 705 deletions
+14 -15
View File
@@ -73,12 +73,11 @@ static void FDECL(display_cursor, (struct xwindow *));
/* Global functions ======================================================= */
void
X11_print_glyph(window, x, y, glyph, bkglyph, glyphmod)
X11_print_glyph(window, x, y, glyphinfo, bkglyphinfo)
winid window;
xchar x, y;
int glyph;
int bkglyph UNUSED;
unsigned *glyphmod UNUSED;
const glyph_info *glyphinfo;
const glyph_info *bkglyphinfo UNUSED;
{
struct map_info_t *map_info;
boolean update_bbox = FALSE;
@@ -94,8 +93,8 @@ unsigned *glyphmod UNUSED;
{
unsigned short *t_ptr = &map_info->tile_map.glyphs[y][x].glyph;
if (*t_ptr != glyph) {
*t_ptr = glyph;
if (*t_ptr != glyphinfo->glyph) {
*t_ptr = glyphinfo->glyph;
if (map_info->is_tile)
update_bbox = TRUE;
}
@@ -110,13 +109,13 @@ unsigned *glyphmod UNUSED;
register unsigned char *co_ptr;
#endif
color = glyphmod[GM_COLOR];
special = glyphmod[GM_FLAGS];
och = glyphmod[GM_TTYCHAR];
color = glyphinfo->color;
special = glyphinfo->glyphflags;
och = glyphinfo->ttychar;
ch = (uchar) och;
if (special != map_info->tile_map.glyphs[y][x].special) {
map_info->tile_map.glyphs[y][x].special = special;
if (special != map_info->tile_map.glyphs[y][x].glyphflags) {
map_info->tile_map.glyphs[y][x].glyphflags = special;
update_bbox = TRUE;
}
@@ -948,7 +947,7 @@ struct map_info_t *map_info;
for (x = 0; x < COLNO; x++)
for (y = 0; y < ROWNO; y++) {
tile_map->glyphs[y][x].glyph = !x ? g_nothg : g_unexp;
tile_map->glyphs[y][x].special = 0;
tile_map->glyphs[y][x].glyphflags = 0;
text_map->text[y][x] = (uchar) (!x ? mgnothg : mgunexp);
#ifdef TEXTCOLOR
@@ -1297,7 +1296,7 @@ boolean inverted;
int dest_x = (cur_col - COL0_OFFSET) * tile_map->square_width;
int dest_y = row * tile_map->square_height;
if ((tile_map->glyphs[row][cur_col].special & MG_FEMALE))
if ((tile_map->glyphs[row][cur_col].glyphflags & MG_FEMALE))
tile++; /* advance to the female tile variation */
src_x = (tile % TILES_PER_ROW) * tile_width;
src_y = (tile / TILES_PER_ROW) * tile_height;
@@ -1306,7 +1305,7 @@ boolean inverted;
src_x, src_y, tile_width, tile_height,
dest_x, dest_y);
if (glyph_is_pet(glyph) && iflags.hilite_pet) {
if ((tile_map->glyphs[row][cur_col].glyphflags & MG_PET) && iflags.hilite_pet) {
/* draw pet annotation (a heart) */
XSetForeground(dpy, tile_map->black_gc,
pet_annotation.foreground);
@@ -1321,7 +1320,7 @@ boolean inverted;
XSetForeground(dpy, tile_map->black_gc,
BlackPixelOfScreen(screen));
}
if ((tile_map->glyphs[row][cur_col].special & MG_OBJPILE)) {
if ((tile_map->glyphs[row][cur_col].glyphflags & MG_OBJPILE)) {
/* draw object pile annotation (a plus sign) */
XSetForeground(dpy, tile_map->black_gc,
pile_annotation.foreground);