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

Function docrt_flags

src/display.c:1708–1773  ·  view source on GitHub ↗

docrt() with finer control */

Source from the content-addressed store, hash-verified

1706
1707/* docrt() with finer control */
1708void
1709docrt_flags(int refresh_flags)
1710{
1711 coordxy x, y;
1712 struct rm *lev;
1713 boolean maponly = (refresh_flags & docrtMapOnly) != 0,
1714 redrawonly = (refresh_flags & docrtRefresh) != 0,
1715 nocls = (refresh_flags & docrtNocls) != 0;
1716
1717 if (!u.ux || program_state.in_docrt)
1718 return; /* display isn't ready yet */
1719
1720 program_state.in_docrt = TRUE;
1721
1722 if (redrawonly) {
1723 redraw_map(FALSE);
1724 goto post_map;
1725 }
1726 if (u.uswallow) {
1727 swallowed(1);
1728 goto post_map;
1729 }
1730 if (Underwater && !Is_waterlevel(&u.uz)) {
1731 under_water(1);
1732 goto post_map;
1733 }
1734 if (u.uburied) { /* [not implemented] */
1735 under_ground(1);
1736 goto post_map;
1737 }
1738
1739 /* shut down vision */
1740 vision_recalc(2);
1741
1742 /*
1743 * This routine assumes that cls() does the following:
1744 * + fills the physical screen with the symbol for rock
1745 * + clears the glyph buffer
1746 */
1747 if (!nocls)
1748 cls();
1749
1750 /* display memory */
1751 for (x = 1; x < COLNO; x++) {
1752 lev = &levl[x][0];
1753 for (y = 0; y < ROWNO; y++, lev++)
1754 show_glyph(x, y, lev->glyph);
1755 }
1756
1757 /* see what is to be seen */
1758 vision_recalc(0);
1759
1760 /* overlay with monsters */
1761 see_monsters();
1762
1763 post_map:
1764
1765 if (!maponly) {

Callers 4

resize_ttyFunction · 0.85
docrtFunction · 0.85
getdirFunction · 0.85
getpos_refreshFunction · 0.85

Calls 9

redraw_mapFunction · 0.85
swallowedFunction · 0.85
under_waterFunction · 0.85
under_groundFunction · 0.85
vision_recalcFunction · 0.85
clsFunction · 0.85
show_glyphFunction · 0.85
see_monstersFunction · 0.85
update_inventoryFunction · 0.85

Tested by

no test coverage detected