1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-09-19 18:29:36 +00:00

twisted product now actually appears for spherical space, and automatically sets csteps if it was illegal

This commit is contained in:
Zeno Rogue 2024-06-16 17:59:04 +02:00
parent 30b9f3e4c7
commit 4c3a348666
2 changed files with 15 additions and 2 deletions

View File

@ -262,7 +262,7 @@ bool forced_quotient() { return quotient && !(cgflags & qOPTQ); }
EX geometry_filter gf_hyperbolic = {"hyperbolic", 'h', [] { return (arcm::in() || arb::in() || hyperbolic) && !forced_quotient(); }};
EX geometry_filter gf_spherical = {"spherical", 's', [] { return (arcm::in() || arb::in() || sphere) && !forced_quotient(); }};
EX geometry_filter gf_euclidean = {"Euclidean", 'e', [] { return (arcm::in() || arb::in() || euclid) && !forced_quotient(); }};
EX geometry_filter gf_other = {"non-isotropic", 'n', [] { return mproduct || nonisotropic; }};
EX geometry_filter gf_other = {"non-isotropic", 'n', [] { return mproduct || mtwisted || nonisotropic; }};
EX geometry_filter gf_regular_2d = {"regular 2D tesselations", 'r', [] {
return standard_tiling() && WDIM == 2 && !forced_quotient();
}};
@ -314,6 +314,7 @@ void set_or_configure_geometry(eGeometry g) {
else if(g == gArbitrary)
arb::choose();
else {
bool quo = false;
if(among(g, gProduct, gTwistedProduct)) {
if(WDIM == 3 || (g == gTwistedProduct && euclid)) {
addMessage(
@ -325,6 +326,7 @@ void set_or_configure_geometry(eGeometry g) {
}
if(g == gTwistedProduct) {
bool ok = true;
quo = sphere || quotient;
if(arcm::in()) ok = PURE;
else if(bt::in() || aperiodic) ok = false;
else ok = PURE || BITRUNCATED;
@ -343,7 +345,10 @@ void set_or_configure_geometry(eGeometry g) {
#endif
}
}
dual::may_split_or_do([g] { set_geometry(g); });
dual::may_split_or_do([g, quo] {
set_geometry(g);
if(quo) hybrid::fixup_csteps();
});
start_game();
}
}

View File

@ -1249,6 +1249,14 @@ EX namespace hybrid {
}
}
EX void fixup_csteps() {
check_cgi(); cgi.require_basics();
if(!hybrid::csteps || gmod(cgi.psl_steps, hybrid::csteps)) {
hybrid::csteps = cgi.psl_steps;
hybrid::reconfigure();
}
}
EX hrmap *pmap;
EX geometry_information *pcgip;
EX eGeometry actual_geometry;