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

Function glyphs_to_unicode

src/glyphs.c:1302–1317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1300}
1301
1302int
1303glyphs_to_unicode(const char *id, const char *unicode_val, long clr)
1304{
1305 struct find_struct to_unicode = zero_find;
1306
1307 to_unicode.unicode_val = unicode_val;
1308 to_unicode.callback = to_unicode_callback;
1309 /* if the color 0 is an actual color, as opposed to just "not set"
1310 we set a marker bit outside the 24-bit range to indicate a
1311 valid color value 0. That allows valid color 0, but allows a
1312 simple checking for 0 to detect "not set". The window port that
1313 implements the color switch, needs to either check that bit
1314 or appropriately mask colors with 0xFFFFFF. */
1315 to_unicode.color = (clr == -1) ? 0L : (clr == 0L) ? nonzero_black : clr;
1316 return glyph_find_core(id, &to_unicode);
1317}
1318
1319#endif /* SOME TEST STUFF */
1320

Callers 1

test_glyphnamesFunction · 0.85

Calls 1

glyph_find_coreFunction · 0.85

Tested by 1

test_glyphnamesFunction · 0.68