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

Function optfn_tile_height

src/options.c:4353–4383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4351}
4352
4353staticfn int
4354optfn_tile_height(
4355 int optidx, int req, boolean negated,
4356 char *opts, char *op)
4357{
4358 if (req == do_init) {
4359 return optn_ok;
4360 }
4361 if (req == do_set) {
4362 /* WINCAP tile_height:nn */
4363 op = string_for_opt(opts, negated);
4364 if ((negated && op == empty_optstr)
4365 || (!negated && op != empty_optstr)) {
4366 iflags.wc_tile_height = negated ? 0 : atoi(op);
4367 } else if (negated) {
4368 bad_negation(allopt[optidx].name, TRUE);
4369 return optn_err;
4370 }
4371 return optn_ok;
4372 }
4373 if (req == get_val || req == get_cnf_val) {
4374 if (iflags.wc_tile_height)
4375 Sprintf(opts, "%d", iflags.wc_tile_height);
4376 else if (req == get_cnf_val)
4377 opts[0] = '\0';
4378 else
4379 Strcpy(opts, defopt);
4380 return optn_ok;
4381 }
4382 return optn_ok;
4383}
4384
4385staticfn int
4386optfn_tile_width(

Callers

nothing calls this directly

Calls 2

string_for_optFunction · 0.85
bad_negationFunction · 0.85

Tested by

no test coverage detected