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

Function show_glyph

src/display.c:1876–2072  ·  view source on GitHub ↗

* Store the glyph in the 3rd screen for later flushing. */

Source from the content-addressed store, hash-verified

1874 * Store the glyph in the 3rd screen for later flushing.
1875 */
1876void
1877show_glyph(coordxy x, coordxy y, int glyph)
1878{
1879#ifndef UNBUFFERED_GLYPHINFO
1880 glyph_info glyphinfo;
1881#endif
1882 boolean show_glyph_change = FALSE;
1883 int oldglyph;
1884
1885 /* don't process map glyphs when saving, restoring, or in_mklev */
1886 if (_suppress_map_output())
1887 return;
1888
1889 //if (glyph == 3972 || glyph == 3988)
1890 // __debugbreak();
1891 /*
1892 * Check for bad positions and glyphs.
1893 */
1894 if (!isok(x, y)) {
1895 const char *text = "";
1896 int offset = -1;
1897
1898 /* column 0 is invalid, but it's often used as a flag, so ignore it */
1899 if (x == 0)
1900 return;
1901
1902 /*
1903 * This assumes an ordering of the offsets. See display.h for
1904 * the definition.
1905 */
1906 if (glyph < 0 || glyph >= MAX_GLYPH) {
1907 /* invalid location and also invalid glyph */
1908 text = "invalid";
1909 } else if ((offset = (glyph - GLYPH_NOTHING_OFF)) >= 0) {
1910 text = "nothing";
1911 } else if ((offset = (glyph - GLYPH_UNEXPLORED_OFF)) >= 0) {
1912 text = "unexplored";
1913 } else if ((offset = (glyph - GLYPH_STATUE_FEM_PILETOP_OFF)) >= 0) {
1914 text = "statue of a female monster at top of a pile";
1915 } else if ((offset = (glyph - GLYPH_STATUE_MALE_PILETOP_OFF)) >= 0) {
1916 text = "statue of a male monster at top of a pile";
1917 } else if ((offset = (glyph - GLYPH_BODY_PILETOP_OFF)) >= 0) {
1918 text = "body at top of a pile";
1919 } else if ((offset = (glyph - GLYPH_OBJ_PILETOP_OFF)) >= 0) {
1920 text = (glyph_is_piletop_generic_obj(glyph)
1921 ? "generic object at top of a pile"
1922 : "object at top of a pile");
1923 } else if ((offset = (glyph - GLYPH_STATUE_FEM_OFF)) >= 0) {
1924 text = "statue of female monster";
1925 } else if ((offset = (glyph - GLYPH_STATUE_MALE_OFF)) >= 0) {
1926 text = "statue of male monster";
1927 } else if ((offset = (glyph - GLYPH_WARNING_OFF)) >= 0) {
1928 /* warn flash */
1929 text = "warning explosion";
1930 } else if ((offset = (glyph - GLYPH_EXPLODE_FROSTY_OFF)) >= 0) {
1931 text = "frosty explosion";
1932 } else if ((offset = (glyph - GLYPH_EXPLODE_FIERY_OFF)) >= 0) {
1933 text = "fiery explosion";

Callers 15

detect_wsegsFunction · 0.85
map_monstFunction · 0.85
show_map_spotFunction · 0.85
reveal_terrainFunction · 0.85
show_regionFunction · 0.85
magic_map_backgroundFunction · 0.85
map_backgroundFunction · 0.85
map_trapFunction · 0.85
map_engravingFunction · 0.85
map_objectFunction · 0.85
map_invisibleFunction · 0.85
show_mon_or_warnFunction · 0.85

Calls 6

isokFunction · 0.85
map_glyphinfoFunction · 0.85
glyph_to_cmapFunction · 0.85
do_screen_descriptionFunction · 0.85
pline_xyFunction · 0.85
impossibleFunction · 0.70

Tested by

no test coverage detected