added missing CAP_COMMANDLINE guards, and other fixes for non-CAP_COMMANDLINE

This commit is contained in:
Zeno Rogue 2021-05-29 12:15:50 +02:00
parent 83070fe50c
commit 334bf12292
4 changed files with 9 additions and 5 deletions

View File

@ -865,8 +865,10 @@ EX namespace bt {
ld co = vid.binary_width / log(2) / 8;
return point3(log(2) + log(-h[0]), h[1] / co, h[2] / co);
}
#if CAP_COMMANDLINE
auto bt_config = arg::add2("-btwidth", [] {arg::shift_arg_formula(vid.binary_width); });
#endif
EX bool pseudohept(cell *c) {
if(WDIM == 2)

View File

@ -428,9 +428,9 @@ EX }
#if !CAP_COMMANDLINE
EX namespace arg {
EX int add1(const string& s, const reaction_t& r) { }
EX int add2(const string& s, const reaction_t& r) { }
EX int add3(const string& s, const reaction_t& r) { }
EX int add1(const string& s, const reaction_t& r) { return 0; }
EX int add2(const string& s, const reaction_t& r) { return 0; }
EX int add3(const string& s, const reaction_t& r) { return 0; }
EX }
#endif
}

View File

@ -238,6 +238,7 @@ EX modecode_t legacy_modecode() {
return mct;
}
#if CAP_COMMANDLINE
/* legacy options */
int read_legacy_args() {
using namespace arg;
@ -272,6 +273,7 @@ int read_legacy_args() {
}
auto ah_legacy = addHook(hooks_args, 0, read_legacy_args);
#endif
}

View File

@ -1807,7 +1807,7 @@ auto animhook = addHook(hooks_frame, 100, display_animation)
#if CAP_COMMANDLINE
+ addHook(hooks_args, 100, readArgs)
#endif
+ addHook(hooks_config, 100, [] {
+ addHook(hooks_configfile, 100, [] {
#if CAP_CONFIG
param_f(anims::period, "aperiod", "animation period");
addsaver(anims::noframes, "animation frames");