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

Function all_options_palette

src/options.c:9657–9673  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9655
9656#ifdef CHANGE_COLOR
9657staticfn void
9658all_options_palette(strbuf_t *sbuf)
9659{
9660 int clr, n = count_alt_palette();
9661 char buf[BUFSZ];
9662
9663 if (!n)
9664 return;
9665
9666 for (clr = 0; clr < CLR_MAX; ++clr) {
9667 if (ga.altpalette[clr] != 0U) {
9668 Sprintf(buf, "OPTIONS=palette:%s/#%06x\n",
9669 clr2colorname(clr), COLORVAL(ga.altpalette[clr]));
9670 strbuf_append(sbuf, buf);
9671 }
9672 }
9673}
9674#endif /* CHANGE_COLOR */
9675
9676/* return strbuf of all options, to write to file */

Callers 1

all_options_strbufFunction · 0.85

Calls 3

count_alt_paletteFunction · 0.85
clr2colornameFunction · 0.85
strbuf_appendFunction · 0.85

Tested by

no test coverage detected