MCPcopy Index your code
hub / github.com/NetHack/NetHack / clear_glyph_buffer

Function clear_glyph_buffer

src/display.c:2106–2142  ·  view source on GitHub ↗

* Turn the 3rd screen into UNEXPLORED that needs to be refreshed. */

Source from the content-addressed store, hash-verified

2104 * Turn the 3rd screen into UNEXPLORED that needs to be refreshed.
2105 */
2106void
2107clear_glyph_buffer(void)
2108{
2109 coordxy x, y;
2110 gbuf_entry *gptr = &gg.gbuf[0][0];
2111 glyph_info *giptr =
2112#ifndef UNBUFFERED_GLYPHINFO
2113 &gptr->glyphinfo;
2114#else
2115 &ginfo;
2116
2117 map_glyphinfo(0, 0, GLYPH_UNEXPLORED, 0, giptr);
2118#endif
2119#ifndef UNBUFFERED_GLYPHINFO
2120 nul_gbuf.gnew = (giptr->ttychar != nul_gbuf.glyphinfo.ttychar
2121 || giptr->gm.sym.color != nul_gbuf.glyphinfo.gm.sym.color
2122 || giptr->gm.glyphflags
2123 != nul_gbuf.glyphinfo.gm.glyphflags
2124 || giptr->gm.customcolor
2125 != nul_gbuf.glyphinfo.gm.customcolor
2126 || giptr->gm.tileidx != nul_gbuf.glyphinfo.gm.tileidx)
2127#else
2128 nul_gbuf.gnew = (giptr->ttychar != ' '
2129 || giptr->gm.sym.color != NO_COLOR
2130 || giptr->gm.customcolor != 0
2131 || (giptr->gm.glyphflags & ~MG_UNEXPL) != 0)
2132#endif
2133 ? 1 : 0;
2134 for (y = 0; y < ROWNO; y++) {
2135 gptr = &gg.gbuf[y][0];
2136 for (x = COLNO; x; x--) {
2137 *gptr++ = nul_gbuf;
2138 }
2139 gg.gbuf_start[y] = 1;
2140 gg.gbuf_stop[y] = COLNO - 1;
2141 }
2142}
2143
2144/* used by tty after menu or text popup has temporarily overwritten the map
2145 and it has been erased so shows spaces, not necessarily S_unexplored */

Callers 2

clsFunction · 0.85

Calls 1

map_glyphinfoFunction · 0.85

Tested by

no test coverage detected