diff --git a/bigstuff.cpp b/bigstuff.cpp index 3274d6f5..dde7a248 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -153,7 +153,7 @@ EX int default_levs() { if(S3 >= OINF) return 1; #if MAXMDIM >= 4 - if(reg3::in_rule()) return 0; + if(reg3::in_hrmap_rule_or_subrule()) return 0; #endif return S3-3; } @@ -240,7 +240,7 @@ EX heptagon *create_altmap(cell *c, int rad, hstate firststate, int special IS(0 int gdir = -1; for(int i=0; itype; i++) { #if MAXMDIM >= 4 - if(!reg3::in_rule()) { + if(!reg3::in_hrmap_rule_or_subrule()) { #else if(true) { #endif @@ -252,7 +252,7 @@ EX heptagon *create_altmap(cell *c, int rad, hstate firststate, int special IS(0 } } #if MAXMDIM >= 4 - if(reg3::in_rule() && c->master->distance == 0) gdir = 0; + if(reg3::in_hrmap_rule_or_subrule() && c->master->distance == 0) gdir = 0; #endif if(gdir < 0) return NULL; @@ -1670,7 +1670,7 @@ EX void build_horocycles(cell *c, cell *from) { if(ls::any_order() && bearsCamelot(c->land) && can_start_horo(c) && !bt::in() && #if MAXMDIM >= 4 - !(hyperbolic && WDIM == 3 && !reg3::in_rule()) && + !(hyperbolic && WDIM == 3 && !reg3::in_hrmap_rule_or_subrule()) && #endif (quickfind(laCamelot) || peace::on || (hrand(I2000) < (c->land == laCrossroads4 || ls::no_walls() ? 800 : 200) && horo_ok() && items[itEmerald] >= U5))) @@ -1860,7 +1860,7 @@ EX void buildCamelot(cell *c) { EX int masterAlt(cell *c) { if(eubinary) return celldistAlt(c); #if MAXMDIM >= 4 - if(WDIM == 3 && hyperbolic && !reg3::in_rule()) return reg3::altdist(c->master); + if(WDIM == 3 && hyperbolic && !reg3::in_hrmap_rule_or_subrule()) return reg3::altdist(c->master); #endif return c->master->alt->distance; } diff --git a/cell.cpp b/cell.cpp index 707390fc..57b94d08 100644 --- a/cell.cpp +++ b/cell.cpp @@ -232,7 +232,7 @@ EX vector allmaps; EX hrmap *newAltMap(heptagon *o) { #if MAXMDIM >= 4 - if(reg3::in_rule()) + if(reg3::in_hrmap_rule_or_subrule()) return reg3::new_alt_map(o); #endif if(currentmap->strict_tree_rules()) @@ -638,7 +638,7 @@ EX int celldistAlt(cell *c) { } #if MAXMDIM >= 4 if(euc::in()) return euc::dist_alt(c); - if(hyperbolic && WDIM == 3 && !reg3::in_rule()) + if(hyperbolic && WDIM == 3 && !reg3::in_hrmap_rule_or_subrule()) return reg3::altdist(c->master); #endif if(!c->master->alt) return 0; @@ -676,7 +676,7 @@ EX int updir(heptagon *h) { if(bt::in()) return bt::updir(); #endif #if MAXMDIM >= 4 - if(WDIM == 3 && reg3::in_rule()) { + if(WDIM == 3 && reg3::in_hrmap_rule_or_subrule()) { for(int i=0; itype; i++) if(h->move(i) && h->move(i)->distance < h->distance) return i; return -1; @@ -690,7 +690,7 @@ EX int updir(heptagon *h) { EX int updir_alt(heptagon *h) { if(euclid || !h->alt) return -1; #if MAXMDIM >= 4 - if(WDIM == 3 && reg3::in_rule()) { + if(WDIM == 3 && reg3::in_hrmap_rule_or_subrule()) { for(int i=0; imove(i) && h->move(i)->alt && h->move(i)->alt->distance < h->alt->distance) return i; return -1; diff --git a/expansion.cpp b/expansion.cpp index 807f6bd5..6be50cc0 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -113,7 +113,7 @@ void expansion_analyzer::preliminary_grouping() { for(int v: rulegen::treestates[i].rules) if(v >= 0) children[i].push_back(v); } - else if(reg3::in_rule()) { + else if(reg3::exact_rules()) { #if MAXMDIM >= 4 rootid = reg3::rule_get_root(0); auto& chi = reg3::rule_get_children(); @@ -145,7 +145,7 @@ void expansion_analyzer::preliminary_grouping() { } void expansion_analyzer::reduce_grouping() { - if(reg3::in_rule()) return; + if(reg3::exact_rules()) return; if(currentmap->strict_tree_rules()) return; int old_N = N; vector grouping; @@ -239,7 +239,7 @@ bool expansion_analyzer::verify(int id) { int expansion_analyzer::valid(int v, int step) { if(step < 0) return 0; - int more = reg3::in_rule() ? 1 : 5; + int more = reg3::exact_rules() ? 1 : 5; #if CAP_GMP == 0 if(get_descendants(step+v+v+more).approx_int() >= bignum::BASE) return 0; typedef ld val; @@ -392,7 +392,7 @@ int type_in_quick(expansion_analyzer& ea, cell *c, const cellfunction& f) { } EX bool sizes_known() { - if(reg3::in_rule()) return true; + if(reg3::exact_rules()) return true; if(closed_manifold) return false; // Castle Anthrax is infinite if(bt::in()) return false; @@ -583,7 +583,7 @@ void celldrawer::do_viewdist() { } case ncType: { int t = -1; - if(reg3::in_rule()) switch(distance_from) { + if(reg3::exact_rules()) switch(distance_from) { case dfPlayer: t = -1; break; @@ -740,7 +740,7 @@ void expansion_analyzer::view_distances_dialog() { if(really_use_analyzer) { int t; - if(reg3::in_rule() || currentmap->strict_tree_rules()) { + if(reg3::exact_rules() || currentmap->strict_tree_rules()) { if(!N) preliminary_grouping(); t = rootid; } diff --git a/geom-exp.cpp b/geom-exp.cpp index b52d486a..4c823167 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -1129,7 +1129,7 @@ EX void showEuclideanMenu() { dialog::addSelItem(XLAT("size of the world"), gd.size_str, '3'); - if(WDIM == 2 || reg3::in_rule()) dialog::add_action([] { + if(WDIM == 2 || reg3::exact_rules()) dialog::add_action([] { if(!viewdists) { enable_viewdists(); pushScreen(viewdist_configure_dialog); } else if(viewdists) viewdists = false; }); diff --git a/honeycomb-rules-344.dat b/honeycomb-rules-344.dat deleted file mode 100644 index 6606ff1e..00000000 --- a/honeycomb-rules-344.dat +++ /dev/null @@ -1 +0,0 @@ -xm0 :nqt .:|ѲC" :@M(sRVV*Y2dǣRxv(x^*|>a饗K=z4s$揄prw\x DŽ4/_j8/7pyX|1>D~co6r'yy ~KhNci5ޡ[ɵE;Xrːe׌`*VQWثI5kHv#3Y;#D_?xhL \ No newline at end of file diff --git a/honeycomb-rules-345.dat b/honeycomb-rules-345.dat deleted file mode 100644 index 46326e66..00000000 Binary files a/honeycomb-rules-345.dat and /dev/null differ diff --git a/honeycomb-rules-353.dat b/honeycomb-rules-353.dat deleted file mode 100644 index 2e9ff998..00000000 Binary files a/honeycomb-rules-353.dat and /dev/null differ diff --git a/honeycomb-rules-354.dat b/honeycomb-rules-354.dat deleted file mode 100644 index 5819aaa9..00000000 Binary files a/honeycomb-rules-354.dat and /dev/null differ diff --git a/honeycomb-rules-355.dat b/honeycomb-rules-355.dat deleted file mode 100644 index f0b6956f..00000000 Binary files a/honeycomb-rules-355.dat and /dev/null differ diff --git a/honeycomb-rules-435.dat b/honeycomb-rules-435.dat deleted file mode 100644 index 08f403ae..00000000 Binary files a/honeycomb-rules-435.dat and /dev/null differ diff --git a/honeycomb-rules-436.dat b/honeycomb-rules-436.dat deleted file mode 100644 index 2f31198a..00000000 Binary files a/honeycomb-rules-436.dat and /dev/null differ diff --git a/honeycomb-rules-534.dat b/honeycomb-rules-534.dat deleted file mode 100644 index 3a639363..00000000 --- a/honeycomb-rules-534.dat +++ /dev/null @@ -1,3 +0,0 @@ -xڍR@ƛK`D[EEAE*{ I6wG{L&TUI6Mgw%C3t,?+f^|W%قf&>+k2?4d SKޥ7`,]`亮WᅧG؅s\oNK5~a~Z#\:oGrے᳙ɥpsYwn5_r?(uR/>>ra@[o=o>yK}Ar9'˺s~J \γOzzp=\|?^}9aq9?Ͻ914uzj㾟Tjf>]Xw\X~ُ=ZS~I.\)y 1WO 0bC (NsL 43 -~*JGQW3ldZI`'^Ef}2}5v'W*kD"~Y.HWuQWF^" 9"3U:JeT|buܑ&$q#5#㵣rx8 09(3lbüa]`>%k̎ZC> TITz6>7qMG)j9Sfwe絧3<#ߙڌu:ޟ"S< -L+:&4qSspl'Z:YSgzuuv<%b|:< 23W \ No newline at end of file diff --git a/honeycomb-rules-535.dat b/honeycomb-rules-535.dat deleted file mode 100644 index b3c9a5b6..00000000 Binary files a/honeycomb-rules-535.dat and /dev/null differ diff --git a/honeycomb-rules-536.dat b/honeycomb-rules-536.dat deleted file mode 100644 index ea28de3e..00000000 Binary files a/honeycomb-rules-536.dat and /dev/null differ diff --git a/honeycombs/336h-c0.dat b/honeycombs/336h-c0.dat new file mode 100644 index 00000000..fbb1a406 Binary files /dev/null and b/honeycombs/336h-c0.dat differ diff --git a/honeycombs/336h-c7.dat b/honeycombs/336h-c7.dat new file mode 100644 index 00000000..846909f9 Binary files /dev/null and b/honeycombs/336h-c7.dat differ diff --git a/honeycombs/336h.dat b/honeycombs/336h.dat new file mode 100644 index 00000000..336f0a35 Binary files /dev/null and b/honeycombs/336h.dat differ diff --git a/honeycombs/344h-c0.dat b/honeycombs/344h-c0.dat new file mode 100644 index 00000000..42c68c94 Binary files /dev/null and b/honeycombs/344h-c0.dat differ diff --git a/honeycombs/344h-c7.dat b/honeycombs/344h-c7.dat new file mode 100644 index 00000000..59b72e39 Binary files /dev/null and b/honeycombs/344h-c7.dat differ diff --git a/honeycombs/344h.dat b/honeycombs/344h.dat new file mode 100644 index 00000000..fd35b06e Binary files /dev/null and b/honeycombs/344h.dat differ diff --git a/honeycombs/345h.dat b/honeycombs/345h.dat new file mode 100644 index 00000000..1ccc6bc4 Binary files /dev/null and b/honeycombs/345h.dat differ diff --git a/honeycombs/353h-c0.dat b/honeycombs/353h-c0.dat new file mode 100644 index 00000000..7821e8c0 Binary files /dev/null and b/honeycombs/353h-c0.dat differ diff --git a/honeycombs/353h-c7.dat b/honeycombs/353h-c7.dat new file mode 100644 index 00000000..b9f86421 Binary files /dev/null and b/honeycombs/353h-c7.dat differ diff --git a/honeycombs/353h.dat b/honeycombs/353h.dat new file mode 100644 index 00000000..6aedd464 Binary files /dev/null and b/honeycombs/353h.dat differ diff --git a/honeycombs/354h.dat b/honeycombs/354h.dat new file mode 100644 index 00000000..7c9fc5b4 Binary files /dev/null and b/honeycombs/354h.dat differ diff --git a/honeycombs/355h.dat b/honeycombs/355h.dat new file mode 100644 index 00000000..288106bd Binary files /dev/null and b/honeycombs/355h.dat differ diff --git a/honeycombs/434c-c0.dat b/honeycombs/434c-c0.dat new file mode 100644 index 00000000..a43baff2 Binary files /dev/null and b/honeycombs/434c-c0.dat differ diff --git a/honeycombs/434c-c7.dat b/honeycombs/434c-c7.dat new file mode 100644 index 00000000..09c9939f Binary files /dev/null and b/honeycombs/434c-c7.dat differ diff --git a/honeycombs/434c.dat b/honeycombs/434c.dat new file mode 100644 index 00000000..62054915 --- /dev/null +++ b/honeycombs/434c.dat @@ -0,0 +1,2 @@ +xڕ=t A!"!$"n ЈJRٙT*JRRhT*JRT*JxoIg}{ "!I:Lޮ:7v7H sehT')=zN~gq/SuZ>Ѣ> _{-*}FK-۲sE9>|G5*WrLFd]e\Gc2%[#"Υyn>52ʛ folT%/6 f-;XɁܦ$)wشU/6~_hze.U{kRe +cܐa`;Ʈ隣0}m^N{gwaN2:&S YXeX5w`&<'rxWw>' _+|~/ / W1L CVzҿTq \ No newline at end of file diff --git a/honeycombs/435h-bs1.dat b/honeycombs/435h-bs1.dat new file mode 100644 index 00000000..9dc4df36 Binary files /dev/null and b/honeycombs/435h-bs1.dat differ diff --git a/honeycombs/435h-bs2.dat b/honeycombs/435h-bs2.dat new file mode 100644 index 00000000..384f714c Binary files /dev/null and b/honeycombs/435h-bs2.dat differ diff --git a/honeycombs/435h-d2.dat b/honeycombs/435h-d2.dat new file mode 100644 index 00000000..1ca32d1e Binary files /dev/null and b/honeycombs/435h-d2.dat differ diff --git a/honeycombs/435h-s2.dat b/honeycombs/435h-s2.dat new file mode 100644 index 00000000..28a48a6b Binary files /dev/null and b/honeycombs/435h-s2.dat differ diff --git a/honeycombs/435h.dat b/honeycombs/435h.dat new file mode 100644 index 00000000..d6d71f5f Binary files /dev/null and b/honeycombs/435h.dat differ diff --git a/honeycombs/436h-s2.dat b/honeycombs/436h-s2.dat new file mode 100644 index 00000000..65b8881a Binary files /dev/null and b/honeycombs/436h-s2.dat differ diff --git a/honeycombs/436h.dat b/honeycombs/436h.dat new file mode 100644 index 00000000..ce3421d9 Binary files /dev/null and b/honeycombs/436h.dat differ diff --git a/honeycombs/534h-c0.dat b/honeycombs/534h-c0.dat new file mode 100644 index 00000000..eecb709d Binary files /dev/null and b/honeycombs/534h-c0.dat differ diff --git a/honeycombs/534h-c7.dat b/honeycombs/534h-c7.dat new file mode 100644 index 00000000..1b6840cc --- /dev/null +++ b/honeycombs/534h-c7.dat @@ -0,0 +1,5 @@ +x\u߳ۘDeTTčm*&M2*<)&64J*J,R,*TTJ,*4T4T**ZTLHШP^כ==wv+3f1fb38L_yB -urts +#r$dկg8RUWOPUSToP?T?~LiVRQ׫ԍjP@ݢ^nR7ֈoSWDTգԣT -[շP#nWzz6>q85YMQOROVOQǟ|^Tx+*&Zzz:6v#j9zmNl{9P=L=\MPW^cix>m1C,}znZ,Ur@ gzo]5]WDr@5N=X}Iu/_Rɿw /DQ7x_Q[Շgկ ԅbCjy:~quZ:^VU_PRQW}7o#]u]x]&ǫ'':~w?QPLTRNN@OTSٴOm3{sζ\bnα)P "_mMu?>jruյxpgtT7;&{ }[oۡvh{9nr~ytI۷hkj87.@r̥\5q7vk@]4^2ysھVj~+&z>͡o|t;nY{:OSVOISj?5wSb&LŔ^g;ټPkk,q.raoήˍ)\E\ +.fgCĖٷ2?۬;=gw<~zA"-mi [&i-5^y?Cu Bzc{OCdo>Qyϐ"^^33uȍz?}7ޞ_cw(Z>Akz53n֧gw#7)e۵uzm{5b̏gQn{o.&tx%K>}58#HB2RG*@:2D&"pQ @%P hjQz4MhF Zцvt]Fzч~ `CF1qL +b8#HB2RG*@z ,d#C>\(C9*P*TC=Ј&4hC;:Љ.tC?0! c8&]1E⑀D$!)#i "YFr|(F JQrTUF jQz4MhF Zцvt]Fzч~ `CF1qL,#!C<$$#~" #Ad" A.(A)P +T +ըA-P4 hA+Ўt A/Џ b(0ދ߇"H@"4 ,d#C>\(C9*P*TC=Ј&4hC;:Љ.tC?0! c8&|> qGdT!Eכy \ No newline at end of file diff --git a/honeycombs/534h.dat b/honeycombs/534h.dat new file mode 100644 index 00000000..9275ddbe Binary files /dev/null and b/honeycombs/534h.dat differ diff --git a/honeycombs/535h.dat b/honeycombs/535h.dat new file mode 100644 index 00000000..d2699a17 Binary files /dev/null and b/honeycombs/535h.dat differ diff --git a/honeycombs/536h.dat b/honeycombs/536h.dat new file mode 100644 index 00000000..cd8ad185 Binary files /dev/null and b/honeycombs/536h.dat differ diff --git a/landgen.cpp b/landgen.cpp index 695d970e..5633d09e 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -192,7 +192,7 @@ EX bool is_zebra_trapdoor(cell *c) { else if(arb::in() && arb::current.have_line) return arb::linespattern(c); #if MAXMDIM >= 4 - else if(reg3::in_rule()) switch(geometry) { + else if(PURE && reg3::exact_rules()) switch(geometry) { case gSpace534: { if(c->master->fieldval == 0) return true; forCellCM(c1, c) if(c1->master->fieldval == 0) return true; diff --git a/reg3.cpp b/reg3.cpp index 6ee06d41..511f6cfd 100644 --- a/reg3.cpp +++ b/reg3.cpp @@ -1304,18 +1304,11 @@ EX namespace reg3 { } EX bool minimize_quotient_maps = false; - EX bool subrule = false; EX bool strafe_test = false; hrmap_quotient3 *gen_quotient_map(bool minimized, fieldpattern::fpattern &fp) { #if CAP_FIELD - #if CAP_CRYSTAL - if(geometry == gSpace344) { - return new hrmap_from_crystal(minimized ? 1 : 2); - } - else - #endif if(geometry == gSpace535 && minimized) { return new seifert_weber::hrmap_singlecell(108*degree); } @@ -1454,6 +1447,7 @@ EX namespace reg3 { } hrmap_h3() { + println(hlog, "generating hrmap_h3"); origin = init_heptagon(S7); heptagon& h = *origin; h.s = hsOrigin; @@ -1856,22 +1850,6 @@ EX namespace reg3 { ruleset() : fp(0) {} - void load_ruleset(string fname) { - - shstream ins(decompress_string(read_file_as_string(fname))); - dynamicval q(fieldpattern::use_quotient_fp, true); - hread_fpattern(ins, fp); - - hread(ins, root); - hread(ins, children); - hread(ins, other); - // hread(ins, childpos); - - int t = S7; - int qty = isize(children) / t; - for(int i=0; i<=qty; i++) childpos.push_back(i * t); - } - void load_ruleset_new(string fname) { shstream ins(decompress_string(read_file_as_string(fname))); @@ -1887,6 +1865,8 @@ EX namespace reg3 { hread(ins, children); hread(ins, other); hread(ins, childpos); + + println(hlog, "roots = ", isize(root), " states = ", isize(childpos)-1, " hashv = ", fp.hashv); } /** \brief address = (fieldvalue, state) */ @@ -2045,8 +2025,10 @@ EX namespace reg3 { hrmap_h3_rule() { - load_ruleset(get_rule_filename()); - quotient_map = gen_quotient_map(is_minimized(), fp); + println(hlog, "generating hrmap_h3_rule"); + + load_ruleset_new(get_rule_filename(false)); + quotient_map = gen_quotient_map(minimize_quotient_maps, fp); find_mappings(); origin = init_heptagon(S7); @@ -2263,7 +2245,7 @@ EX namespace reg3 { println(hlog, "loading a subrule ruleset"); - load_ruleset_new(get_rule_filename()); + load_ruleset_new(get_rule_filename(true)); quotient_map = gen_quotient_map(minimize_quotient_maps, fp); int t = quotient_map->acells[0]->type; find_mappings(); @@ -2422,39 +2404,43 @@ EX hrmap *new_alt_map(heptagon *o) { return new hrmap_h3_rule_alt(o); } -EX bool reg3_rule_available = true; -EX string other_rule = ""; +/** 1 -- consider pure rules, 2 -- consider variation rules, 3 -- consider both */ +EX int consider_rules = 3; -EX bool is_minimized() { - return geometry != gSpace535 && geometry != gSpace344; - } +EX string replace_rule_file; -EX string get_rule_filename() { - if(other_rule != "") return other_rule; - switch(geometry) { - case gSpace336: return "honeycomb-rules-336.dat"; - case gSpace344: return "honeycomb-rules-344.dat"; - case gSpace345: return "honeycomb-rules-345.dat"; - case gSpace353: return "honeycomb-rules-353.dat"; - case gSpace354: return "honeycomb-rules-354.dat"; - case gSpace355: return "honeycomb-rules-355.dat"; - case gSpace435: return "honeycomb-rules-435.dat"; - case gSpace436: return "honeycomb-rules-436.dat"; - case gSpace534: return "honeycomb-rules-534.dat"; - case gSpace535: return "honeycomb-rules-535.dat"; - case gSpace536: return "honeycomb-rules-536.dat"; - - default: return ""; +EX string get_rule_filename(bool with_variations) { + if(replace_rule_file != "") return replace_rule_file; + string s; + s += "honeycombs/"; + s += ginf[geometry].tiling_name[1]; + s += ginf[geometry].tiling_name[3]; + s += ginf[geometry].tiling_name[5]; + if(hyperbolic) s += "h"; + else s += "c"; + if(with_variations) { + if(variation == eVariation::coxeter) s += "-c" + its(coxeter_param); + if(variation == eVariation::subcubes) s += "-s" + its(subcube_count); + if(variation == eVariation::dual_subcubes) s += "-d" + its(subcube_count); + if(variation == eVariation::bch) s += "-bs" + its(subcube_count); } + s += ".dat"; + return find_file(s); } -EX bool in_rule() { - return reg3_rule_available && get_rule_filename() != ""; +EX bool variation_rule_available() { + return (consider_rules & 2) && file_exists(get_rule_filename(true)); + } + +EX bool pure_rule_available() { + return (consider_rules & 1) && file_exists(get_rule_filename(false)); } ruleset& get_ruleset() { - if(subrule) return *((hrmap_h3_subrule*)currentmap); - if(in_rule()) return *((hrmap_h3_rule*)currentmap); + auto h1 = dynamic_cast (currentmap); + if(h1) return *h1; + auto h2 = dynamic_cast (currentmap); + if(h2) return *h2; throw hr_exception("get_ruleset called but not in rule"); } @@ -2475,8 +2461,8 @@ EX hrmap* new_map() { if(geometry == gSeifertWeber) return new seifert_weber::hrmap_singlecell(108*degree); if(geometry == gHomologySphere) return new seifert_weber::hrmap_singlecell(36*degree); if(quotient && !sphere) return new hrmap_field3(&currfp); - if(subrule) return new hrmap_h3_subrule; - if(in_rule()) return new hrmap_h3_rule; + if(variation_rule_available()) return new hrmap_h3_subrule; + if(pure_rule_available()) return new hrmap_h3_rule; if(sphere) return new hrmap_sphere3; return new hrmap_h3; } @@ -2489,6 +2475,15 @@ EX bool in_hrmap_h3() { return dynamic_cast (currentmap); } +EX bool in_hrmap_rule_or_subrule() { + return dynamic_cast (currentmap) || dynamic_cast (currentmap); + } + +EX bool exact_rules() { + if(PURE) return in_hrmap_rule_or_subrule(); + return dynamic_cast (currentmap); + } + EX int quotient_count() { return isize(hypmap()->quotient_map->allh); } @@ -2553,7 +2548,7 @@ EX int celldistance(cell *c1, cell *c2) { int b = bucketer(h); if(cgi.close_distances.count(b)) return cgi.close_distances[b]; - if(in_rule()) + if(in_hrmap_rule_or_subrule()) return clueless_celldistance(c1, c2); dynamicval g(geometry, gBinary3); diff --git a/rulegen.cpp b/rulegen.cpp index e6b08ba2..0b659005 100644 --- a/rulegen.cpp +++ b/rulegen.cpp @@ -2098,11 +2098,9 @@ EX void generate_rules() { start_time = SDL_GetTicks(); delete_tmap(); - if(WDIM == 3) { + if(WDIM == 3 && reg3::in_hrmap_rule_or_subrule()) { stop_game(); - reg3::reg3_rule_available = false; - fieldpattern::use_rule_fp = true; - fieldpattern::use_quotient_fp = true; + reg3::consider_rules = 0; flags |= w_numerical; start_game(); } diff --git a/rulegen3.cpp b/rulegen3.cpp index bb513aef..b6aa8604 100644 --- a/rulegen3.cpp +++ b/rulegen3.cpp @@ -1716,19 +1716,20 @@ int readRuleArgs3() { // -urq 7 to prepare honeycomb generation stop_game(); shift(); int i = argi(); - reg3::reg3_rule_available = (i & 8) ? 0 : 1; + reg3::consider_rules = i >> 3; fieldpattern::use_rule_fp = (i & 1) ? 1 : 0; fieldpattern::use_quotient_fp = (i & 2) ? 1 : 0; reg3::minimize_quotient_maps = (i & 4) ? 1 : 0; } - else if(argis("-subrule")) { + else if(argis("-load-honeycomb")) { stop_game(); - shift(); reg3::other_rule = args(); - shstream ins(decompress_string(read_file_as_string(arg::args()))); + string s = args(); + shift(); reg3::replace_rule_file = s; + shstream ins(decompress_string(read_file_as_string(s))); ins.read(ins.vernum); mapstream::load_geometry(ins); - reg3::subrule = true; + reg3::consider_rules = 2; } else if(argis("-less-states")) {