1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 13:07:16 +00:00

aperiodic is now distinct from kite::in

This commit is contained in:
Zeno Rogue 2023-03-23 01:32:24 +01:00
parent 732d80965f
commit acfa454114
16 changed files with 37 additions and 34 deletions

View File

@ -1487,7 +1487,7 @@ EX bool good_for_wall(cell *c) {
EX bool walls_not_implemented() {
// if(WDIM == 3 && !PURE) return true;
if(sphere || quotient || nonisotropic || (kite::in() && !bt::in()) || experimental) return true;
if(sphere || quotient || nonisotropic || aperiodic || experimental) return true;
return WDIM == 3 && (cgflags & qIDEAL);
}

View File

@ -598,7 +598,7 @@ EX int celldist(cell *c) {
return hybrid::celldistance(c, currentmap->gamestart());
if(nil && !quotient) return DISTANCE_UNKNOWN;
if(euc::in()) return celldistance(currentmap->gamestart(), c);
if(sphere || bt::in() || WDIM == 3 || cryst || sn::in() || kite::in() || closed_manifold) return celldistance(currentmap->gamestart(), c);
if(sphere || bt::in() || WDIM == 3 || cryst || sn::in() || aperiodic || closed_manifold) return celldistance(currentmap->gamestart(), c);
#if CAP_IRR
if(IRREGULAR) return irr::celldist(c, false);
#endif
@ -1298,7 +1298,7 @@ EX int celldistance(cell *c1, cell *c2) {
return euc::cyldist(euc2_coordinates(c1), euc2_coordinates(c2));
}
if(arcm::in() || quotient || sn::in() || (kite::in() && euclid) || experimental || sl2 || nil || arb::in())
if(arcm::in() || quotient || sn::in() || (aperiodic && euclid) || experimental || sl2 || nil || arb::in())
return clueless_celldistance(c1, c2);
if(S3 >= OINF) return inforder::celldistance(c1, c2);
@ -1547,7 +1547,7 @@ EX vector<int> reverse_directions(heptagon *c, int dir) {
}
EX bool standard_tiling() {
return !arcm::in() && !kite::in() && !bt::in() && !arb::in() && (WDIM == 2 || !nonisotropic) && !mhybrid;
return !arcm::in() && !aperiodic && !bt::in() && !arb::in() && (WDIM == 2 || !nonisotropic) && !mhybrid;
}
EX int valence() {

View File

@ -1776,7 +1776,7 @@ void celldrawer::draw_features_and_walls_3d() {
/* always render */
if(wrl::in && wrl::print) ; else
#endif
if(pmodel == mdPerspective && !sphere && !quotient && !kite::in() && !nonisotropic && !mhybrid && !experimental && !nih) {
if(pmodel == mdPerspective && !sphere && !quotient && !aperiodic && !nonisotropic && !mhybrid && !experimental && !nih) {
if(a < 4 && among(geometry, gHoroTris, gBinary3) && celldistAlt(c) >= celldistAlt(centerover)) continue;
else if(a < 2 && among(geometry, gHoroRec) && celldistAlt(c) >= celldistAlt(centerover)) continue;
// this optimization is not correct, need to fix

View File

@ -826,6 +826,8 @@ static const flagtype qSTRETCHABLE = Flag(27);
static const flagtype qCAT = Flag(28);
static const flagtype qAPERIODIC = Flag(29);
// note: dnext assumes that x&7 equals 7
static const int SEE_ALL = 50;
// note: check_football_colorability in arbitrile.cpp assumes OINF is divisible by 3
@ -925,7 +927,7 @@ EX vector<geometryinfo> ginf = {
{"{5,3,4}","field", "{5,3,4} field quotient space", "f435", 12, 4, qsSMALLBF | qDEPRECATED, giHyperb3, {{SEE_ALL, SEE_ALL}}, eVariation::pure},
{"binary4","none", "standard binary tiling", "binary4", 5, 3, qBINARY, giHyperb2, {{7, 5}}, eVariation::pure},
{"sol", "none", "Solv geometry", "sol", 8, 3, qBINARY|qSOL, giSol, {{7, 5}}, eVariation::pure},
{"kd2", "none", "kite-and-dart", "kd2", 4, 3, qKITE, giEuclid2, {{7, 7}}, eVariation::pure},
{"kd2", "none", "kite-and-dart", "kd2", 4, 3, qKITE | qAPERIODIC, giEuclid2, {{7, 7}}, eVariation::pure},
{"kd3", "none", "kite-and-dart on horospheres", "kd3", 12, 3, qsBP, giHyperb3, {{7, 3}}, eVariation::pure},
{"nil", "none", "Nil geometry", "nil", 6, 3, qOPTQ, giNil, {{7, 5}}, eVariation::pure},
{"product","none", "product space", "product", 7, 3, qHYBRID, giProduct, {{7, 3}}, eVariation::pure},

View File

@ -1179,7 +1179,7 @@ EX namespace mirror {
#endif
EX bool build(cell *c) {
if(kite::in() || sol) return false;
if(aperiodic || sol) return false;
#if CAP_GP
if(GOLDBERG) {
if(c == c->master->c7) {
@ -1311,7 +1311,7 @@ EX namespace mirror {
EX void createMirrors(cellwalker cw, int cpid) {
if(kite::in() || sol) return;
if(aperiodic || sol) return;
#if CAP_ARCM
if(arcm::in()) {

View File

@ -398,7 +398,7 @@ EX bool sizes_known() {
if(bt::in()) return false;
// not implemented
if(arcm::in()) return false;
if(kite::in()) return false;
if(aperiodic) return false;
if(currentmap->strict_tree_rules()) return true;
if(arb::in()) return false;
return true;

View File

@ -1113,7 +1113,7 @@ EX struct dqi_poly *draw_shapevec(cell *c, const shiftmatrix& V, const vector<hp
#endif
else if(GOLDBERG && ishex1(c))
return &queuepolyat(V * pispin, shv[0], col, prio);
else if(!(S7&1) && PURE && !kite::in() && !a4) {
else if(!(S7&1) && PURE && !aperiodic && !a4) {
auto si = patterns::getpatterninfo(c, patterns::PAT_COLORING, 0);
if(si.id == 8) si.dir++;
transmatrix D = applyPatterndir(c, si);

View File

@ -322,7 +322,7 @@ void set_or_configure_geometry(eGeometry g) {
if(g == gRotSpace) {
bool ok = true;
if(arcm::in()) ok = PURE;
else if(bt::in() || kite::in()) ok = false;
else if(bt::in() || aperiodic) ok = false;
else ok = PURE || BITRUNCATED;
if(!ok) {
addMessage(XLAT("Only works with (semi-)regular tilings"));
@ -602,7 +602,7 @@ EX void select_quotient_screen() {
}
EX void select_quotient() {
if(meuclid && !kite::in() && !arcm::in() && !reg3::cubes_reg3) {
if(meuclid && !aperiodic && !arcm::in() && !reg3::cubes_reg3) {
euc::prepare_torus3();
pushScreen(euc::show_torus3);
}
@ -640,7 +640,7 @@ EX void select_quotient() {
EX string full_geometry_name() {
string qstring = ginf[geometry].quotient_name;
bool variable =
!(mproduct || mhybrid || bt::in() || (WDIM == 3 && !reg3::in()) || kite::in() || arb::in());
!(mproduct || mhybrid || bt::in() || (WDIM == 3 && !reg3::in()) || aperiodic || arb::in());
string fgname = XLAT(ginf[geometry].tiling_name);
if(qstring != "none") fgname += " " + XLAT(qstring);
@ -1025,7 +1025,7 @@ EX void showEuclideanMenu() {
else if(nil) {
menuitem_nilwidth('v');
}
else if((WDIM == 3 || kite::in() || arb::in()) && !reg3::in() && geometry != gCubeTiling) dialog::addBreak(100);
else if((WDIM == 3 || aperiodic || arb::in()) && !reg3::in() && geometry != gCubeTiling) dialog::addBreak(100);
else
menuitem_change_variation('v');
@ -1131,7 +1131,7 @@ EX void showEuclideanMenu() {
dialog::addTitle(XLAT("info about: %1", full_geometry_name()), 0xFFFFFF, 150);
auto gd = compute_geometry_data();
if(WDIM == 2 && !arb::in() && !kite::in()) dialog::addSelItem(XLAT("faces per vertex"), gd.spf, 0);
if(WDIM == 2 && !arb::in() && !aperiodic) dialog::addSelItem(XLAT("faces per vertex"), gd.spf, 0);
if(arb::in() && arb::current.comment != "") {
dialog::addBreak(100);

View File

@ -447,7 +447,7 @@ void hrmap_hyperbolic::virtualRebase(heptagon*& base, transmatrix& at) {
}
EX bool no_easy_spin() {
return NONSTDVAR || arcm::in() || WDIM == 3 || bt::in() || kite::in();
return NONSTDVAR || arcm::in() || WDIM == 3 || bt::in() || aperiodic;
}
EX bool never_invert;
@ -479,7 +479,7 @@ EX ld cellgfxdist(cell *c, int d) { return currentmap->spacedist(c, d); }
EX transmatrix ddspin_side(cell *c, int d, ld bonus IS(0)) {
if(cgi.emb->is_in_noniso())
return spin(bonus);
if(kite::in()) {
if(aperiodic) {
if(embedded_plane) return spin(bonus);
hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3);
hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3);
@ -492,7 +492,7 @@ EX transmatrix ddspin_side(cell *c, int d, ld bonus IS(0)) {
EX transmatrix iddspin_side(cell *c, int d, ld bonus IS(0)) {
if(cgi.emb->is_in_noniso())
return spin(bonus);
if(kite::in()) {
if(aperiodic) {
if(embedded_plane) return spin(bonus);
hyperpoint h1 = get_corner_position(c, gmod(d, c->type), 3);
hyperpoint h2 = get_corner_position(c, gmod(d+1, c->type) , 3);
@ -561,7 +561,7 @@ transmatrix hrmap_standard::adj(cell *c, int i) {
EX double randd() { return (rand() + .5) / (RAND_MAX + 1.); }
EX hyperpoint randomPointIn(int t) {
if(NONSTDVAR || arcm::in() || kite::in()) {
if(NONSTDVAR || arcm::in() || aperiodic) {
// Let these geometries be less confusing.
// Also easier to implement ;)
return xspinpush0(TAU * randd(), asinh(randd() / 20));
@ -674,7 +674,7 @@ EX hyperpoint nearcorner(cell *c, int i) {
neis[5] = bt::get_horopoint(0, -1);
return neis[i];
}
if(kite::in()) {
if(aperiodic) {
if(approx_nearcorner)
return currentmap->get_corner(c, i, 3) + currentmap->get_corner(c, i+1, 3) - C0;
else
@ -741,7 +741,7 @@ EX hyperpoint farcorner(cell *c, int i, int which) {
}
#endif
#if CAP_BT
if(bt::in() || kite::in())
if(bt::in() || aperiodic)
return nearcorner(c, (i+which) % c->type); // lazy
#endif
#if CAP_ARCM
@ -870,7 +870,7 @@ int brm_hook = addHook(hooks_clearmemory, 0, []() {
});
EX bool exhaustive_distance_appropriate() {
if(euclid && (kite::in() || arcm::in() || arb::in() || quotient)) return true;
if(euclid && (aperiodic || arcm::in() || arb::in() || quotient)) return true;
#if MAXMDIM >= 4
if(nil && quotient) return true;
#endif

View File

@ -200,6 +200,7 @@ void addMessage(string s, char spamtype = 0);
#define INVERSE among(variation, eVariation::unrectified, eVariation::warped, eVariation::untruncated )
#define aperiodic (cgflags & qAPERIODIC)
#define UNRECTIFIED (variation == eVariation::unrectified)
#define WARPED (variation == eVariation::warped)
#define UNTRUNCATED (variation == eVariation::untruncated)

View File

@ -891,7 +891,7 @@ EX land_validity_t& land_validity(eLand l) {
return dont_work;
// mirrors do not work in kite and sol
if(among(l, laMirror, laMirrorOld) && (kite::in() || sol))
if(among(l, laMirror, laMirrorOld) && (aperiodic || sol))
return dont_work;
if(isCrossroads(l) && geometry == gBinary4)
@ -1033,7 +1033,7 @@ EX land_validity_t& land_validity(eLand l) {
return special_chaos;
return not_in_chaos;
}
if(arcm::in() || kite::in()) return not_implemented;
if(arcm::in() || aperiodic) return not_implemented;
if(closed_or_bounded) return unbounded_only;
if(INVERSE) return not_implemented;
}
@ -1193,7 +1193,7 @@ EX land_validity_t& land_validity(eLand l) {
return great_walls_missing;
// highlight Crossroads on Euclidean
if(euclid && !quotient && (l == laCrossroads || l == laCrossroads4) && !kite::in())
if(euclid && !quotient && (l == laCrossroads || l == laCrossroads4) && !aperiodic)
return full_game;
if(sol && among(l, laCrossroads, laCrossroads4))

View File

@ -1752,7 +1752,7 @@ EX namespace product {
EX bool validate_spin() {
if(mproduct) return hybrid::in_underlying_geometry(validate_spin);
if(kite::in()) return false;
if(aperiodic) return false;
if(!quotient && !arcm::in()) return true;
map<cell*, cellwalker> cws;
manual_celllister cl;

View File

@ -900,7 +900,7 @@ EX namespace patterns {
if(IRREGULAR || arcm::in() || bt::in() || arb::in() || WDIM == 3 || currentmap->strict_tree_rules()) si.symmetries = c->type;
else if(a46) val46(c, si, sub, pat);
else if(a38) val38(c, si, sub, pat);
else if(S7 < 6 && S3 == 3 && !INVERSE && !kite::in()) valSibling(c, si, sub, pat);
else if(S7 < 6 && S3 == 3 && !INVERSE && !aperiodic) valSibling(c, si, sub, pat);
else if(euc::in(2,4)) valEuclid4(c, si, sub);
else if(euc::in(2,6)) valEuclid6(c, si, sub);
else if(a4) val457(c, si, sub);
@ -1287,14 +1287,14 @@ EX bool geosupport_chessboard() {
#endif
WARPED ? true :
INVERSE ? false :
(bt::in() || kite::in()) ? 0 :
(bt::in() || aperiodic) ? 0 :
(S3 >= OINF) ? true :
(valence() % 2 == 0);
}
EX int geosupport_threecolor() {
if(IRREGULAR) return 0;
if(kite::in() || bt::in()) return 0;
if(aperiodic || bt::in()) return 0;
#if CAP_ARCM
if(arcm::in() && PURE) return arcm::current.support_threecolor();
if(arcm::in() && BITRUNCATED) return arcm::current.support_threecolor_bitruncated();
@ -1317,7 +1317,7 @@ EX int geosupport_football() {
// always works in bitrunc geometries
if(BITRUNCATED) return 2;
if(INVERSE) return 0;
if(bt::in() || kite::in()) return 0;
if(bt::in() || aperiodic) return 0;
#if CAP_ARCM
if(arcm::in() && DUAL) return false;

View File

@ -122,7 +122,7 @@ EX bool available() {
if(noGUI) return false;
if(!vid.usingGL) return false;
if(GDIM == 2) return false;
if(WDIM == 2 && (kite::in() || bt::in())) return false;
if(WDIM == 2 && (aperiodic || bt::in())) return false;
#ifdef GLES_ONLY
if(need_many_cell_types()) return false;
if(!euclid && !gproduct && !nil) return false;

View File

@ -2553,7 +2553,7 @@ EX void show() {
"tessellations (contrary to the basic implementation of Archimedean, tes, and unrectified/warped/untruncated tessellations).\n\nYou can convert mostly any "
"non-spherical periodic 2D tessellation to strict tree based.\n\nSwitching the map format erases your map."));
if(kite::in()) {
if(aperiodic) {
dialog::addInfo("not available in aperiodic tessellations");
dialog::addBack();
dialog::display();

View File

@ -1410,7 +1410,7 @@ EX void set_geometry(eGeometry target) {
if(DUAL && geometry != gArchimedean && !mhybrid)
variation = ginf[geometry].default_variation;
#if CAP_BT
if(bt::in() || WDIM == 3 || kite::in() || arb::in()) if(!mhybrid) variation = eVariation::pure;
if(bt::in() || WDIM == 3 || aperiodic || arb::in()) if(!mhybrid) variation = eVariation::pure;
#endif
if(S3 >= OINF) variation = eVariation::pure;
if(INVERSE && !mhybrid) variation = gp::variation_for(gp::param);
@ -1444,7 +1444,7 @@ EX void set_variation(eVariation target) {
return;
}
if(target != eVariation::pure) {
if(bt::in() || sol || kite::in() || WDIM == 3) if(!mproduct) geometry = gNormal;
if(bt::in() || sol || aperiodic || WDIM == 3) if(!mproduct) geometry = gNormal;
}
auto& cd = ginf[gCrystal];
if(target == eVariation::bitruncated && cryst && cd.sides == 8 && cd.vertex == 4) {