1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 09:00:34 +00:00

arg:: shift_arg_formula used instead of argf

This commit is contained in:
Zeno Rogue 2018-11-09 14:26:31 +01:00
parent a6b8d4f79a
commit 549d86b15d
12 changed files with 55 additions and 53 deletions

View File

@ -211,7 +211,7 @@ namespace binary {
auto bt_config = addHook(hooks_args, 0, [] () {
using namespace arg;
if(argis("-btwidth")) {
shift(); vid.binary_width = argf();
shift_arg_formula(vid.binary_width);
need_reset_geometry = true;
return 0;
}

View File

@ -1642,7 +1642,7 @@ int read_config_args() {
PHASEFROM(2); shift(); dialog::dialogcolor = arghex();
}
else if(argis("-aa")) { PHASEFROM(2); shift(); vid.antialias = argi(); }
else if(argis("-lw")) { PHASEFROM(2); shift(); vid.linewidth = argf(); }
else if(argis("-lw")) { PHASEFROM(2); shift_arg_formula(vid.linewidth); }
else if(argis("-wm")) { PHASEFROM(2); shift(); vid.wallmode = argi(); }
else if(argis("-mm")) { PHASEFROM(2); shift(); vid.monmode = argi(); }

View File

@ -974,10 +974,10 @@ namespace conformal {
if(0) ;
else if(argis("-els")) {
shift(); conformal::extra_line_steps = argf();
shift_arg_formula(conformal::extra_line_steps);
}
else if(argis("-stretch")) {
PHASEFROM(2); shift(); vid.stretch = argf();
PHASEFROM(2); shift_arg_formula(vid.stretch);
}
else if(argis("-PM")) {
PHASEFROM(2); shift(); pmodel = eModel(argi());
@ -988,37 +988,37 @@ namespace conformal {
}
else if(argis("-ballangle")) {
PHASEFROM(2);
shift(); vid.ballangle = argf();
shift_arg_formula(vid.ballangle);
}
else if(argis("-topz")) {
PHASEFROM(2);
shift(); conformal::top_z = argf();
shift_arg_formula(conformal::top_z);
}
else if(argis("-hp")) {
PHASEFROM(2);
shift(); conformal::halfplane_scale = argf();
shift_arg_formula(conformal::halfplane_scale);
}
else if(argis("-mori")) {
PHASEFROM(2);
shift(); conformal::model_orientation = argf();
shift_arg_formula(conformal::model_orientation);
}
else if(argis("-mtrans")) {
PHASEFROM(2);
shift(); conformal::model_transition = argf();
shift_arg_formula(conformal::model_transition);
}
else if(argis("-sang")) {
PHASEFROM(2);
shift(); conformal::spiral_angle = argf();
shift_arg_formula(conformal::spiral_angle);
}
else if(argis("-mob")) {
PHASEFROM(2);
shift(); vid.skiprope = argf();
shift_arg_formula(vid.skiprope);
}
else if(argis("-zoom")) {
PHASEFROM(2); shift(); vid.scale = argf();
PHASEFROM(2); shift_arg_formula(vid.scale);
}
else if(argis("-alpha")) {
PHASEFROM(2); shift(); vid.alpha = argf();
PHASEFROM(2); shift_arg_formula(vid.alpha);
}
else return 1;
return 0;

View File

@ -527,15 +527,15 @@ int read_cheat_args() {
}
else if(argis("-we")) {
PHASEFROM(2);
shift(); whatever = argf(); resetGeometry();
shift_arg_formula(whatever); resetGeometry();
}
else if(argis("-wei")) {
PHASEFROM(2);
shift(); whateveri = argf(); resetGeometry();
shift(); whateveri = argi(); resetGeometry();
}
else if(argis("-wei2")) {
PHASEFROM(2);
shift(); whateveri2 = argf(); resetGeometry();
shift(); whateveri2 = argi(); resetGeometry();
}
else if(argis("-W3")) {
shift(); top_land = readland(args()); cheat();
@ -563,7 +563,7 @@ int read_cheat_args() {
else if(argis("-smart")) {
PHASEFROM(2); cheat();
vid.use_smart_range = 2;
shift(); vid.smart_range_detail = argf();
shift_arg_formula(vid.smart_range_detail);
}
else if(argis("-smartlimit")) {
PHASEFROM(2);

View File

@ -2067,6 +2067,8 @@ namespace arg {
ld argf();
bool argis(const string& s);
unsigned arghex();
inline void shift_arg_formula(ld& x) { shift(); x = argf(); }
void init(int _argc, char **_argv);

View File

@ -1012,7 +1012,7 @@ int readArgs() {
}
else if(argis("-irrdens")) {
PHASE(2);
shift(); density = argf();
shift_arg_formula(density);
}
else if(argis("-irrload")) {
PHASE(3);

View File

@ -222,9 +222,9 @@ int readArgs() {
shift(); funmode = argi();
shift(); color1 = arghex();
shift(); color2 = arghex();
shift(); widthfactor = argf();
shift(); label_scale = argf();
shift(); label_dist = argf();
shift_arg_formula(widthfactor);
shift_arg_formula(label_scale);
shift_arg_formula(label_dist);
}
else return 1;
return 0;

View File

@ -1353,10 +1353,10 @@ int readArgs() {
shift(); qpct = argi();
}
else if(argis("-sompower")) {
shift(); ttpower = argf();
shift_arg_formula(ttpower);
}
else if(argis("-somparam")) {
shift(); (gaussian ? distmul : dispersion_end_at) = argf();
shift_arg_formula((gaussian ? distmul : dispersion_end_at));
if(dispersion_end_at <= 1) {
fprintf(stderr, "Dispersion parameter illegal\n");
dispersion_end_at = 1.5;
@ -1372,7 +1372,7 @@ int readArgs() {
}
else if(argis("-somlearn")) {
// this one can be changed at any moment
shift(); learning_factor = argf();
shift_arg_formula(learning_factor);
}
else if(argis("-somrun")) {

View File

@ -1624,16 +1624,16 @@ int readArgs() {
// (1) configure edge weights
else if(argis("-edgepower")) {
shift(); sag::edgepower = argf();
shift(); sag::edgemul = argf();
shift_arg_formula(sag::edgepower);
shift_arg_formula(sag::edgemul);
}
// (1) configure temperature (high, low)
else if(argis("-sagtemp")) {
shift(); sag::hightemp = argf();
shift(); sag::lowtemp = argf();
shift(); sag::hightemp = argi();
shift(); sag::lowtemp = argi();
}
else if(argis("-sagmin")) {
shift(); default_edgetype.visible_from = argf();
shift_arg_formula(default_edgetype.visible_from);
}
// (2) read the edge data
else if(argis("-sagpar")) {
@ -1743,13 +1743,13 @@ int readArgs() {
shift(); part(default_edgetype.color, 0) = 255 * pow(.5, argf());
}
else if(argis("-cshift")) {
shift(); collatz::cshift = argf();
shift_arg_formula(collatz::cshift);
}
else if(argis("-rvwarp")) {
patterns::whichShape = '8';
}
else if(argis("-lq")) {
shift(); linequality = argf();
shift_arg_formula(linequality);
}
#if CAP_RVSLIDES
else if(argis("-rvpres")) {

10
rug.cpp
View File

@ -1877,7 +1877,7 @@ int rugArgs() {
if(0) ;
else if(argis("-rugmodelscale")) {
shift(); modelscale = argf();
shift_arg_formula(modelscale);
}
else if(argis("-ruggeo")) {
@ -1893,7 +1893,7 @@ int rugArgs() {
}
else if(argis("-rugdist")) {
shift(); model_distance = argf();
shift_arg_formula(model_distance);
}
else if(argis("-ruglate")) {
@ -1906,7 +1906,7 @@ int rugArgs() {
}
else if(argis("-rugauto")) {
shift(); ruggo = argf();
shift_arg_formula(ruggo);
}
else if(argis("-rugorth")) {
@ -1914,7 +1914,7 @@ int rugArgs() {
}
else if(argis("-rugerr")) {
shift(); err_zero = argf();
shift_arg_formula(err_zero);
}
else if(argis("-rugtsize")) {
@ -1940,7 +1940,7 @@ int rugArgs() {
}
else if(argis("-anticusp")) {
shift(); anticusp_factor = argf();
shift_arg_formula(anticusp_factor);
}
else return 1;

View File

@ -192,7 +192,7 @@ int read_args() {
// (this is helpful with Inkscape's PDF+TeX output feature; define \myfont yourself)
}
else if(argis("-svggamma")) {
shift(); svg::gamma = argf();
shift_arg_formula(svg::gamma);
}
else if(argis("-svgshot")) {
PHASE(3); shift(); start_game();
@ -792,7 +792,7 @@ int readArgs() {
if(paramstate >= 2) anim_param = 1;
}
else if(argis("-animperiod")) {
PHASE(2); shift(); period = argf();
PHASE(2); shift_arg_formula(period);
}
else if(argis("-animrecord")) {
PHASE(3); shift(); noframes = argi();
@ -804,36 +804,36 @@ int readArgs() {
rotation_center_h = viewctr;
rotation_center_c = cwt.at;
rotation_center_View = View;
shift(); circle_spins = argf();
shift(); circle_radius = argf();
shift_arg_formula(circle_spins);
shift_arg_formula(circle_radius);
shift(); circle_display_color = arghex();
}
else if(argis("-animmove")) {
ma = maTranslation;
shift(); cycle_length = argf();
shift(); shift_angle = argf();
shift(); movement_angle = argf();
shift_arg_formula(cycle_length);
shift_arg_formula(shift_angle);
shift_arg_formula(movement_angle);
}
else if(argis("-animpar")) {
ma = maParabolic;
shift(); parabolic_length = argf();
shift(); shift_angle = argf();
shift(); movement_angle = argf();
shift_arg_formula(parabolic_length);
shift_arg_formula(shift_angle);
shift_arg_formula(movement_angle);
}
else if(argis("-animrot")) {
ma = maRotation;
}
else if(argis("-animrug")) {
shift(); rug_rotation1 = argf();
shift(); rug_angle = argf();
shift(); rug_rotation2 = argf();
shift_arg_formula(rug_rotation1);
shift_arg_formula(rug_angle);
shift_arg_formula(rug_rotation2);
}
else if(argis("-animenv")) {
shift(); env_ocean = argf();
shift(); env_volcano = argf();
shift_arg_formula(env_ocean);
shift_arg_formula(env_volcano);
}
else if(argis("-animball")) {
shift(); ballangle_rotation = argf();
shift_arg_formula(ballangle_rotation);
}
else if(argis("-animj")) {
shift(); joukowsky_anim = true;

View File

@ -1523,7 +1523,7 @@ int textureArgs() {
}
else if(argis("-txp")) {
shift(); config.gsplits = argf();
shift(); config.gsplits = argi();
}
else if(argis("-txc")) {