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

Function optfn_palette

src/options.c:2698–2730  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2696DISABLE_WARNING_FORMAT_NONLITERAL
2697
2698staticfn int
2699optfn_palette(
2700 int optidx UNUSED, int req, boolean negated UNUSED,
2701 char *opts, char *op)
2702{
2703 if (req == do_init) {
2704 return optn_ok;
2705 }
2706 if (req == do_set) {
2707 if (op == empty_optstr)
2708 return optn_err;
2709
2710 if (match_optname(opts, "palette", 3, TRUE)) {
2711 /*
2712 * palette (adjust an RGB color in palette (color/R-G-B)
2713 */
2714 if (!alternative_palette(op)) {
2715 config_error_add("Error in palette parameter '%s'", op);
2716 return optn_err;
2717 }
2718 if (!go.opt_initial)
2719 go.opt_update_basic_palette = TRUE;
2720 }
2721 return optn_ok;
2722 }
2723 if (req == get_val || req == get_cnf_val) {
2724 if (!opts)
2725 return optn_err;
2726 Sprintf(opts, n_currently_set, count_alt_palette());
2727 return optn_ok;
2728 }
2729 return optn_ok;
2730}
2731
2732#if 0
2733/* old MACOS9 OS9 code */

Callers

nothing calls this directly

Calls 5

alternative_paletteFunction · 0.85
config_error_addFunction · 0.85
count_alt_paletteFunction · 0.85
complain_about_duplicateFunction · 0.85
match_optnameFunction · 0.70

Tested by

no test coverage detected