diff --git a/config.cpp b/config.cpp index 8c2aa745..6befba07 100644 --- a/config.cpp +++ b/config.cpp @@ -442,6 +442,8 @@ EX void initConfig() { addsaver(vid.collignon_parameter, "collignon-parameter", 1); addsaver(vid.collignon_reflected, "collignon-reflect", false); + addsaver(vid.plevel_factor, "plevel_factor", 1); + addsaver(vid.creature_scale, "3d-creaturescale", 1); addsaver(vid.height_width, "3d-heightwidth", 1.5); diff --git a/geometry.cpp b/geometry.cpp index 797167cc..fcdbaa53 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -121,6 +121,8 @@ struct geometry_information { ld asteroid_size[8]; ld wormscale; ld tentacle_length; + /** level in product geometries */ + ld plevel; /** various parameters related to the 3D view */ ld INFDEEP, BOTTOM, HELLSPIKE, LAKE, WALL, FLOOR, STUFF, @@ -553,6 +555,8 @@ void geometry_information::prepare_basics() { floorrad1 = rhexf * (GDIM == 3 ? 1 : .8); } + plevel = vid.plevel_factor * scalefactor; + set_sibling_limit(); prepare_compute3(); diff --git a/hyper.h b/hyper.h index 1a08dd6c..5aae6097 100644 --- a/hyper.h +++ b/hyper.h @@ -319,6 +319,7 @@ struct videopar { bool auto_eye; ld collignon_parameter; bool collignon_reflected; + ld plevel_factor; }; extern videopar vid; diff --git a/hypgraph.cpp b/hypgraph.cpp index a034a259..4a0c4605 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -1379,8 +1379,8 @@ EX void optimizeview() { ld z = zlevel(tC0(View)); View = mscale(View, -z); product::in_underlying_map(optimizeview); - if(z > product::plevel / 2) { product::current_view_level--; z -= product::plevel; } - if(z < -product::plevel / 2) { product::current_view_level++; z += product::plevel; } + if(z > cgi.plevel / 2) { product::current_view_level--; z -= cgi.plevel; } + if(z < -cgi.plevel / 2) { product::current_view_level++; z += cgi.plevel; } View = mscale(View, z); return; } diff --git a/nonisotropic.cpp b/nonisotropic.cpp index bc18703a..1ca18d4d 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -557,8 +557,6 @@ EX namespace product { pmodel = mdPerspective; } - EX ld plevel = 1; - EX int current_view_level; hrmap *pmap; @@ -599,7 +597,7 @@ EX namespace product { cell* gamestart() override { return getCell(underlying_map->gamestart(), 0); } transmatrix relative_matrix(cell *c2, cell *c1, const hyperpoint& point_hint) override { - return in_underlying([&] { return calc_relative_matrix(where[c2].first, where[c1].first, point_hint); }) * mscale(Id, plevel * (where[c2].second - where[c1].second)); + return in_underlying([&] { return calc_relative_matrix(where[c2].first, where[c1].first, point_hint); }) * mscale(Id, cgi.plevel * (where[c2].second - where[c1].second)); } hrmap_product() { @@ -619,7 +617,7 @@ EX namespace product { void drawcell_stack(cell *c, transmatrix V, int spinv, bool mirrored) { if(sphere) gmatrix[c] = V; /* some computations need gmatrix0 for underlying geometry */ - in_actual([&] { for(int z=-5; z<=5; z++) drawcell(get_at(c, current_view_level+z), V * mscale(Id, plevel * z), spinv, mirrored); }); + in_actual([&] { for(int z=-5; z<=5; z++) drawcell(get_at(c, current_view_level+z), V * mscale(Id, cgi.plevel * z), spinv, mirrored); }); } void find_cell_connection(cell *c, int d) { @@ -639,7 +637,7 @@ EX namespace product { EX hyperpoint get_corner(cell *c, int i, ld z) { dynamicval g(geometry, underlying); dynamicval gc(cgip, underlying_cgip); - return mscale(get_corner_position(c, i), exp(plevel * z/2)); + return mscale(get_corner_position(c, i), exp(cgi.plevel * z/2)); } EX int wall_offset(cell *c) {