diff --git a/bigstuff.cpp b/bigstuff.cpp index 4e2a379f..9b2bbde5 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -1324,7 +1324,7 @@ EX int wallchance(cell *c, bool deepOcean) { /** should we generate the horocycles in the current geometry? */ EX bool horo_ok() { - return hyperbolic && !bt::in() && !arcm::in() && !penrose && !experimental && !hybri; + return hyperbolic && !bt::in() && !arcm::in() && !kite::in() && !experimental && !hybri; } EX bool gp_wall_test() { @@ -1378,7 +1378,7 @@ EX bool walls_not_implemented() { } EX void buildBigStuff(cell *c, cell *from) { - if(sphere || quotient || nonisotropic || (penrose && !bt::in()) || experimental) return; + if(sphere || quotient || nonisotropic || (kite::in() && !bt::in()) || experimental) return; if(chaosmode > 1) return; bool deepOcean = deep_ocean_at(c, from); diff --git a/binary-tiling.cpp b/binary-tiling.cpp index d9af684e..03308829 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -612,7 +612,7 @@ EX namespace bt { if(geometry == gBinary4) return 3; if(geometry == gTernary) return 4; if(geometry == gBinaryTiling) return 5; - if(penrose) return 0; + if(kite::in()) return 0; if(!bt::in()) return 0; return S7-1; } diff --git a/cell.cpp b/cell.cpp index fb9c3087..49482973 100644 --- a/cell.cpp +++ b/cell.cpp @@ -180,7 +180,7 @@ EX cell *createMov(cell *c, int d) { else if(hybri) hybrid::find_cell_connection(c, d); #if CAP_BT - else if(penrose) + else if(kite::in()) kite::find_cell_connection(c, d); #endif #if CAP_IRR @@ -279,7 +279,7 @@ EX void initcells() { #endif else if(euc::in()) currentmap = euc::new_map(); #if CAP_BT - else if(penrose) currentmap = kite::new_map(); + else if(kite::in()) currentmap = kite::new_map(); #endif #if MAXMDIM >= 4 else if(WDIM == 3 && !bt::in()) currentmap = reg3::new_map(); @@ -446,7 +446,7 @@ EX int celldist(cell *c) { return hybrid::celldistance(c, currentmap->gamestart()); if(nil && !quotient) return DISTANCE_UNKNOWN; if(euclid) return celldistance(currentmap->gamestart(), c); - if(sphere || bt::in() || WDIM == 3 || cryst || solnih || penrose) return celldistance(currentmap->gamestart(), c); + if(sphere || bt::in() || WDIM == 3 || cryst || solnih || kite::in()) return celldistance(currentmap->gamestart(), c); #if CAP_IRR if(IRREGULAR) return irr::celldist(c, false); #endif @@ -1017,7 +1017,7 @@ EX int celldistance(cell *c1, cell *c2) { return euc::cyldist(euc2_coordinates(c1), euc2_coordinates(c2)); } - if(arcm::in() || quotient || solnih || (penrose && euclid) || experimental || sl2 || nil) { + if(arcm::in() || quotient || solnih || (kite::in() && euclid) || experimental || sl2 || nil) { if(saved_distances.count(make_pair(c1,c2))) return saved_distances[make_pair(c1,c2)]; @@ -1043,7 +1043,7 @@ EX int celldistance(cell *c1, cell *c2) { #endif #if MAXMDIM >= 4 - if(euclid && !penrose && !arcm::in()) + if(euclid && !kite::in() && !arcm::in()) return euc::celldistance(c1, c2); if(hyperbolic && WDIM == 3) return reg3::celldistance(c1, c2); @@ -1238,7 +1238,7 @@ EX vector reverse_directions(heptagon *c, int dir) { } EX bool standard_tiling() { - return !arcm::in() && !penrose && !bt::in(); + return !arcm::in() && !kite::in() && !bt::in(); } } diff --git a/celldrawer.cpp b/celldrawer.cpp index ddee5e46..926b3cbf 100644 --- a/celldrawer.cpp +++ b/celldrawer.cpp @@ -1528,7 +1528,7 @@ void celldrawer::draw_features_and_walls_3d() { if(c->move(a) && (among(pmodel, mdPerspective, mdGeodesic) || gmatrix0.count(c->move(a)))) b = (patterns::innerwalls && (tC0(V)[2] < tC0(V * currentmap->adj(c, a))[2])) || !isWall3(c->move(a), dummy); if(b) { - if(pmodel == mdPerspective && !sphere && !quotient && !penrose && !nonisotropic && !hybri && !experimental && !nih) { + if(pmodel == mdPerspective && !sphere && !quotient && !kite::in() && !nonisotropic && !hybri && !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; else if(c->move(a)->master->distance > c->master->distance && c->master->distance > centerover->master->distance && !quotient) continue; diff --git a/classes.cpp b/classes.cpp index 9680fd23..0d8d226e 100644 --- a/classes.cpp +++ b/classes.cpp @@ -514,7 +514,7 @@ static const flagtype qsDOCKS = qANYQ | qSMALL | qBOUNDED | qDOCKS; static const flagtype qsSMALLB = qSMALL | qBOUNDED; static const flagtype qsSMALLBF = qsSMALLB | qsFIELD | qANYQ; static const flagtype qsSMALLBE = qsSMALLB | qELLIPTIC | qANYQ; -static const flagtype qsBP = qBINARY | qPENROSE; +static const flagtype qsBP = qBINARY | qKITE; EX geometryinfo1 giEuclid2 = { gcEuclid, 2, 2, 3, {1,1, 0,0 } }; EX geometryinfo1 giHyperb2 = { gcHyperbolic, 2, 2, 3, {1,1,-1,0 } }; @@ -582,7 +582,7 @@ vector ginf = { {"{5,3,4}","field", "{5,3,4} field quotient space", "f435", 12, 4, qsSMALLBF, giHyperb3, 0x40800, {{SEE_ALL, SEE_ALL}}, eVariation::pure}, {"binary4","none", "standard binary tiling", "binary4", 5, 3, qBINARY, giHyperb2, 0x41400, {{7, 5}}, eVariation::pure}, {"sol", "none", "Solv geometry", "sol", 8, 3, qBINARY|qSOL, giSolNIH, 0x41600, {{7, 5}}, eVariation::pure}, - {"kd2", "none", "kite-and-dart", "kd2", 4, 3, qPENROSE, giEuclid2, 0x48000, {{7, 7}}, eVariation::pure}, + {"kd2", "none", "kite-and-dart", "kd2", 4, 3, qKITE, giEuclid2, 0x48000, {{7, 7}}, eVariation::pure}, {"kd3", "none", "kite-and-dart on horospheres", "kd3", 12, 3, qsBP, giHyperb3, 0x48200, {{7, 3}}, eVariation::pure}, {"nil", "none", "Nil geometry", "nil", 6, 3, qOPTQ, giNil, 0x48600, {{7, 5}}, eVariation::pure}, {"product","none", "product space", "product", 7, 3, qHYBRID, giProduct, 0x00000, {{7, 3}}, eVariation::pure}, diff --git a/complex.cpp b/complex.cpp index 894912b1..95b98505 100644 --- a/complex.cpp +++ b/complex.cpp @@ -1104,7 +1104,7 @@ EX namespace mirror { #endif EX bool build(cell *c) { - if(penrose || sol) return false; + if(kite::in() || sol) return false; #if CAP_GP if(GOLDBERG) { if(c == c->master->c7) { @@ -1232,7 +1232,7 @@ EX namespace mirror { EX void createMirrors(cellwalker cw, int cpid) { - if(penrose || sol) return; + if(kite::in() || sol) return; #if CAP_ARCM if(arcm::in()) { diff --git a/expansion.cpp b/expansion.cpp index 3a4ae48d..9d6a290f 100644 --- a/expansion.cpp +++ b/expansion.cpp @@ -490,7 +490,7 @@ EX bool sizes_known() { if(bt::in()) return false; // not implemented if(arcm::in()) return false; - if(penrose) return false; + if(kite::in()) return false; return true; } diff --git a/floorshapes.cpp b/floorshapes.cpp index 806bacaa..54242156 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -650,7 +650,7 @@ void geometry_information::generate_floorshapes() { else if(GOLDBERG) { /* will be generated on the fly */ } #if CAP_BT - else if(penrose) { + else if(kite::in()) { dynamicval ncor(approx_nearcorner, true); for(int i=0; i<2; i++) { modelh.s = hstate(i); /* kite/dart shape */ @@ -834,7 +834,7 @@ EX int shvid(cell *c) { return pseudohept(c); else if(geometry == gBinaryTiling) return c->type-6; - else if(penrose) + else if(kite::in()) return kite::getshape(c->master); else if(geometry == gBinary4 || geometry == gTernary) return c->master->zebraval; @@ -870,7 +870,7 @@ EX struct dqi_poly *draw_shapevec(cell *c, const transmatrix& V, const vector(vid.binary_width, 1), crossf *= min(vid.binary_width, 1); #endif #if CAP_BT && MAXMDIM >= 4 diff --git a/geometry2.cpp b/geometry2.cpp index c37a3274..58e5679c 100644 --- a/geometry2.cpp +++ b/geometry2.cpp @@ -310,7 +310,7 @@ void hrmap_hyperbolic::virtualRebase(heptagon*& base, transmatrix& at) { } EX bool no_easy_spin() { - return NONSTDVAR || arcm::in() || WDIM == 3 || bt::in() || penrose; + return NONSTDVAR || arcm::in() || WDIM == 3 || bt::in() || kite::in(); } ld hrmap_standard::spin_angle(cell *c, int d) { @@ -369,7 +369,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() || penrose) { + if(NONSTDVAR || arcm::in() || kite::in()) { // Let these geometries be less confusing. // Also easier to implement ;) return xspinpush0(2 * M_PI * randd(), asinh(randd() / 20)); @@ -394,7 +394,7 @@ EX hyperpoint get_corner_position(cell *c, int cid, ld cf IS(3)) { } #endif #if CAP_BT - if(penrose) return kite::get_corner(c, cid, cf); + if(kite::in()) return kite::get_corner(c, cid, cf); if(bt::in()) { if(WDIM == 3) { println(hlog, "get_corner_position called"); @@ -502,7 +502,7 @@ EX hyperpoint nearcorner(cell *c, int i) { neis[5] = bt::get_horopoint(0, -1); return neis[i]; } - if(penrose) { + if(kite::in()) { if(approx_nearcorner) return kite::get_corner(c, i, 3) + kite::get_corner(c, i+1, 3) - C0; else @@ -560,7 +560,7 @@ EX hyperpoint farcorner(cell *c, int i, int which) { } #endif #if CAP_BT - if(bt::in() || penrose) + if(bt::in() || kite::in()) return nearcorner(c, (i+which) % c->type); // lazy #endif #if CAP_ARCM diff --git a/graph.cpp b/graph.cpp index 0feafddb..03536793 100644 --- a/graph.cpp +++ b/graph.cpp @@ -3507,7 +3507,7 @@ EX int get_darkval(cell *c, int d) { const int darkval_hrec[7] = {0,0,2,4,2,4,0}; const int darkval_sol[8] = {0,2,4,4,0,2,4,4}; const int darkval_arnold[12] = {0,2,0,2,4,5,0,2,0,2,4,5}; - const int darkval_penrose[12] = {0, 2, 0, 2, 4, 4, 6, 6, 6, 6, 6, 6}; + const int darkval_kite[12] = {0, 2, 0, 2, 4, 4, 6, 6, 6, 6, 6, 6}; const int darkval_nil[8] = {6,6,0,3,6,6,0,3}; const int darkval_nih[11] = {0,2,0,2,4,6,6,6,6,6,6}; if(sphere) return darkval_s12[d]; @@ -3516,7 +3516,7 @@ EX int get_darkval(cell *c, int d) { if(euclid && S7 == 14) return darkval_e14[d]; if(geometry == gHoroHex) return darkval_hh[d]; if(geometry == gHoroRec) return darkval_hrec[d]; - if(penrose) return darkval_penrose[d]; + if(kite::in()) return darkval_kite[d]; if(geometry == gArnoldCat) return darkval_arnold[d]; if(sol) return darkval_sol[d]; if(nih) return darkval_nih[d]; @@ -3610,7 +3610,7 @@ EX void gridline(const transmatrix& V, const hyperpoint h1, const hyperpoint h2, EX int wall_offset(cell *c) { if(hybri) return hybrid::wall_offset(c); - if(penrose && kite::getshape(c->master) == kite::pKite) return 10; + if(kite::in() && kite::getshape(c->master) == kite::pKite) return 10; return 0; } diff --git a/hyper.cpp b/hyper.cpp index f8854c65..0515f6a9 100644 --- a/hyper.cpp +++ b/hyper.cpp @@ -35,7 +35,7 @@ #include "binary-tiling.cpp" #include "nonisotropic.cpp" #include "asonov.cpp" -#include "penrose.cpp" +#include "kite.cpp" #include "archimedean.cpp" #include "arbitrile.cpp" #include "euclid.cpp" diff --git a/hyper.h b/hyper.h index c9d6308b..a41e7f62 100644 --- a/hyper.h +++ b/hyper.h @@ -120,7 +120,6 @@ void addMessage(string s, char spamtype = 0); #define cgflags cginf.flags #define cryst (cgflags & qCRYSTAL) -#define penrose (cgflags & qPENROSE) /** convenience flag for geometries with major aspects missing */ #define experimental (cgflags & qEXPERIMENTAL) diff --git a/hypgraph.cpp b/hypgraph.cpp index ad630925..30865438 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -989,7 +989,7 @@ EX transmatrix actualV(const heptspin& hs, const transmatrix& V) { #if CAP_BT if(bt::in()) return V; #endif - if(penrose) return V; + if(kite::in()) return V; return (hs.spin || !BITRUNCATED) ? V * spin(hs.spin*2*M_PI/S7 + master_to_c7_angle()) : V; } diff --git a/penrose.cpp b/kite.cpp similarity index 96% rename from penrose.cpp rename to kite.cpp index 0b433375..acd74ce5 100644 --- a/penrose.cpp +++ b/kite.cpp @@ -1,7 +1,7 @@ // Hyperbolic Rogue -- Kite-and-dart tiling // Copyright (C) 2011-2019 Zeno Rogue, see 'hyper.cpp' for details -/** \file penrose.cpp +/** \file kite.cpp * \brief Kite-and-dart tiling, both in R^2 and H^3 */ @@ -9,6 +9,9 @@ namespace hr { EX namespace kite { + +EX bool in() { return cgflags & qKITE; } + #if CAP_BT #if HDR @@ -442,7 +445,7 @@ EX void find_cell_connection(cell *c, int d) { } } -auto hooksw = addHook(hooks_swapdim, 100, [] { if(penrose && currentmap) kite_map()->make_graphrules(); }); +auto hooksw = addHook(hooks_swapdim, 100, [] { if(kite::in() && currentmap) kite_map()->make_graphrules(); }); #endif }} diff --git a/landlock.cpp b/landlock.cpp index 858d15d6..eb2e1aa2 100644 --- a/landlock.cpp +++ b/landlock.cpp @@ -831,8 +831,8 @@ EX land_validity_t& land_validity(eLand l) { if(among(l, laMirror, laMirrorOld) && (GOLDBERG && old_daily_id < 33)) return dont_work; - // mirrors do not work in penrose and sol - if(among(l, laMirror, laMirrorOld) && (penrose || sol)) + // mirrors do not work in kite and sol + if(among(l, laMirror, laMirrorOld) && (kite::in() || sol)) return dont_work; if(isCrossroads(l) && geometry == gBinary4) @@ -970,7 +970,7 @@ EX land_validity_t& land_validity(eLand l) { return special_chaos; return not_in_chaos; } - if(arcm::in() || penrose) return not_implemented; + if(arcm::in() || kite::in()) return not_implemented; if(bounded) return unbounded_only; } @@ -1129,7 +1129,7 @@ EX land_validity_t& land_validity(eLand l) { return great_walls_missing; // highlight Crossroads on Euclidean - if(euclid && !quotient && (l == laCrossroads || l == laCrossroads4) && !penrose) + if(euclid && !quotient && (l == laCrossroads || l == laCrossroads4) && !kite::in()) return full_game; if(sol && among(l, laCrossroads, laCrossroads4)) diff --git a/nonisotropic.cpp b/nonisotropic.cpp index 9d053ed7..501f4c6d 100644 --- a/nonisotropic.cpp +++ b/nonisotropic.cpp @@ -1383,7 +1383,7 @@ EX namespace product { EX bool validate_spin() { if(prod) return hybrid::in_underlying_geometry(validate_spin); - if(penrose) return false; + if(kite::in()) return false; if(!quotient && !arcm::in()) return true; map cws; manual_celllister cl; diff --git a/pattern2.cpp b/pattern2.cpp index e20d9fda..5395229a 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -381,7 +381,7 @@ EX int fieldval_uniq(cell *c) { if(ctof(c)) return c->master->fieldval; else return createMov(c, 0)->master->fieldval + 256 * createMov(c,2)->master->fieldval + (1<<16) * createMov(c,4)->master->fieldval; } - else if(euclid && !penrose && !arcm::in()) { + else if(euclid && !kite::in() && !arcm::in()) { auto p = euc2_coordinates(c); if(bounded) return p.first + (p.second << 16); return gmod(p.first - 22 * p.second, 3*127); @@ -1202,14 +1202,14 @@ EX bool geosupport_chessboard() { (arcm::in() && PURE) ? arcm::current.support_chessboard() : (arcm::in() && DUAL) ? arcm::current.support_threecolor_bitruncated() : #endif - (bt::in() || penrose) ? 0 : + (bt::in() || kite::in()) ? 0 : (S3 >= OINF) ? true : (VALENCE % 2 == 0); } EX int geosupport_threecolor() { if(IRREGULAR) return 0; - if(penrose || bt::in()) return 0; + if(kite::in() || 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(); @@ -1230,7 +1230,7 @@ EX int geosupport_threecolor() { EX int geosupport_football() { // always works in bitrunc geometries if(BITRUNCATED) return 2; - if(bt::in() || penrose) return 0; + if(bt::in() || kite::in()) return 0; #if CAP_ARCM if(arcm::in() && DUAL) return false; @@ -1387,7 +1387,7 @@ EX bool pseudohept(cell *c) { if(nil) return c->master->zebraval & c->master->emeraldval & c->master->fieldval & 1; if(sol) return (c->master->emeraldval % 3 == 2) && (c->master->zebraval % 3 == 2) && (c->master->distance % 2); if(nih) return c->master->zebraval % 3 == 2 && c->master->emeraldval % 2 == 1 && (c->master->distance % 2); - if(penrose) return kite::getshape(c->master) == kite::pDart; + if(kite::in()) return kite::getshape(c->master) == kite::pDart; if(bt::in()) return bt::pseudohept(c); #endif if(S3 >= OINF) return c->master->distance % 3 == 1; diff --git a/polygons.cpp b/polygons.cpp index cb9da16f..1bee85f3 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -424,7 +424,7 @@ void geometry_information::procedural_shapes() { else { ld rad0 = floorrad0, rad1 = floorrad1; - if(penrose) rad0 /= 2, rad1 /= 2; + if(kite::in()) rad0 /= 2, rad1 /= 2; if(S3 >= OINF) rad0 = rad1 = zhexf; bshape(shWall[0], PPR::WALL); for(int t=0; t<=S6; t++) { @@ -847,7 +847,7 @@ void geometry_information::reserve_wall3d(int i) { void geometry_information::create_wall3d() { if(WDIM == 2) return; - reserve_wall3d(penrose ? 22 : hybri ? 0 : S7); + reserve_wall3d(kite::in() ? 22 : hybri ? 0 : S7); if(GDIM == 3 && bt::in() && geometry == gBinary3) { hyperpoint h00 = point3(-1,-1,-1); hyperpoint h01 = point3(-1,0,-1); @@ -1002,7 +1002,7 @@ void geometry_information::create_wall3d() { } } - if(GDIM == 3 && !euclid && !bt::in() && !nonisotropic && !hybri && !penrose) { + if(GDIM == 3 && !euclid && !bt::in() && !nonisotropic && !hybri && !kite::in()) { reg3::generate(); int facesize = isize(reg3::cellshape) / S7; for(int w=0; wbase) * who->at; - if(racing::player_relative || quotient || (penrose && GDIM == 3)) { + if(racing::player_relative || quotient || (kite::in() && GDIM == 3)) { View = inverse(at) * View; } else { diff --git a/raycaster.cpp b/raycaster.cpp index a362cc15..9a5bb0ae 100644 --- a/raycaster.cpp +++ b/raycaster.cpp @@ -62,7 +62,7 @@ EX bool available() { if(noGUI) return false; if(!vid.usingGL) return false; if(WDIM == 2) return false; - if(hyperbolic && pmodel == mdPerspective && !penrose) + if(hyperbolic && pmodel == mdPerspective && !kite::in()) return true; if(nil && S7 == 8) return false; diff --git a/system.cpp b/system.cpp index a926d584..840f2bea 100644 --- a/system.cpp +++ b/system.cpp @@ -1215,7 +1215,7 @@ EX void set_geometry(eGeometry target) { if(DUAL && geometry != gArchimedean) variation = ginf[geometry].default_variation; #if CAP_BT - if(bt::in() || WDIM == 3 || penrose) if(!hybri) variation = eVariation::pure; + if(bt::in() || WDIM == 3 || kite::in()) if(!hybri) variation = eVariation::pure; #endif if(S3 == OINF) variation = eVariation::pure; if(was_default) pmodel = default_model(); @@ -1229,7 +1229,7 @@ EX void set_geometry(eGeometry target) { EX void set_variation(eVariation target) { if(variation != target) { stop_game(); - if(bt::in() || sol || penrose || WDIM == 3) if(!prod) geometry = gNormal; + if(bt::in() || sol || kite::in() || WDIM == 3) if(!prod) geometry = gNormal; auto& cd = ginf[gCrystal]; if(target == eVariation::bitruncated && cryst && cd.sides == 8 && cd.vertex == 4) { cd.vertex = 3; diff --git a/yendor.cpp b/yendor.cpp index 26b6d334..d40ba9a6 100644 --- a/yendor.cpp +++ b/yendor.cpp @@ -197,7 +197,7 @@ EX namespace yendor { } EX bool exhaustive_distance_appropriate() { - if(euclid && (penrose || arcm::in() || quotient)) return true; + if(euclid && (kite::in() || arcm::in() || quotient)) return true; if(nil && quotient) return true; if(asonov::in() && asonov::period_xy && asonov::period_xy <= 256) return true;