conformal:: args:: moved some arguments from config.cpp to conformal.cpp

This commit is contained in:
Zeno Rogue 2018-11-07 07:21:14 +01:00
parent a3446e8a7b
commit 3f8d17aa0d
2 changed files with 49 additions and 36 deletions

View File

@ -1533,35 +1533,6 @@ int read_config_args() {
dont_face_pc = true;
}
else if(argis("-PM")) {
PHASEFROM(2); shift(); pmodel = eModel(argi());
}
else if(argis("-ballangle")) {
PHASEFROM(2);
shift(); vid.ballangle = argf();
}
else if(argis("-topz")) {
PHASEFROM(2);
shift(); conformal::top_z = argf();
}
else if(argis("-hp")) {
PHASEFROM(2);
shift(); conformal::halfplane_scale = argf();
}
else if(argis("-mori")) {
PHASEFROM(2);
shift(); conformal::model_orientation = argf();
}
else if(argis("-mtrans")) {
PHASEFROM(2);
shift(); conformal::model_transition = argf();
}
else if(argis("-zoom")) {
PHASEFROM(2); shift(); vid.scale = argf();
}
else if(argis("-alpha")) {
PHASEFROM(2); shift(); vid.alpha = argf();
}
#if CAP_TRANS
else if(argis("-lang")) {
PHASEFROM(2); shift(); vid.language = argi();
@ -1579,12 +1550,6 @@ int read_config_args() {
if(clHeight) vid.yres = clHeight;
if(clFont) vid.fsize = clFont;
}
else if(argis("-els")) {
shift(); conformal::extra_line_steps = argf();
}
else if(argis("-stretch")) {
PHASEFROM(2); shift(); vid.stretch = argf();
}
else if(argis("-msm")) {
PHASEFROM(2); memory_saving_mode = true;
}

View File

@ -979,6 +979,54 @@ namespace conformal {
#endif
}
int readArgs() {
using namespace arg;
if(0) ;
else if(argis("-els")) {
shift(); conformal::extra_line_steps = argf();
}
else if(argis("-stretch")) {
PHASEFROM(2); shift(); vid.stretch = argf();
}
else if(argis("-PM")) {
PHASEFROM(2); shift(); pmodel = eModel(argi());
if(pmodel == mdFormula) {
shift(); basic_model = eModel(argi());
shift(); formula = args();
}
}
else if(argis("-ballangle")) {
PHASEFROM(2);
shift(); vid.ballangle = argf();
}
else if(argis("-topz")) {
PHASEFROM(2);
shift(); conformal::top_z = argf();
}
else if(argis("-hp")) {
PHASEFROM(2);
shift(); conformal::halfplane_scale = argf();
}
else if(argis("-mori")) {
PHASEFROM(2);
shift(); conformal::model_orientation = argf();
}
else if(argis("-mtrans")) {
PHASEFROM(2);
shift(); conformal::model_transition = argf();
}
else if(argis("-zoom")) {
PHASEFROM(2); shift(); vid.scale = argf();
}
else if(argis("-alpha")) {
PHASEFROM(2); shift(); vid.alpha = argf();
}
else return 1;
return 0;
}
auto hooks = addHook(clearmemory, 0, [] () {
conformal::renderAutoband();
conformal::on = false;
@ -986,7 +1034,7 @@ namespace conformal {
conformal::findhistory.clear();
conformal::movehistory.clear();
conformal::includeHistory = false;
});
}) + addHook(hooks_args, 100, readArgs);
}