MCPcopy Create free account
hub / github.com/NetHack/NetHack / X11_print_glyph

Function X11_print_glyph

win/X11/winmap.c:90–197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88/* Global functions ======================================================= */
89
90void
91X11_print_glyph(
92 winid window,
93 coordxy x, coordxy y,
94 const glyph_info *glyphinfo,
95 const glyph_info *bkglyphinfo)
96{
97 struct map_info_t *map_info;
98 boolean update_bbox = FALSE;
99
100 check_winid(window);
101 if (window_list[window].type != NHW_MAP) {
102 impossible("print_glyph: can (currently) only print to map windows");
103 return;
104 }
105 map_info = window_list[window].map_information;
106
107 /* update both the tile and text backing stores */
108 {
109 unsigned short *g_ptr = &map_info->tile_map.glyphs[y][x].glyph,
110 *t_ptr = &map_info->tile_map.glyphs[y][x].tileidx;
111
112 if (*g_ptr != glyphinfo->glyph) {
113 *g_ptr = glyphinfo->glyph;
114 if (map_info->is_tile)
115 update_bbox = TRUE;
116 }
117 if (*t_ptr != glyphinfo->gm.tileidx) {
118 *t_ptr = glyphinfo->gm.tileidx;
119 if (map_info->is_tile)
120 update_bbox = TRUE;
121 }
122
123 if (map_info->tile_map.glyphs[y][x].framecolor != bkglyphinfo->framecolor) {
124 map_info->tile_map.glyphs[y][x].framecolor = bkglyphinfo->framecolor;
125 update_bbox = TRUE;
126 }
127 }
128 {
129 X11_map_symbol ch;
130 X11_map_symbol *ch_ptr;
131 X11_color color;
132 unsigned special;
133 uint32 nhcolor = 0;
134 int colordif;
135 X11_color *co_ptr;
136
137 color = glyphinfo->gm.sym.color;
138 special = glyphinfo->gm.glyphflags;
139 ch = glyph_char(glyphinfo);
140
141 if (glyphinfo->gm.customcolor != 0) {
142 if ((glyphinfo->gm.customcolor & NH_BASIC_COLOR) != 0) {
143 /* NH_BASIC_COLOR */
144 color = COLORVAL(glyphinfo->gm.customcolor);
145 } else if (iflags.colorcount == 256
146 && (X11_procs.wincap2 & WC2_EXTRACOLORS) != 0
147 && (glyphinfo->gm.customcolor & NH_BASIC_COLOR) == 0) {

Callers

nothing calls this directly

Calls 3

glyph_charFunction · 0.85
impossibleFunction · 0.50

Tested by

no test coverage detected