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

Function optfn_IBMgraphics

src/options.c:1905–1960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1903}
1904
1905staticfn int
1906optfn_IBMgraphics(
1907 int optidx, int req, boolean negated,
1908 char *opts, char *op UNUSED)
1909{
1910#ifdef BACKWARD_COMPAT
1911 const char *sym_name = allopt[optidx].name;
1912 boolean badflag = FALSE;
1913 int i;
1914#endif
1915
1916 if (req == do_init) {
1917 return optn_ok;
1918 }
1919 if (req == do_set) {
1920 /* "IBMgraphics" */
1921
1922#ifdef BACKWARD_COMPAT
1923
1924 if (!negated) {
1925 for (i = 0; i < NUM_GRAPHICS; ++i) {
1926 if (gs.symset[i].name) {
1927 badflag = TRUE;
1928 } else {
1929 if (i == ROGUESET)
1930 sym_name = "RogueIBM";
1931 gs.symset[i].name = dupstr(sym_name);
1932 if (!read_sym_file(i)) {
1933 badflag = TRUE;
1934 clear_symsetentry(i, TRUE);
1935 break;
1936 }
1937 }
1938 }
1939 if (badflag) {
1940 config_error_add("Failure to load symbol set %s.", sym_name);
1941 return optn_err;
1942 } else {
1943 switch_symbols(TRUE);
1944 if (!go.opt_initial && Is_rogue_level(&u.uz))
1945 assign_graphics(ROGUESET);
1946 }
1947 }
1948 return optn_ok;
1949#else
1950 config_error_add("'%s' no longer supported; use 'symset:%s' instead",
1951 allopt[optidx].name, allopt[optidx].name);
1952 return optn_err;
1953#endif
1954 }
1955 if (req == get_val || req == get_cnf_val) {
1956 opts[0] = '\0';
1957 return optn_ok;
1958 }
1959 return optn_ok;
1960}
1961
1962staticfn int

Callers

nothing calls this directly

Calls 6

dupstrFunction · 0.85
read_sym_fileFunction · 0.85
clear_symsetentryFunction · 0.85
config_error_addFunction · 0.85
switch_symbolsFunction · 0.85
assign_graphicsFunction · 0.85

Tested by

no test coverage detected