1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-01-23 15:36:59 +00:00

renamed binary:: to bt:: and binarytiling to bt::in()

This commit is contained in:
Zeno Rogue 2019-12-14 12:05:01 +01:00
parent c73c7a6855
commit d5c8aebf16
29 changed files with 204 additions and 202 deletions

View File

@ -827,7 +827,7 @@ EX bool buildBarrierNowall(cell *c, eLand l2, int forced_dir IS(NODIR)) {
if(geometry == gBinary4) return false; if(geometry == gBinary4) return false;
#if MAXMDIM >= 4 #if MAXMDIM >= 4
// 3D binary tilings create walls using their own methods // 3D binary tilings create walls using their own methods
if(WDIM == 3 && binarytiling) return false; if(WDIM == 3 && bt::in()) return false;
if(WDIM == 3 && hyperbolic) return buildBarrier3D(c, l2, forced_dir); if(WDIM == 3 && hyperbolic) return buildBarrier3D(c, l2, forced_dir);
#endif #endif

View File

@ -485,7 +485,7 @@ EX int coastval(cell *c, eLand base) {
EX bool checkInTree(cell *c, int maxv) { EX bool checkInTree(cell *c, int maxv) {
if(c->landparam <= 3) return false; if(c->landparam <= 3) return false;
if(!maxv && WDIM == 3 && binarytiling) { if(!maxv && WDIM == 3 && bt::in()) {
forCellEx(c2, c) if(c2->landflags) return true; forCellEx(c2, c) if(c2->landflags) return true;
} }
if(!maxv) return false; if(!maxv) return false;
@ -611,15 +611,15 @@ EX void buildEquidistant(cell *c) {
if(c->land == laEndorian) { if(c->land == laEndorian) {
int ct = c->type; int ct = c->type;
#if CAP_BT #if CAP_BT
if(binarytiling) { if(bt::in()) {
int skip = geometry == gHoroRec ? 3 : 2; int skip = geometry == gHoroRec ? 3 : 2;
int up = binary::updir(); int up = bt::updir();
if(c->landparam == 1) if(c->landparam == 1)
c->landflags = (hrand(100) < 20); c->landflags = (hrand(100) < 20);
else if(WDIM == 2 && c->type == 6 && (c->landparam % 2) && c->move(binary::bd_down) && c->move(binary::bd_down)->landflags) else if(WDIM == 2 && c->type == 6 && (c->landparam % 2) && c->move(bt::bd_down) && c->move(bt::bd_down)->landflags)
c->landflags = 1; c->landflags = 1;
else if(WDIM == 2 && c->type == 7 && (c->landparam % 2 == 0)) { else if(WDIM == 2 && c->type == 7 && (c->landparam % 2 == 0)) {
for(int d: {binary::bd_down_left, binary::bd_down_right}) for(int d: {bt::bd_down_left, bt::bd_down_right})
if(c->move(d) && c->move(d)->landflags) if(c->move(d) && c->move(d)->landflags)
c->landflags = 1; c->landflags = 1;
} }
@ -1324,7 +1324,7 @@ EX int wallchance(cell *c, bool deepOcean) {
/** should we generate the horocycles in the current geometry? */ /** should we generate the horocycles in the current geometry? */
EX bool horo_ok() { EX bool horo_ok() {
return hyperbolic && !binarytiling && !arcm::in() && !penrose && !experimental && !hybri; return hyperbolic && !bt::in() && !arcm::in() && !penrose && !experimental && !hybri;
} }
EX bool gp_wall_test() { EX bool gp_wall_test() {
@ -1378,7 +1378,7 @@ EX bool walls_not_implemented() {
} }
EX void buildBigStuff(cell *c, cell *from) { EX void buildBigStuff(cell *c, cell *from) {
if(sphere || quotient || nonisotropic || (penrose && !binarytiling) || experimental) return; if(sphere || quotient || nonisotropic || (penrose && !bt::in()) || experimental) return;
if(chaosmode > 1) return; if(chaosmode > 1) return;
bool deepOcean = deep_ocean_at(c, from); bool deepOcean = deep_ocean_at(c, from);
@ -1466,7 +1466,7 @@ EX void buildBigStuff(cell *c, cell *from) {
buildBarrier4(c, bd, 0, getNewLand(c->land), c->land); */ buildBarrier4(c, bd, 0, getNewLand(c->land), c->land); */
} }
if((!chaosmode) && bearsCamelot(c->land) && is_master(c) && !binarytiling && !(hyperbolic && WDIM == 3) && if((!chaosmode) && bearsCamelot(c->land) && is_master(c) && !bt::in() && !(hyperbolic && WDIM == 3) &&
(quickfind(laCamelot) || peace::on || (hrand(I2000) < (c->land == laCrossroads4 ? 800 : 200) && horo_ok() && (quickfind(laCamelot) || peace::on || (hrand(I2000) < (c->land == laCrossroads4 ? 800 : 200) && horo_ok() &&
items[itEmerald] >= U5 && !tactic::on && !racing::on))) { items[itEmerald] >= U5 && !tactic::on && !racing::on))) {
int rtr = newRoundTableRadius(); int rtr = newRoundTableRadius();
@ -1664,7 +1664,7 @@ EX int masterAlt(cell *c) {
EX void moreBigStuff(cell *c) { EX void moreBigStuff(cell *c) {
if((bearsCamelot(c->land) && !euclid && !quotient && !nil) || c->land == laCamelot) if((bearsCamelot(c->land) && !euclid && !quotient && !nil) || c->land == laCamelot)
if(eubinary || binarytiling || c->master->alt) if(!(binarytiling && specialland != laCamelot)) if(eubinary || bt::in() || c->master->alt) if(!(bt::in() && specialland != laCamelot))
buildCamelot(c); buildCamelot(c);
if(quotient) return; if(quotient) return;
@ -1701,7 +1701,7 @@ EX void moreBigStuff(cell *c) {
c->wall = waColumn; c->wall = waColumn;
} }
else if((c->land == laRlyeh && !euclid) || c->land == laTemple) if(!(binarytiling && specialland != laTemple && c->land == laRlyeh)) { else if((c->land == laRlyeh && !euclid) || c->land == laTemple) if(!(bt::in() && specialland != laTemple && c->land == laRlyeh)) {
if(eubinary || in_s2xe() || (c->master->alt && (tactic::on || masterAlt(c) <= 2))) { if(eubinary || in_s2xe() || (c->master->alt && (tactic::on || masterAlt(c) <= 2))) {
if(!eubinary && !chaosmode) currentmap->generateAlts(c->master); if(!eubinary && !chaosmode) currentmap->generateAlts(c->master);
preventbarriers(c); preventbarriers(c);
@ -1725,7 +1725,7 @@ EX void moreBigStuff(cell *c) {
c->wall = waColumn; c->wall = waColumn;
} }
else if(geometry == gHoroTris || geometry == gHoroRec) { else if(geometry == gHoroTris || geometry == gHoroRec) {
if(c->c.spin(binary::updir()) != 0) c->wall = waColumn; if(c->c.spin(bt::updir()) != 0) c->wall = waColumn;
} }
else if(geometry == gKiteDart3) { else if(geometry == gKiteDart3) {
if(kite::getshape(c->master) == kite::pKite) c->wall = waColumn; if(kite::getshape(c->master) == kite::pKite) c->wall = waColumn;
@ -1762,7 +1762,7 @@ EX void moreBigStuff(cell *c) {
} }
} }
if((c->land == laOvergrown && !euclid) || c->land == laClearing) if(!(binarytiling && specialland != laClearing)) { if((c->land == laOvergrown && !euclid) || c->land == laClearing) if(!(bt::in() && specialland != laClearing)) {
if(eubinary || (c->master->alt && (tactic::on || masterAlt(c) <= 2))) { if(eubinary || (c->master->alt && (tactic::on || masterAlt(c) <= 2))) {
if(!eubinary) currentmap->generateAlts(c->master); if(!eubinary) currentmap->generateAlts(c->master);
preventbarriers(c); preventbarriers(c);
@ -1775,7 +1775,7 @@ EX void moreBigStuff(cell *c) {
} }
} }
if((c->land == laJungle && !euclid) || c->land == laMountain) if(!(binarytiling && specialland != laMountain)) { if((c->land == laJungle && !euclid) || c->land == laMountain) if(!(bt::in() && specialland != laMountain)) {
if(eubinary || (c->master->alt && (tactic::on || masterAlt(c) <= 2))) { if(eubinary || (c->master->alt && (tactic::on || masterAlt(c) <= 2))) {
if(!eubinary) currentmap->generateAlts(c->master); if(!eubinary) currentmap->generateAlts(c->master);
preventbarriers(c); preventbarriers(c);
@ -1786,7 +1786,7 @@ EX void moreBigStuff(cell *c) {
} }
} }
if(among(c->land, laOcean, laWhirlpool, laBrownian)) if(!(binarytiling && specialland != laWhirlpool)) { if(among(c->land, laOcean, laWhirlpool, laBrownian)) if(!(bt::in() && specialland != laWhirlpool)) {
bool fullwhirlpool = false; bool fullwhirlpool = false;
if(tactic::on && specialland == laWhirlpool) if(tactic::on && specialland == laWhirlpool)
fullwhirlpool = true; fullwhirlpool = true;

View File

@ -8,9 +8,12 @@
#include "hyper.h" #include "hyper.h"
namespace hr { namespace hr {
EX namespace binary { EX namespace bt {
#if CAP_BT #if CAP_BT
/** note: nihsolv and kd3 tilings return bt::in(). They are defined elsewhere, although some of bt:: functions are used for them */
EX bool in() { return cgflags & qBINARY; }
#if HDR #if HDR
enum bindir { enum bindir {
bd_right = 0, bd_right = 0,
@ -194,10 +197,10 @@ EX namespace binary {
set_seed(); set_seed();
origin = hyperbolic_origin(); origin = hyperbolic_origin();
#if DEBUG_BINARY_TILING #if DEBUG_BINARY_TILING
binary::xcode.clear(); bt::xcode.clear();
binary::rxcode.clear(); bt::rxcode.clear();
binary::xcode[&h] = (1 << 16); bt::xcode[&h] = (1 << 16);
binary::rxcode[1<<16] = &h; bt::rxcode[1<<16] = &h;
#endif #endif
origin->zebraval = 0; origin->zebraval = 0;
origin->emeraldval = 0; origin->emeraldval = 0;
@ -461,7 +464,7 @@ EX namespace binary {
vector<hyperpoint> res; vector<hyperpoint> res;
ld yy = log(2) / 2; ld yy = log(2) / 2;
auto add = [&] (hyperpoint h) { auto add = [&] (hyperpoint h) {
res.push_back(binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2])); res.push_back(bt::parabolic3(h[0], h[1]) * xpush0(yy*h[2]));
}; };
switch(geometry) { switch(geometry) {
case gBinary3: case gBinary3:
@ -610,7 +613,7 @@ EX namespace binary {
if(geometry == gTernary) return 4; if(geometry == gTernary) return 4;
if(geometry == gBinaryTiling) return 5; if(geometry == gBinaryTiling) return 5;
if(penrose) return 0; if(penrose) return 0;
if(!binarytiling) return 0; if(!bt::in()) return 0;
return S7-1; return S7-1;
} }
@ -945,7 +948,7 @@ EX int celldistance3(heptagon *c1, heptagon *c2) {
case gHoroRec: return celldistance3_rec(c1, c2); case gHoroRec: return celldistance3_rec(c1, c2);
case gHoroHex: return celldistance3_hex(c1, c2); case gHoroHex: return celldistance3_hex(c1, c2);
default: default:
if(sol || !binarytiling) { if(sol || !bt::in()) {
println(hlog, "called celldistance3 for wrong geometry"); return 0; println(hlog, "called celldistance3 for wrong geometry"); return 0;
} }
return celldistance3_approx(c1, c2); return celldistance3_approx(c1, c2);
@ -956,7 +959,7 @@ EX int celldistance3(cell *c1, cell *c2) { return celldistance3(c1->master, c2->
#endif #endif
EX hyperpoint get_horopoint(ld y, ld x) { EX hyperpoint get_horopoint(ld y, ld x) {
return xpush(-y) * binary::parabolic(x) * C0; return xpush(-y) * bt::parabolic(x) * C0;
} }
EX hyperpoint get_horopoint(hyperpoint h) { EX hyperpoint get_horopoint(hyperpoint h) {
@ -1011,7 +1014,7 @@ EX hyperpoint get_corner_horo_coordinates(cell *c, int i) {
auto hooksw = addHook(hooks_swapdim, 100, [] { auto hooksw = addHook(hooks_swapdim, 100, [] {
if(binarytiling) build_tmatrix(); if(bt::in()) build_tmatrix();
}); });
} }

View File

@ -282,12 +282,12 @@ EX void initcells() {
else if(penrose) currentmap = kite::new_map(); else if(penrose) currentmap = kite::new_map();
#endif #endif
#if MAXMDIM >= 4 #if MAXMDIM >= 4
else if(WDIM == 3 && !binarytiling) currentmap = reg3::new_map(); else if(WDIM == 3 && !bt::in()) currentmap = reg3::new_map();
#endif #endif
else if(sphere) currentmap = new_spherical_map(); else if(sphere) currentmap = new_spherical_map();
else if(quotient) currentmap = quotientspace::new_map(); else if(quotient) currentmap = quotientspace::new_map();
#if CAP_BT #if CAP_BT
else if(binarytiling) currentmap = binary::new_map(); else if(bt::in()) currentmap = bt::new_map();
#endif #endif
else if(S3 >= OINF) currentmap = inforder::new_map(); else if(S3 >= OINF) currentmap = inforder::new_map();
else currentmap = new hrmap_hyperbolic; else currentmap = new hrmap_hyperbolic;
@ -325,7 +325,7 @@ template<class T> void subcell(cell *c, const T& t) {
subcell(c2, t); subcell(c2, t);
} }
} }
else if(BITRUNCATED && !arcm::in() && !binarytiling) else if(BITRUNCATED && !arcm::in() && !bt::in())
forCellEx(c2, c) t(c2); forCellEx(c2, c) t(c2);
t(c); t(c);
} }
@ -377,7 +377,7 @@ EX void clearfrom(heptagon *at) {
} }
} }
int edges = at->degree(); int edges = at->degree();
if(binarytiling && WDIM == 2) edges = at->c7->type; if(bt::in() && WDIM == 2) edges = at->c7->type;
for(int i=0; i<edges; i++) if(at->move(i)) { for(int i=0; i<edges; i++) if(at->move(i)) {
if(at->move(i)->alt != &deletion_marker) if(at->move(i)->alt != &deletion_marker)
q.push(at->move(i)); q.push(at->move(i));
@ -446,7 +446,7 @@ EX int celldist(cell *c) {
return hybrid::celldistance(c, currentmap->gamestart()); return hybrid::celldistance(c, currentmap->gamestart());
if(nil && !quotient) return DISTANCE_UNKNOWN; if(nil && !quotient) return DISTANCE_UNKNOWN;
if(euclid) return celldistance(currentmap->gamestart(), c); if(euclid) return celldistance(currentmap->gamestart(), c);
if(sphere || binarytiling || WDIM == 3 || cryst || solnih || penrose) return celldistance(currentmap->gamestart(), c); if(sphere || bt::in() || WDIM == 3 || cryst || solnih || penrose) return celldistance(currentmap->gamestart(), c);
#if CAP_IRR #if CAP_IRR
if(IRREGULAR) return irr::celldist(c, false); if(IRREGULAR) return irr::celldist(c, false);
#endif #endif
@ -477,7 +477,7 @@ EX int celldistAlt(cell *c) {
return d; return d;
} }
#if CAP_BT #if CAP_BT
if(binarytiling || solnih) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0); if(bt::in() || solnih) return c->master->distance + (specialland == laCamelot && !tactic::on? 30 : 0);
#endif #endif
if(nil) return c->master->zebraval + abs(c->master->emeraldval) + (specialland == laCamelot && !tactic::on? 30 : 0);; if(nil) return c->master->zebraval + abs(c->master->emeraldval) + (specialland == laCamelot && !tactic::on? 30 : 0);;
#if CAP_CRYSTAL #if CAP_CRYSTAL
@ -746,9 +746,9 @@ cdata *getHeptagonCdata(heptagon *h) {
if(sphere || quotient) h = currentmap->gamestart()->master; if(sphere || quotient) h = currentmap->gamestart()->master;
bool starting = h->s == hsOrigin; bool starting = h->s == hsOrigin;
if(binarytiling) { if(bt::in()) {
if(binary::mapside(h) == 0) starting = true; if(bt::mapside(h) == 0) starting = true;
for(int i=0; i<h->type; i++) if(binary::mapside(h->cmove(i)) == 0) starting = true; for(int i=0; i<h->type; i++) if(bt::mapside(h->cmove(i)) == 0) starting = true;
} }
if(starting) { if(starting) {
@ -759,7 +759,7 @@ cdata *getHeptagonCdata(heptagon *h) {
return h->cdata; return h->cdata;
} }
int dir = binarytiling ? 5 : 0; int dir = bt::in() ? 5 : 0;
cdata mydata = *getHeptagonCdata(h->cmove(dir)); cdata mydata = *getHeptagonCdata(h->cmove(dir));
@ -920,8 +920,8 @@ EX int heptdistance(heptagon *h1, heptagon *h2) {
if(h1 == h2) return d; if(h1 == h2) return d;
for(int i=0; i<S7; i++) if(h1->move(i) == h2) return d + 1; for(int i=0; i<S7; i++) if(h1->move(i) == h2) return d + 1;
int d1 = h1->distance, d2 = h2->distance; int d1 = h1->distance, d2 = h2->distance;
if(d1 >= d2) d++, h1 = createStep(h1, binary::updir()); if(d1 >= d2) d++, h1 = createStep(h1, bt::updir());
if(d2 > d1) d++, h2 = createStep(h2, binary::updir()); if(d2 > d1) d++, h2 = createStep(h2, bt::updir());
} }
} }
@ -1038,8 +1038,8 @@ EX int celldistance(cell *c1, cell *c2) {
if(S3 >= OINF) return inforder::celldistance(c1, c2); if(S3 >= OINF) return inforder::celldistance(c1, c2);
#if CAP_BT && MAXMDIM >= 4 #if CAP_BT && MAXMDIM >= 4
if(binarytiling && WDIM == 3) if(bt::in() && WDIM == 3)
return binary::celldistance3(c1, c2); return bt::celldistance3(c1, c2);
#endif #endif
#if MAXMDIM >= 4 #if MAXMDIM >= 4
@ -1238,7 +1238,7 @@ EX vector<int> reverse_directions(heptagon *c, int dir) {
} }
EX bool standard_tiling() { EX bool standard_tiling() {
return !arcm::in() && !penrose && !binarytiling; return !arcm::in() && !penrose && !bt::in();
} }
} }

View File

@ -791,28 +791,28 @@ void celldrawer::draw_grid() {
int ofs = wall_offset(c); int ofs = wall_offset(c);
for(int t=0; t<c->type; t++) { for(int t=0; t<c->type; t++) {
if(!c->move(t)) continue; if(!c->move(t)) continue;
if(binarytiling && !sol && !among(t, 5, 6, 8)) continue; if(bt::in() && !sol && !among(t, 5, 6, 8)) continue;
if(!binarytiling && c->move(t) < c) continue; if(!bt::in() && c->move(t) < c) continue;
dynamicval<color_t> g(poly_outline, gridcolor(c, c->move(t))); dynamicval<color_t> g(poly_outline, gridcolor(c, c->move(t)));
queuepoly(V, cgi.shWireframe3D[ofs + t], 0); queuepoly(V, cgi.shWireframe3D[ofs + t], 0);
} }
} }
#endif #endif
#if CAP_BT #if CAP_BT
else if(binarytiling && WDIM == 2 && geometry != gTernary) { else if(bt::in() && WDIM == 2 && geometry != gTernary) {
ld yx = log(2) / 2; ld yx = log(2) / 2;
ld yy = yx; ld yy = yx;
ld xx = 1 / sqrt(2)/2; ld xx = 1 / sqrt(2)/2;
queueline(V * binary::get_horopoint(-yy, xx), V * binary::get_horopoint(yy, 2*xx), gridcolor(c, c->move(binary::bd_right)), prec); queueline(V * bt::get_horopoint(-yy, xx), V * bt::get_horopoint(yy, 2*xx), gridcolor(c, c->move(bt::bd_right)), prec);
auto horizontal = [&] (ld y, ld x1, ld x2, int steps, int dir) { auto horizontal = [&] (ld y, ld x1, ld x2, int steps, int dir) {
if(vid.linequality > 0) steps <<= vid.linequality; if(vid.linequality > 0) steps <<= vid.linequality;
if(vid.linequality < 0) steps >>= -vid.linequality; if(vid.linequality < 0) steps >>= -vid.linequality;
for(int i=0; i<=steps; i++) curvepoint(V * binary::get_horopoint(y, x1 + (x2-x1) * i / steps)); for(int i=0; i<=steps; i++) curvepoint(V * bt::get_horopoint(y, x1 + (x2-x1) * i / steps));
queuecurve(gridcolor(c, c->move(dir)), 0, PPR::LINE); queuecurve(gridcolor(c, c->move(dir)), 0, PPR::LINE);
}; };
horizontal(yy, 2*xx, xx, 4, binary::bd_up_right); horizontal(yy, 2*xx, xx, 4, bt::bd_up_right);
horizontal(yy, xx, -xx, 8, binary::bd_up); horizontal(yy, xx, -xx, 8, bt::bd_up);
horizontal(yy, -xx, -2*xx, 4, binary::bd_up_left); horizontal(yy, -xx, -2*xx, 4, bt::bd_up_left);
} }
#endif #endif
else if(isWarped(c) && has_nice_dual()) { else if(isWarped(c) && has_nice_dual()) {
@ -1027,7 +1027,7 @@ void celldrawer::set_land_floor(const transmatrix& Vf) {
case laSwitch: case laSwitch:
set_floor(cgi.shSwitchFloor); set_floor(cgi.shSwitchFloor);
if(ctof(c) && STDVAR && !arcm::in() && !binarytiling && GDIM == 2) for(int i=0; i<c->type; i++) if(ctof(c) && STDVAR && !arcm::in() && !bt::in() && GDIM == 2) for(int i=0; i<c->type; i++)
queuepoly(Vf * ddspin(c, i, M_PI/S7) * xpush(cgi.rhexf), cgi.shSwitchDisk, darkena(minf[active_switch()].color, fd, 0xFF)); queuepoly(Vf * ddspin(c, i, M_PI/S7) * xpush(cgi.rhexf), cgi.shSwitchDisk, darkena(minf[active_switch()].color, fd, 0xFF));
break; break;
@ -1639,7 +1639,7 @@ void celldrawer::check_rotations() {
if(0); if(0);
#if CAP_BT #if CAP_BT
else if(binarytiling && models::do_rotate >= 2) { else if(bt::in() && models::do_rotate >= 2) {
if(!straightDownSeek || c->master->distance < straightDownSeek->master->distance) { if(!straightDownSeek || c->master->distance < straightDownSeek->master->distance) {
usethis = true; usethis = true;
spd = 1; spd = 1;

View File

@ -1120,7 +1120,7 @@ EX namespace mirror {
return true; return true;
} }
#endif #endif
if(binarytiling || IRREGULAR) { if(bt::in() || IRREGULAR) {
// mirrors not supported // mirrors not supported
if(is_mirrorland(c)) { if(is_mirrorland(c)) {
c->item = itShard; c->item = itShard;
@ -1245,7 +1245,7 @@ EX namespace mirror {
cell *c = cw.at; cell *c = cw.at;
#if MAXMDIM >= 4 #if MAXMDIM >= 4
if(WDIM == 3 && !binarytiling) { if(WDIM == 3 && !bt::in()) {
if(shmup::on) for(int i=0; i<cw.at->type; i++) if(shmup::on) for(int i=0; i<cw.at->type; i++)
createMirror(cw + i + wstep - i, cpid); createMirror(cw + i + wstep - i, cpid);
return; return;
@ -1276,7 +1276,7 @@ EX namespace mirror {
} }
#endif #endif
#if MAXMDIM >= 4 #if MAXMDIM >= 4
if(WDIM == 3 && !binarytiling) { if(WDIM == 3 && !bt::in()) {
if(shmup::on) for(int i=0; i<cw.at->type; i++) if(shmup::on) for(int i=0; i<cw.at->type; i++)
createMirror(cw + i + wstep - i, cpid); createMirror(cw + i + wstep - i, cpid);
return; return;
@ -2700,7 +2700,7 @@ EX namespace sword {
sword_angles = 2; sword_angles = 2;
if(SWORDDIM == 3) sword_angles = 1; if(SWORDDIM == 3) sword_angles = 1;
else if(IRREGULAR) sword_angles = 840; else if(IRREGULAR) sword_angles = 840;
else if(binarytiling) sword_angles = 42; else if(bt::in()) sword_angles = 42;
else if(arcm::in()) { else if(arcm::in()) {
if(!PURE) possible_divisor((BITRUNCATED ? 2 : 1) * isize(arcm::current.faces)); if(!PURE) possible_divisor((BITRUNCATED ? 2 : 1) * isize(arcm::current.faces));
if(!DUAL) for(int f: arcm::current.faces) possible_divisor(f); if(!DUAL) for(int f: arcm::current.faces) possible_divisor(f);

View File

@ -220,7 +220,7 @@ vector<int> expansion_analyzer::gettype(cell *c) {
for(int i=0; i<c->type; i++) { for(int i=0; i<c->type; i++) {
cell *c1 = c->cmove(i); cell *c1 = c->cmove(i);
int bonus = 0; int bonus = 0;
if(binarytiling) bonus += 16 * (celldistAlt(c1) - celldistAlt(c)); if(bt::in()) bonus += 16 * (celldistAlt(c1) - celldistAlt(c));
res.push_back(bonus + subtype(c1) * 4 + celldist(c1) - d); res.push_back(bonus + subtype(c1) * 4 + celldist(c1) - d);
} }
canonicize(res); canonicize(res);
@ -452,7 +452,7 @@ EX int type_in(expansion_analyzer& ea, cell *c, const cellfunction& f) {
for(int i=0; i<c->type; i++) { for(int i=0; i<c->type; i++) {
cell *c1 = c->cmove(i); cell *c1 = c->cmove(i);
int bonus = 0; int bonus = 0;
if(binarytiling) bonus += 16 * (celldistAlt(c1) - celldistAlt(c)); if(bt::in()) bonus += 16 * (celldistAlt(c1) - celldistAlt(c));
res.push_back(bonus + subtype(c1) * 4 + f(c1) - d); res.push_back(bonus + subtype(c1) * 4 + f(c1) - d);
} }
@ -487,7 +487,7 @@ EX bool sizes_known() {
if(GDIM == 3) return false; if(GDIM == 3) return false;
if(bounded) return false; if(bounded) return false;
// Castle Anthrax is infinite // Castle Anthrax is infinite
if(binarytiling) return false; if(bt::in()) return false;
// not implemented // not implemented
if(arcm::in()) return false; if(arcm::in()) return false;
if(penrose) return false; if(penrose) return false;
@ -795,7 +795,7 @@ void expansion_analyzer::view_distances_dialog() {
dialog::addBreak(100 * scrolltime / scrollspeed); dialog::addBreak(100 * scrolltime / scrollspeed);
if(sizes_known() || binarytiling) { if(sizes_known() || bt::in()) {
if(euclid) { if(euclid) {
dialog::addBreak(200); dialog::addBreak(200);
dialog::addInfo("a(d) = " + its(get_descendants(10).approx_int() - get_descendants(9).approx_int()) + "d", forecolor); dialog::addInfo("a(d) = " + its(get_descendants(10).approx_int() - get_descendants(9).approx_int()) + "d", forecolor);
@ -976,7 +976,7 @@ EX void set_sibling_limit() {
else if(IRREGULAR) sibling_limit = 3; else if(IRREGULAR) sibling_limit = 3;
#endif #endif
#if CAP_BT #if CAP_BT
else if(binarytiling) sibling_limit = 3; else if(bt::in()) sibling_limit = 3;
#endif #endif
#if CAP_GP #if CAP_GP
else { else {
@ -989,7 +989,7 @@ EX void set_sibling_limit() {
} }
int celldist0(cell *c) { int celldist0(cell *c) {
if(binarytiling) return celldistAlt(c); if(bt::in()) return celldistAlt(c);
else return celldist(c); else return celldist(c);
} }

View File

@ -257,7 +257,7 @@ void geometry_information::bshape_regular(floorshape &fsh, int id, int sides, in
sizeto(fsh.shadow, id); sizeto(fsh.shadow, id);
#if CAP_BT #if CAP_BT
if(binarytiling) { if(bt::in()) {
const int STEP = vid.texture_step; const int STEP = vid.texture_step;
@ -269,12 +269,12 @@ void geometry_information::bshape_regular(floorshape &fsh, int id, int sides, in
bshape(fsh.shadow[id], fsh.prio); bshape(fsh.shadow[id], fsh.prio);
for(int i=0; i<sides; i++) { for(int i=0; i<sides; i++) {
hyperpoint h0 = binary::get_corner_horo_coordinates(c, i) * size; hyperpoint h0 = bt::get_corner_horo_coordinates(c, i) * size;
hyperpoint h1 = binary::get_corner_horo_coordinates(c, i+1) * size; hyperpoint h1 = bt::get_corner_horo_coordinates(c, i+1) * size;
if(t) h0 *= SHADMUL, h1 *= SHADMUL; if(t) h0 *= SHADMUL, h1 *= SHADMUL;
hyperpoint hd = (h1 - h0) / STEP; hyperpoint hd = (h1 - h0) / STEP;
for(int j=0; j<STEP; j++) for(int j=0; j<STEP; j++)
hpcpush(binary::get_horopoint(h0 + hd * j)); hpcpush(bt::get_horopoint(h0 + hd * j));
} }
hpcpush(hpc[last->s]); hpcpush(hpc[last->s]);
@ -284,11 +284,11 @@ void geometry_information::bshape_regular(floorshape &fsh, int id, int sides, in
for(int i=0; i<c->type; i++) { for(int i=0; i<c->type; i++) {
sizeto(fsh.gpside[k][i], id); sizeto(fsh.gpside[k][i], id);
bshape(fsh.gpside[k][i][id], PPR::LAKEWALL); bshape(fsh.gpside[k][i][id], PPR::LAKEWALL);
hyperpoint h0 = binary::get_corner_horo_coordinates(c, i) * size; hyperpoint h0 = bt::get_corner_horo_coordinates(c, i) * size;
hyperpoint h1 = binary::get_corner_horo_coordinates(c, i+1) * size; hyperpoint h1 = bt::get_corner_horo_coordinates(c, i+1) * size;
hyperpoint hd = (h1 - h0) / STEP; hyperpoint hd = (h1 - h0) / STEP;
for(int j=0; j<=STEP; j++) for(int j=0; j<=STEP; j++)
hpcpush(iddspin(c, i) * binary::get_horopoint(h0 + hd * j)); hpcpush(iddspin(c, i) * bt::get_horopoint(h0 + hd * j));
chasmifyPoly(dlow_table[k], dhi_table[k], k); chasmifyPoly(dlow_table[k], dhi_table[k], k);
} }
} }
@ -326,7 +326,7 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
for(auto pfsh: all_plain_floorshapes) { for(auto pfsh: all_plain_floorshapes) {
auto& fsh = *pfsh; auto& fsh = *pfsh;
if(STDVAR && (standard_tiling() || binarytiling)) { if(STDVAR && (standard_tiling() || bt::in())) {
ld hexside = fsh.rad0, heptside = fsh.rad1; ld hexside = fsh.rad0, heptside = fsh.rad1;
@ -525,12 +525,12 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
last->texture_offset = 0; last->texture_offset = 0;
#if CAP_BT #if CAP_BT
if(binarytiling) if(bt::in())
for(int t=0; t<c->type; t++) for(int t=0; t<c->type; t++)
texture_order([&] (ld x, ld y) { texture_order([&] (ld x, ld y) {
hyperpoint left = binary::get_corner_horo_coordinates(c, t); hyperpoint left = bt::get_corner_horo_coordinates(c, t);
hyperpoint right = binary::get_corner_horo_coordinates(c, t+1); hyperpoint right = bt::get_corner_horo_coordinates(c, t+1);
hpcpush(orthogonal_move(binary::get_horopoint(left * x + right * y), dfloor_table[k])); hpcpush(orthogonal_move(bt::get_horopoint(left * x + right * y), dfloor_table[k]));
}); });
else else
#endif #endif
@ -554,12 +554,12 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
ld h = (FLOOR - WALL) / (co+1); ld h = (FLOOR - WALL) / (co+1);
ld top = co ? (FLOOR + WALL) / 2 : WALL; ld top = co ? (FLOOR + WALL) / 2 : WALL;
#if CAP_BT #if CAP_BT
if(binarytiling) if(bt::in())
for(int t=0; t<c->type; t++) for(int t=0; t<c->type; t++)
texture_order([&] (ld x, ld y) { texture_order([&] (ld x, ld y) {
hyperpoint left = binary::get_corner_horo_coordinates(c, t); hyperpoint left = bt::get_corner_horo_coordinates(c, t);
hyperpoint right = binary::get_corner_horo_coordinates(c, t+1); hyperpoint right = bt::get_corner_horo_coordinates(c, t+1);
hpcpush(orthogonal_move(binary::get_horopoint(left * x + right * y), top + h * (x+y))); hpcpush(orthogonal_move(bt::get_horopoint(left * x + right * y), top + h * (x+y)));
}); });
else else
#endif #endif
@ -725,7 +725,7 @@ void geometry_information::generate_floorshapes() {
else { else {
cell model; cell model;
model.type = S6; generate_floorshapes_for(0, &model, 0, 0); model.type = S6; generate_floorshapes_for(0, &model, 0, 0);
model.type = S7; generate_floorshapes_for(1, &model, binarytiling ? 0 : 1, 0); model.type = S7; generate_floorshapes_for(1, &model, bt::in() ? 0 : 1, 0);
} }
} }

View File

@ -235,7 +235,7 @@ EX geometry_filter gf_regular_2d = {"regular 2D tesselations", [] {
}}; }};
EX geometry_filter gf_regular_3d = {"regular 3D honeycombs", [] { EX geometry_filter gf_regular_3d = {"regular 3D honeycombs", [] {
if(euclid) return geometry == gCubeTiling; if(euclid) return geometry == gCubeTiling;
return !binarytiling && !penrose && WDIM == 3 && !forced_quotient() && !nonisotropic && !prod; return !bt::in() && !penrose && WDIM == 3 && !forced_quotient() && !nonisotropic && !prod;
}}; }};
EX geometry_filter gf_quotient = {"interesting quotient spaces", [] { EX geometry_filter gf_quotient = {"interesting quotient spaces", [] {
return forced_quotient() && !elliptic; return forced_quotient() && !elliptic;
@ -290,7 +290,7 @@ void set_or_configure_geometry(eGeometry g) {
if(g == gRotSpace) { if(g == gRotSpace) {
bool ok = true; bool ok = true;
if(arcm::in()) ok = PURE; if(arcm::in()) ok = PURE;
else if(binarytiling || penrose) ok = false; else if(bt::in() || penrose) ok = false;
else ok = PURE || BITRUNCATED; else ok = PURE || BITRUNCATED;
if(!ok) { if(!ok) {
addMessage(XLAT("Only works with (semi-)regular tilings")); addMessage(XLAT("Only works with (semi-)regular tilings"));
@ -611,7 +611,7 @@ EX void showEuclideanMenu() {
} }
#endif #endif
#if CAP_BT #if CAP_BT
else if(binarytiling) else if(bt::in())
spf = "6,[6,7],7"; spf = "6,[6,7],7";
#endif #endif
else if(BITRUNCATED) else if(BITRUNCATED)
@ -664,7 +664,7 @@ EX void showEuclideanMenu() {
else if(hybri) { else if(hybri) {
dialog::addSelItem(XLAT("number of levels"), its(cgi.steps / cgi.single_step), 0); dialog::addSelItem(XLAT("number of levels"), its(cgi.steps / cgi.single_step), 0);
} }
else if(binarytiling) { else if(bt::in()) {
dialog::addSelItem(XLAT("width"), fts(vid.binary_width), 'v'); dialog::addSelItem(XLAT("width"), fts(vid.binary_width), 'v');
dialog::add_action([] { dialog::add_action([] {
dialog::editNumber(vid.binary_width, 0, 2, 0.1, 1, XLAT("binary tiling width"), ""); dialog::editNumber(vid.binary_width, 0, 2, 0.1, 1, XLAT("binary tiling width"), "");
@ -798,7 +798,7 @@ EX void showEuclideanMenu() {
dialog::addSelItem(XLAT("size of the world"), dialog::addSelItem(XLAT("size of the world"),
#if CAP_BT #if CAP_BT
binarytiling ? fts(8 * M_PI * sqrt(2) * log(2) / pow(vid.binary_width, WDIM-1), 4) + " exp(∞)" : bt::in() ? fts(8 * M_PI * sqrt(2) * log(2) / pow(vid.binary_width, WDIM-1), 4) + " exp(∞)" :
#endif #endif
#if CAP_ARCM #if CAP_ARCM
arcm::in() && (WDIM == 2) ? arcm::current.world_size() : arcm::in() && (WDIM == 2) ? arcm::current.world_size() :

View File

@ -442,7 +442,7 @@ void geometry_information::prepare_basics() {
goto hybrid_finish; goto hybrid_finish;
} }
if((sphere || hyperbolic) && WDIM == 3 && !binarytiling) { if((sphere || hyperbolic) && WDIM == 3 && !bt::in()) {
rhexf = hexf = 0.378077; rhexf = hexf = 0.378077;
crossf = hcrossf = 0.620672; crossf = hcrossf = 0.620672;
tessf = 1.090550; tessf = 1.090550;
@ -509,12 +509,12 @@ void geometry_information::prepare_basics() {
} }
#endif #endif
#if CAP_BT #if CAP_BT
if(binarytiling) hexvdist = rhexf = 1, tessf = 1, scalefactor = 1, crossf = hcrossf7; if(bt::in()) hexvdist = rhexf = 1, tessf = 1, scalefactor = 1, crossf = hcrossf7;
if(geometry == gHoroRec || penrose || sol || nil || nih) hexvdist = rhexf = .5, tessf = .5, scalefactor = .5, crossf = hcrossf7/2; if(geometry == gHoroRec || penrose || sol || nil || nih) hexvdist = rhexf = .5, tessf = .5, scalefactor = .5, crossf = hcrossf7/2;
if(binarytiling) scalefactor *= min<ld>(vid.binary_width, 1), crossf *= min<ld>(vid.binary_width, 1); if(bt::in()) scalefactor *= min<ld>(vid.binary_width, 1), crossf *= min<ld>(vid.binary_width, 1);
#endif #endif
#if CAP_BT && MAXMDIM >= 4 #if CAP_BT && MAXMDIM >= 4
if(binarytiling) binary::build_tmatrix(); if(bt::in()) bt::build_tmatrix();
#endif #endif
hybrid_finish: hybrid_finish:
@ -880,7 +880,7 @@ EX void check_cgi() {
if(cryst) V("CRYSTAL", its(ginf[gCrystal].sides) + its(ginf[gCrystal].vertex)); if(cryst) V("CRYSTAL", its(ginf[gCrystal].sides) + its(ginf[gCrystal].vertex));
if(binarytiling || GDIM == 3) V("WQ", its(vid.texture_step)); if(bt::in() || GDIM == 3) V("WQ", its(vid.texture_step));
if(hybri) V("U", its(int(hybrid::underlying))); if(hybri) V("U", its(int(hybrid::underlying)));
@ -891,7 +891,7 @@ EX void check_cgi() {
if(geometry == gFieldQuotient) { V("S3=", its(S3)); V("S7=", its(S7)); } if(geometry == gFieldQuotient) { V("S3=", its(S3)); V("S7=", its(S7)); }
if(nil) V("NIL", its(S7)); if(nil) V("NIL", its(S7));
if(binarytiling) V("BT", fts(vid.binary_width)); if(bt::in()) V("BT", fts(vid.binary_width));
if(GDIM == 2) { if(GDIM == 2) {
V("CAMERA", fts(vid.camera)); V("CAMERA", fts(vid.camera));

View File

@ -185,9 +185,9 @@ void horo_distance::become(hyperpoint h1) {
b = hypot_d(2, h1); b = hypot_d(2, h1);
} }
#if CAP_BT #if CAP_BT
else if(binarytiling) { else if(bt::in()) {
b = intval(h1, C0); b = intval(h1, C0);
a = abs(binary::horo_level(h1)); a = abs(bt::horo_level(h1));
} }
#endif #endif
else if(hybri) else if(hybri)
@ -198,7 +198,7 @@ void horo_distance::become(hyperpoint h1) {
horo_distance::horo_distance(hyperpoint h1, const transmatrix& T) { horo_distance::horo_distance(hyperpoint h1, const transmatrix& T) {
#if CAP_BT #if CAP_BT
if(binarytiling) become(inverse(T) * h1); if(bt::in()) become(inverse(T) * h1);
else else
#endif #endif
if(solnih || hybri || nil) become(inverse(T) * h1); if(solnih || hybri || nil) become(inverse(T) * h1);
@ -208,7 +208,7 @@ horo_distance::horo_distance(hyperpoint h1, const transmatrix& T) {
bool horo_distance::operator < (const horo_distance z) const { bool horo_distance::operator < (const horo_distance z) const {
#if CAP_BT #if CAP_BT
if(binarytiling || solnih) { if(bt::in() || solnih) {
if(a < z.a-1e-6) return true; if(a < z.a-1e-6) return true;
if(a > z.a+1e-6) return false; if(a > z.a+1e-6) return false;
} }
@ -310,7 +310,7 @@ void hrmap_hyperbolic::virtualRebase(heptagon*& base, transmatrix& at) {
} }
EX bool no_easy_spin() { EX bool no_easy_spin() {
return NONSTDVAR || arcm::in() || WDIM == 3 || binarytiling || penrose; return NONSTDVAR || arcm::in() || WDIM == 3 || bt::in() || penrose;
} }
ld hrmap_standard::spin_angle(cell *c, int d) { ld hrmap_standard::spin_angle(cell *c, int d) {
@ -395,12 +395,12 @@ EX hyperpoint get_corner_position(cell *c, int cid, ld cf IS(3)) {
#endif #endif
#if CAP_BT #if CAP_BT
if(penrose) return kite::get_corner(c, cid, cf); if(penrose) return kite::get_corner(c, cid, cf);
if(binarytiling) { if(bt::in()) {
if(WDIM == 3) { if(WDIM == 3) {
println(hlog, "get_corner_position called"); println(hlog, "get_corner_position called");
return C0; return C0;
} }
return mid_at_actual(binary::get_horopoint(binary::get_corner_horo_coordinates(c, cid)), 3/cf); return mid_at_actual(bt::get_horopoint(bt::get_corner_horo_coordinates(c, cid)), 3/cf);
} }
#endif #endif
#if CAP_ARCM #if CAP_ARCM
@ -483,23 +483,23 @@ EX hyperpoint nearcorner(cell *c, int i) {
ld yx = log(2) / 2; ld yx = log(2) / 2;
ld yy = yx; ld yy = yx;
hyperpoint neis[5]; hyperpoint neis[5];
neis[0] = binary::get_horopoint(2*yy, -0.5); neis[0] = bt::get_horopoint(2*yy, -0.5);
neis[1] = binary::get_horopoint(2*yy, +0.5); neis[1] = bt::get_horopoint(2*yy, +0.5);
neis[2] = binary::get_horopoint(0, 1); neis[2] = bt::get_horopoint(0, 1);
neis[3] = binary::get_horopoint(-2*yy, c->master->zebraval ? -0.25 : +0.25); neis[3] = bt::get_horopoint(-2*yy, c->master->zebraval ? -0.25 : +0.25);
neis[4] = binary::get_horopoint(0, -1); neis[4] = bt::get_horopoint(0, -1);
return neis[i]; return neis[i];
} }
if(geometry == gTernary) { if(geometry == gTernary) {
ld yx = log(3) / 2; ld yx = log(3) / 2;
ld yy = yx; ld yy = yx;
hyperpoint neis[6]; hyperpoint neis[6];
neis[0] = binary::get_horopoint(2*yy, -1); neis[0] = bt::get_horopoint(2*yy, -1);
neis[1] = binary::get_horopoint(2*yy, +0); neis[1] = bt::get_horopoint(2*yy, +0);
neis[2] = binary::get_horopoint(2*yy, +1); neis[2] = bt::get_horopoint(2*yy, +1);
neis[3] = binary::get_horopoint(0, 1); neis[3] = bt::get_horopoint(0, 1);
neis[4] = binary::get_horopoint(-2*yy, c->master->zebraval / 3.); neis[4] = bt::get_horopoint(-2*yy, c->master->zebraval / 3.);
neis[5] = binary::get_horopoint(0, -1); neis[5] = bt::get_horopoint(0, -1);
return neis[i]; return neis[i];
} }
if(penrose) { if(penrose) {
@ -508,7 +508,7 @@ EX hyperpoint nearcorner(cell *c, int i) {
else else
return calc_relative_matrix(c->cmove(i), c, C0) * C0; return calc_relative_matrix(c->cmove(i), c, C0) * C0;
} }
if(binarytiling) { if(bt::in()) {
if(WDIM == 3) { if(WDIM == 3) {
println(hlog, "nearcorner called"); println(hlog, "nearcorner called");
return Hypc; return Hypc;
@ -517,16 +517,16 @@ EX hyperpoint nearcorner(cell *c, int i) {
ld yy = yx; ld yy = yx;
// ld xx = 1 / sqrt(2)/2; // ld xx = 1 / sqrt(2)/2;
hyperpoint neis[7]; hyperpoint neis[7];
neis[0] = binary::get_horopoint(0, 1); neis[0] = bt::get_horopoint(0, 1);
neis[1] = binary::get_horopoint(yy*2, 1); neis[1] = bt::get_horopoint(yy*2, 1);
neis[2] = binary::get_horopoint(yy*2, 0); neis[2] = bt::get_horopoint(yy*2, 0);
neis[3] = binary::get_horopoint(yy*2, -1); neis[3] = bt::get_horopoint(yy*2, -1);
neis[4] = binary::get_horopoint(0, -1); neis[4] = bt::get_horopoint(0, -1);
if(c->type == 7) if(c->type == 7)
neis[5] = binary::get_horopoint(-yy*2, -.5), neis[5] = bt::get_horopoint(-yy*2, -.5),
neis[6] = binary::get_horopoint(-yy*2, +.5); neis[6] = bt::get_horopoint(-yy*2, +.5);
else else
neis[5] = binary::get_horopoint(-yy*2, 0); neis[5] = bt::get_horopoint(-yy*2, 0);
return neis[i]; return neis[i];
} }
#endif #endif
@ -560,7 +560,7 @@ EX hyperpoint farcorner(cell *c, int i, int which) {
} }
#endif #endif
#if CAP_BT #if CAP_BT
if(binarytiling || penrose) if(bt::in() || penrose)
return nearcorner(c, (i+which) % c->type); // lazy return nearcorner(c, (i+which) % c->type); // lazy
#endif #endif
#if CAP_ARCM #if CAP_ARCM

View File

@ -3012,7 +3012,7 @@ EX int countMinesAround(cell *c) {
} }
EX transmatrix applyPatterndir(cell *c, const patterns::patterninfo& si) { EX transmatrix applyPatterndir(cell *c, const patterns::patterninfo& si) {
if(NONSTDVAR || binarytiling) return Id; if(NONSTDVAR || bt::in()) return Id;
transmatrix V = ddspin(c, si.dir, M_PI); transmatrix V = ddspin(c, si.dir, M_PI);
if(si.reflect) V = V * Mirror; if(si.reflect) V = V * Mirror;
if(euclid) return V; if(euclid) return V;
@ -3155,7 +3155,7 @@ EX bool has_nice_dual() {
#if CAP_ARCM #if CAP_ARCM
if(arcm::in()) return geosupport_football() >= 2; if(arcm::in()) return geosupport_football() >= 2;
#endif #endif
if(binarytiling) return false; if(bt::in()) return false;
if(BITRUNCATED) return true; if(BITRUNCATED) return true;
if(a4) return false; if(a4) return false;
if((S7 & 1) == 0) return true; if((S7 & 1) == 0) return true;
@ -3520,7 +3520,7 @@ EX int get_darkval(cell *c, int d) {
if(geometry == gArnoldCat) return darkval_arnold[d]; if(geometry == gArnoldCat) return darkval_arnold[d];
if(sol) return darkval_sol[d]; if(sol) return darkval_sol[d];
if(nih) return darkval_nih[d]; if(nih) return darkval_nih[d];
if(binarytiling) return darkval_hbt[d]; if(bt::in()) return darkval_hbt[d];
if(hyperbolic && S7 == 6) return darkval_e6[d]; if(hyperbolic && S7 == 6) return darkval_e6[d];
if(hyperbolic && S7 == 12) return darkval_s12[d]; if(hyperbolic && S7 == 12) return darkval_s12[d];
if(nil) return darkval_nil[d]; if(nil) return darkval_nil[d];

View File

@ -79,7 +79,7 @@ EX heptagon *buildHeptagon1(heptagon *h, heptagon *parent, int d, hstate s, int
heptagon *buildHeptagon(heptagon *parent, int d, hstate s, int pard = 0, int fixdistance = COMPUTE) { heptagon *buildHeptagon(heptagon *parent, int d, hstate s, int pard = 0, int fixdistance = COMPUTE) {
heptagon *h = buildHeptagon1(tailored_alloc<heptagon> (S7), parent, d, s, pard); heptagon *h = buildHeptagon1(tailored_alloc<heptagon> (S7), parent, d, s, pard);
if(binarytiling || arcm::in()) return h; if(bt::in() || arcm::in()) return h;
if(parent->c7) { if(parent->c7) {
#if CAP_IRR #if CAP_IRR
if(IRREGULAR) if(IRREGULAR)
@ -228,7 +228,7 @@ heptagon *createStep(heptagon *h, int d) {
} }
heptagon *hrmap_standard::create_step(heptagon *h, int d) { heptagon *hrmap_standard::create_step(heptagon *h, int d) {
if(!h->move(0) && h->s != hsOrigin && !binarytiling && !cryst) { if(!h->move(0) && h->s != hsOrigin && !bt::in() && !cryst) {
// cheating: // cheating:
int pard=0; int pard=0;
if(S3 == 3) if(S3 == 3)

13
hyper.h
View File

@ -112,14 +112,13 @@ void addMessage(string s, char spamtype = 0);
#define ALPHA (M_PI*2/S7) #define ALPHA (M_PI*2/S7)
#define S7 cginf.sides #define S7 cginf.sides
#define S3 cginf.vertex #define S3 cginf.vertex
#define hyperbolic_37 (S7 == 7 && S3 == 3 && !binarytiling && !arcm::in()) #define hyperbolic_37 (S7 == 7 && S3 == 3 && !bt::in() && !arcm::in())
#define hyperbolic_not37 ((S7 > 7 || S3 > 3 || binarytiling || arcm::in()) && hyperbolic) #define hyperbolic_not37 ((S7 > 7 || S3 > 3 || bt::in() || arcm::in()) && hyperbolic)
#define weirdhyperbolic ((S7 > 7 || S3 > 3 || !STDVAR || binarytiling || arcm::in()) && hyperbolic) #define weirdhyperbolic ((S7 > 7 || S3 > 3 || !STDVAR || bt::in() || arcm::in()) && hyperbolic)
#define stdhyperbolic (S7 == 7 && S3 == 3 && STDVAR && !binarytiling && !arcm::in()) #define stdhyperbolic (S7 == 7 && S3 == 3 && STDVAR && !bt::in() && !arcm::in())
#define cgflags cginf.flags #define cgflags cginf.flags
#define binarytiling (cgflags & qBINARY)
#define cryst (cgflags & qCRYSTAL) #define cryst (cgflags & qCRYSTAL)
#define penrose (cgflags & qPENROSE) #define penrose (cgflags & qPENROSE)
@ -127,7 +126,7 @@ void addMessage(string s, char spamtype = 0);
#define experimental (cgflags & qEXPERIMENTAL) #define experimental (cgflags & qEXPERIMENTAL)
// these geometries do not feature alternate structures for horocycles // these geometries do not feature alternate structures for horocycles
#define eubinary (euclid || binarytiling || cryst || nil) #define eubinary (euclid || bt::in() || cryst || nil)
#define cgclass (cginf.cclass) #define cgclass (cginf.cclass)
#define euclid (cgclass == gcEuclid) #define euclid (cgclass == gcEuclid)
@ -403,7 +402,7 @@ typedef function<int(struct cell*)> cellfunction;
// passable flags // passable flags
#define SAGEMELT .1 #define SAGEMELT .1
#define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : sol ? 6 : (WDIM == 3 && binarytiling) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : (S3 == OINF) ? 4 : 6) #define TEMPLE_EACH (among(geometry, gHoroRec, gHoroHex, gKiteDart3) ? 3 : sol ? 6 : (WDIM == 3 && bt::in()) ? 2 : geometry == gSpace435 ? 4 : (WDIM == 3 && hyperbolic) ? 3 : (S3 == OINF) ? 4 : 6)
#define PT(x, y) ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x)) #define PT(x, y) ((tactic::on || quotient == 2 || daily::on) ? (y) : inv::on ? min(2*(y),x) : (x))
#define ROCKSNAKELENGTH 50 #define ROCKSNAKELENGTH 50
#define WORMLENGTH 15 #define WORMLENGTH 15

View File

@ -973,7 +973,7 @@ EX ld master_to_c7_angle() {
#if CAP_GP #if CAP_GP
if(cgi.gpdata) alpha = cgi.gpdata->alpha; if(cgi.gpdata) alpha = cgi.gpdata->alpha;
#endif #endif
return (!BITRUNCATED && !binarytiling && !arcm::in()) ? M_PI + alpha : 0; return (!BITRUNCATED && !bt::in() && !arcm::in()) ? M_PI + alpha : 0;
} }
EX transmatrix actualV(const heptspin& hs, const transmatrix& V) { EX transmatrix actualV(const heptspin& hs, const transmatrix& V) {
@ -987,7 +987,7 @@ EX transmatrix actualV(const heptspin& hs, const transmatrix& V) {
if(arcm::in()) return V * spin(-arcm::current.triangles[arcm::id_of(hs.at)][hs.spin].first); if(arcm::in()) return V * spin(-arcm::current.triangles[arcm::id_of(hs.at)][hs.spin].first);
#endif #endif
#if CAP_BT #if CAP_BT
if(binarytiling) return V; if(bt::in()) return V;
#endif #endif
if(penrose) return V; if(penrose) return V;
return (hs.spin || !BITRUNCATED) ? V * spin(hs.spin*2*M_PI/S7 + master_to_c7_angle()) : V; return (hs.spin || !BITRUNCATED) ? V * spin(hs.spin*2*M_PI/S7 + master_to_c7_angle()) : V;

View File

@ -503,7 +503,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
} }
else if(sol) else if(sol)
c->wall = (c->master->zebraval % 7 >= 5 || c->master->emeraldval % 7 >= 5) ? waCavewall : waCavefloor; c->wall = (c->master->zebraval % 7 >= 5 || c->master->emeraldval % 7 >= 5) ? waCavewall : waCavefloor;
else if(WDIM == 3 && hyperbolic && !binarytiling) else if(WDIM == 3 && hyperbolic && !bt::in())
c->wall = (c->master->zebraval & 1) ? waCavewall : waCavefloor; c->wall = (c->master->zebraval & 1) ? waCavewall : waCavefloor;
#if MAXMDIM >= 4 #if MAXMDIM >= 4
else if(euc::in(3)) else if(euc::in(3))
@ -705,7 +705,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
int dy = gmod(y, 3); int dy = gmod(y, 3);
if(dy == 1) c->wall = waVinePlant; if(dy == 1) c->wall = waVinePlant;
} }
else if(WDIM == 3 && hyperbolic && !binarytiling) else if(WDIM == 3 && hyperbolic && !bt::in())
c->wall = (c->master->zebraval & 2) ? waVinePlant : waNone; c->wall = (c->master->zebraval & 2) ? waVinePlant : waNone;
else if(a4 || sphere || arcm::in()) else if(a4 || sphere || arcm::in())
c->wall = hrand(100) < 50 ? waNone : waVinePlant; c->wall = hrand(100) < 50 ? waNone : waVinePlant;
@ -2576,7 +2576,7 @@ EX void setdist(cell *c, int d, cell *from) {
// this fixes the following problem: // this fixes the following problem:
// http://steamcommunity.com/app/342610/discussions/0/1470840994970724215/ // http://steamcommunity.com/app/342610/discussions/0/1470840994970724215/
if(!generatingEquidistant && from && d >= 7 && c->land && !binarytiling && !arcm::in() && !cryst && WDIM == 2 && hyperbolic) { if(!generatingEquidistant && from && d >= 7 && c->land && !bt::in() && !arcm::in() && !cryst && WDIM == 2 && hyperbolic) {
int cdi = celldist(c); int cdi = celldist(c);
if(celldist(from) > cdi) { if(celldist(from) > cdi) {
forCellCM(c2, c) if(celldist(c2) < cdi) { forCellCM(c2, c) if(celldist(c2) < cdi) {
@ -2606,13 +2606,13 @@ EX void setdist(cell *c, int d, cell *from) {
if(d >= BARLEV) { if(d >= BARLEV) {
if(binarytiling && WDIM == 3 && !c->land && !solnih) { if(bt::in() && WDIM == 3 && !c->land && !solnih) {
ld z = vid.binary_width; ld z = vid.binary_width;
cell *cseek = c; cell *cseek = c;
int step = 0; int step = 0;
if(geometry == gHoroHex) z *= 2; if(geometry == gHoroHex) z *= 2;
ld scale = binary::expansion(); ld scale = bt::expansion();
while(z < 3.999 && step < 10) cseek = cseek->cmove(binary::updir()), z *= scale; while(z < 3.999 && step < 10) cseek = cseek->cmove(bt::updir()), z *= scale;
if(cseek->master->emeraldval) setland(c, eLand(cseek->master->emeraldval)); if(cseek->master->emeraldval) setland(c, eLand(cseek->master->emeraldval));
} }

View File

@ -749,16 +749,16 @@ EX land_validity_t& land_validity(eLand l) {
if(WDIM == 3) { if(WDIM == 3) {
if(l == laWarpCoast) return ugly_version_nofull; if(l == laWarpCoast) return ugly_version_nofull;
if(l == laWineyard && hyperbolic && !binarytiling && S7 == 6) return lv::pattern_special; if(l == laWineyard && hyperbolic && !bt::in() && S7 == 6) return lv::pattern_special;
if(l == laEmerald && hyperbolic && !binarytiling && S7 == 12) return lv::pattern_special; if(l == laEmerald && hyperbolic && !bt::in() && S7 == 12) return lv::pattern_special;
if(l == laZebra) return pattern_not_implemented_random; if(l == laZebra) return pattern_not_implemented_random;
if(among(l, laWhirlpool, laPrairie, laWestWall, laBull)) return lv::not_3d; if(among(l, laWhirlpool, laPrairie, laWestWall, laBull)) return lv::not_3d;
if(l == laEndorian && geometry == gKiteDart3) return not_implemented; if(l == laEndorian && geometry == gKiteDart3) return not_implemented;
if(l == laEndorian && sol) return not_implemented; if(l == laEndorian && sol) return not_implemented;
if(l == laEndorian && hyperbolic && !quotient) return lv::pattern_special; if(l == laEndorian && hyperbolic && !quotient) return lv::pattern_special;
if(l == laIvoryTower && hyperbolic && binarytiling) return lv::pattern_special; if(l == laIvoryTower && hyperbolic && bt::in()) return lv::pattern_special;
if(l == laDungeon || l == laBrownian) return not_implemented; if(l == laDungeon || l == laBrownian) return not_implemented;
if(l == laKraken) return binarytiling ? not_binary : not_implemented; if(l == laKraken) return bt::in() ? not_binary : not_implemented;
if(l == laBurial && !shmup::on) return not_implemented; if(l == laBurial && !shmup::on) return not_implemented;
if(l == laMirrorOld && !shmup::on) return not_implemented; if(l == laMirrorOld && !shmup::on) return not_implemented;
} }
@ -767,7 +767,7 @@ EX land_validity_t& land_validity(eLand l) {
if(quotient || !hyperbolic || cryst) return dont_work; if(quotient || !hyperbolic || cryst) return dont_work;
} }
if(binarytiling) { if(bt::in()) {
if(among(l, laMountain, laTemple)) return lv::pattern_compatibility_sole; if(among(l, laMountain, laTemple)) return lv::pattern_compatibility_sole;
if(among(l, laDungeon, laIvoryTower, laOcean, laEndorian)) return lv::pattern_compatibility; if(among(l, laDungeon, laIvoryTower, laOcean, laEndorian)) return lv::pattern_compatibility;
if(among(l, laCaribbean, laCamelot)) return lv::pattern_compatibility_notrec; if(among(l, laCaribbean, laCamelot)) return lv::pattern_compatibility_notrec;
@ -838,7 +838,7 @@ EX land_validity_t& land_validity(eLand l) {
if(isCrossroads(l) && geometry == gBinary4) if(isCrossroads(l) && geometry == gBinary4)
return not_implemented; return not_implemented;
if(binarytiling && among(l, laMirror, laMirrorOld)) if(bt::in() && among(l, laMirror, laMirrorOld))
return dont_work; return dont_work;
if(l == laWhirlwind && hyperbolic_not37) if(l == laWhirlwind && hyperbolic_not37)
@ -1191,7 +1191,7 @@ EX land_validity_t& land_validity(eLand l) {
if(l == laWildWest && !randomPatternsMode) if(l == laWildWest && !randomPatternsMode)
return out_of_theme; return out_of_theme;
if(l == laIce && STDVAR && hyperbolic_37 && !quotient && !arcm::in() && !binarytiling) if(l == laIce && STDVAR && hyperbolic_37 && !quotient && !arcm::in() && !bt::in())
return full_game; return full_game;
return ok; return ok;

View File

@ -165,7 +165,7 @@ namespace mapstream {
if(hybri && VERNUM_HEX >= 0xA80C) { if(hybri && VERNUM_HEX >= 0xA80C) {
hybrid::in_underlying_geometry([&] { save_geometry(f); }); hybrid::in_underlying_geometry([&] { save_geometry(f); });
} }
if(binarytiling && VERNUM_HEX >= 0xA80C) if(bt::in() && VERNUM_HEX >= 0xA80C)
f.write(vid.binary_width); f.write(vid.binary_width);
if(euc::in()) { if(euc::in()) {
f.write(euc::eu_input.user_axes); f.write(euc::eu_input.user_axes);
@ -251,7 +251,7 @@ namespace mapstream {
load_geometry(f); load_geometry(f);
set_geometry(g); set_geometry(g);
} }
if(binarytiling && VERNUM_HEX >= 0xA80C) if(bt::in() && VERNUM_HEX >= 0xA80C)
f.read(vid.binary_width); f.read(vid.binary_width);
if(euc::in() && VERNUM_HEX >= 0xA80D) { if(euc::in() && VERNUM_HEX >= 0xA80D) {
f.read(euc::eu_input.user_axes); f.read(euc::eu_input.user_axes);

View File

@ -834,7 +834,7 @@ movei determinePush(cellwalker who, int subdir, const T& valid) {
cellwalker push = who; cellwalker push = who;
push += wstep; push += wstep;
cell *c2 = push.at; cell *c2 = push.at;
if(binarytiling) { if(bt::in()) {
auto rd = reverse_directions(push.at, push.spin); auto rd = reverse_directions(push.at, push.spin);
for(int i: rd) { for(int i: rd) {
push.spin = i; push.spin = i;

View File

@ -213,7 +213,7 @@ EX namespace solnihv {
alt->zebraval = 0; alt->zebraval = 0;
alt->distance = 0; alt->distance = 0;
alt->emeraldval = 0; alt->emeraldval = 0;
binary_map = binary::new_alt_map(alt); binary_map = bt::new_alt_map(alt);
} }
if(nih) { if(nih) {
@ -226,7 +226,7 @@ EX namespace solnihv {
alt3->zebraval = 0; alt3->zebraval = 0;
alt3->distance = 0; alt3->distance = 0;
alt3->emeraldval = 0; alt3->emeraldval = 0;
ternary_map = binary::new_alt_map(alt3); ternary_map = bt::new_alt_map(alt3);
} }
else { else {
alt3 = alt; alt3 = alt;
@ -645,8 +645,8 @@ EX namespace solnihv {
auto m = (solnihv::hrmap_solnih*) currentmap; auto m = (solnihv::hrmap_solnih*) currentmap;
dynamicval<eGeometry> g(geometry, gBinary4); dynamicval<eGeometry> g(geometry, gBinary4);
dynamicval<hrmap*> cm(currentmap, m->binary_map); dynamicval<hrmap*> cm(currentmap, m->binary_map);
int d1 = binary::celldistance3_approx(m->coords[h1].first, m->coords[h2].first); int d1 = bt::celldistance3_approx(m->coords[h1].first, m->coords[h2].first);
int d2 = binary::celldistance3_approx(m->coords[h1].second, m->coords[h2].second); int d2 = bt::celldistance3_approx(m->coords[h1].second, m->coords[h2].second);
return d1 + d2 - abs(h1->distance - h2->distance); return d1 + d2 - abs(h1->distance - h2->distance);
} }
EX } EX }

View File

@ -18,7 +18,7 @@ EX int ctof(cell *c) {
if(PURE) return 1; if(PURE) return 1;
// if(euclid) return 0; // if(euclid) return 0;
if(!c) return 1; if(!c) return 1;
if(binarytiling) return c->type == 7; if(bt::in()) return c->type == 7;
return ishept(c) ? 1 : 0; return ishept(c) ? 1 : 0;
// c->type == 6 ? 0 : 1; // c->type == 6 ? 0 : 1;
} }
@ -386,7 +386,7 @@ EX int fieldval_uniq(cell *c) {
if(bounded) return p.first + (p.second << 16); if(bounded) return p.first + (p.second << 16);
return gmod(p.first - 22 * p.second, 3*127); return gmod(p.first - 22 * p.second, 3*127);
} }
else if(binarytiling || arcm::in() || nil || S3 >= OINF || (cgflags & qIDEAL)) return 0; else if(bt::in() || arcm::in() || nil || S3 >= OINF || (cgflags & qIDEAL)) return 0;
else if(&currfp == &fp_invalid) return 0; else if(&currfp == &fp_invalid) return 0;
else if(WDIM == 3) return c->master->fieldval; else if(WDIM == 3) return c->master->fieldval;
else if(ctof(c) || NONSTDVAR) return c->master->fieldval/S7; else if(ctof(c) || NONSTDVAR) return c->master->fieldval/S7;
@ -825,7 +825,7 @@ EX namespace patterns {
} }
void val_all(cell *c, patterninfo &si, int sub, int pat) { void val_all(cell *c, patterninfo &si, int sub, int pat) {
if(IRREGULAR || arcm::in() || binarytiling || WDIM == 3) si.symmetries = 1; if(IRREGULAR || arcm::in() || bt::in() || WDIM == 3) si.symmetries = 1;
else if(a46) val46(c, si, sub, pat); else if(a46) val46(c, si, sub, pat);
else if(a38) val38(c, si, sub, pat); else if(a38) val38(c, si, sub, pat);
else if(sphere && S3 == 3) valSibling(c, si, sub, pat); else if(sphere && S3 == 3) valSibling(c, si, sub, pat);
@ -1004,7 +1004,7 @@ EX namespace patterns {
si.dir = 0; si.reflect = false; si.id = ctof(c); si.dir = 0; si.reflect = false; si.id = ctof(c);
si.symmetries = c->type; si.symmetries = c->type;
if(binarytiling) { if(bt::in()) {
if(pat == PAT_SINGLETYPE) si.id = 0; if(pat == PAT_SINGLETYPE) si.id = 0;
else si.id = c->type & 1; else si.id = c->type & 1;
si.dir = 2; si.dir = 2;
@ -1202,14 +1202,14 @@ EX bool geosupport_chessboard() {
(arcm::in() && PURE) ? arcm::current.support_chessboard() : (arcm::in() && PURE) ? arcm::current.support_chessboard() :
(arcm::in() && DUAL) ? arcm::current.support_threecolor_bitruncated() : (arcm::in() && DUAL) ? arcm::current.support_threecolor_bitruncated() :
#endif #endif
(binarytiling || penrose) ? 0 : (bt::in() || penrose) ? 0 :
(S3 >= OINF) ? true : (S3 >= OINF) ? true :
(VALENCE % 2 == 0); (VALENCE % 2 == 0);
} }
EX int geosupport_threecolor() { EX int geosupport_threecolor() {
if(IRREGULAR) return 0; if(IRREGULAR) return 0;
if(penrose || binarytiling) return 0; if(penrose || bt::in()) return 0;
#if CAP_ARCM #if CAP_ARCM
if(arcm::in() && PURE) return arcm::current.support_threecolor(); if(arcm::in() && PURE) return arcm::current.support_threecolor();
if(arcm::in() && BITRUNCATED) return arcm::current.support_threecolor_bitruncated(); if(arcm::in() && BITRUNCATED) return arcm::current.support_threecolor_bitruncated();
@ -1230,7 +1230,7 @@ EX int geosupport_threecolor() {
EX int geosupport_football() { EX int geosupport_football() {
// always works in bitrunc geometries // always works in bitrunc geometries
if(BITRUNCATED) return 2; if(BITRUNCATED) return 2;
if(binarytiling || penrose) return 0; if(bt::in() || penrose) return 0;
#if CAP_ARCM #if CAP_ARCM
if(arcm::in() && DUAL) return false; if(arcm::in() && DUAL) return false;
@ -1264,7 +1264,7 @@ EX int pattern_threecolor(cell *c) {
} }
#endif #endif
if(arb::in()) return 0; if(arb::in()) return 0;
if(IRREGULAR || binarytiling) return !pseudohept(c); if(IRREGULAR || bt::in()) return !pseudohept(c);
#if CAP_GP #if CAP_GP
if(S3 == 3 && !(S7&1) && gp_threecolor() == 1 && c->master->c7 != c) { if(S3 == 3 && !(S7&1) && gp_threecolor() == 1 && c->master->c7 != c) {
auto li = gp::get_local_info(c); auto li = gp::get_local_info(c);
@ -1388,7 +1388,7 @@ EX bool pseudohept(cell *c) {
if(sol) return (c->master->emeraldval % 3 == 2) && (c->master->zebraval % 3 == 2) && (c->master->distance % 2); 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(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(penrose) return kite::getshape(c->master) == kite::pDart;
if(binarytiling) return binary::pseudohept(c); if(bt::in()) return bt::pseudohept(c);
#endif #endif
if(S3 >= OINF) return c->master->distance % 3 == 1; if(S3 >= OINF) return c->master->distance % 3 == 1;
#if MAXMDIM == 4 #if MAXMDIM == 4
@ -1657,7 +1657,7 @@ EX namespace patterns {
int y = (c->master->fieldval >> 12) & 4095; int y = (c->master->fieldval >> 12) & 4095;
ignore(x); ignore(x);
if(c->master->distance % 3) return 0; if(c->master->distance % 3) return 0;
if(c->c.spin(binary::updir()) != 1) return 0; if(c->c.spin(bt::updir()) != 1) return 0;
// if(c->master->distance % 2 == 0) return 0; // if(c->master->distance % 2 == 0) return 0;
if(hrand(100) == 0) return 0; if(hrand(100) == 0) return 0;
return 0x1000000 | (0xFFFFFF & (0x671349 + y * 0x512369)); return 0x1000000 | (0xFFFFFF & (0x671349 + y * 0x512369));
@ -2572,7 +2572,7 @@ EX namespace linepatterns {
case patTree: case patTree:
if(is_master(c)) { if(is_master(c)) {
int dir = binarytiling ? binary::updir() : 0; int dir = bt::in() ? bt::updir() : 0;
cell *c2 = c->master->move(dir)->c7; cell *c2 = c->master->move(dir)->c7;
if(gmatrix.count(c2)) { if(gmatrix.count(c2)) {
if(S3 >= OINF) if(S3 >= OINF)

View File

@ -39,12 +39,12 @@ transmatrix meupush(ld x, ld y) {
if(euclid) if(euclid)
return eupush(euscale * x, euscale * y); return eupush(euscale * x, euscale * y);
else else
return binary::parabolic3(x, y); return bt::parabolic3(x, y);
} }
hyperpoint mhpxy(ld x, ld y) { hyperpoint mhpxy(ld x, ld y) {
if(euclid) return hpxy(euscale * x, euscale * y); if(euclid) return hpxy(euscale * x, euscale * y);
else return binary::parabolic3(x, y) * C0; else return bt::parabolic3(x, y) * C0;
} }
const ld phi = (1 + sqrt(5)) / 2; const ld phi = (1 + sqrt(5)) / 2;
@ -149,7 +149,7 @@ struct hrmap_kite : hrmap {
heptagon *h = tailored_alloc<heptagon> (8); heptagon *h = tailored_alloc<heptagon> (8);
h->s = hstate(s); h->s = hstate(s);
h->dm4 = h->distance = dist; h->dm4 = h->distance = dist;
if(binarytiling || dist == 0) if(bt::in() || dist == 0)
h->c7 = newCell(euclid ? 4 : s == pKite ? 12 : 10, h); h->c7 = newCell(euclid ? 4 : s == pKite ? 12 : 10, h);
else else
h->c7 = NULL; h->c7 = NULL;
@ -163,7 +163,7 @@ struct hrmap_kite : hrmap {
heptagon *hspawn(heptagon *of, int our, int their, pshape s) { heptagon *hspawn(heptagon *of, int our, int their, pshape s) {
auto h = newtile(s, of->distance + (our ? 1 : -1)); auto h = newtile(s, of->distance + (our ? 1 : -1));
if(binarytiling) binary::make_binary_lands(of, h); if(bt::in()) bt::make_binary_lands(of, h);
of->c.connect(our, h, their, false); of->c.connect(our, h, their, false);
return h; return h;
} }

View File

@ -412,12 +412,12 @@ void geometry_information::procedural_shapes() {
if(0); if(0);
#if CAP_BT #if CAP_BT
else if(binarytiling) { else if(bt::in()) {
for(int i=0; i<2; i++) { for(int i=0; i<2; i++) {
bshape(shWall[i], PPR::WALL); bshape(shWall[i], PPR::WALL);
hpcpush(binary::get_horopoint(log(2)/8, .1)); hpcpush(bt::get_horopoint(log(2)/8, .1));
hpcpush(binary::get_horopoint(log(2)/8, -.1)); hpcpush(bt::get_horopoint(log(2)/8, -.1));
hpcpush(binary::get_horopoint(-log(2)/8, 0)); hpcpush(bt::get_horopoint(-log(2)/8, 0));
} }
} }
#endif #endif
@ -709,10 +709,10 @@ void geometry_information::compute_cornerbonus() { }
hyperpoint ray_kleinize(hyperpoint h, int id, ld pz) { hyperpoint ray_kleinize(hyperpoint h, int id, ld pz) {
if(geometry == gNil && among(id, 2, 5)) h[2] = 0; if(geometry == gNil && among(id, 2, 5)) h[2] = 0;
if(hyperbolic && binarytiling) { if(hyperbolic && bt::in()) {
// ld co = vid.binary_width / log(2) / 4; // ld co = vid.binary_width / log(2) / 4;
// hyperpoint res = point31(h[2]*log(2)/2, h[0]*co, h[1]*co); // hyperpoint res = point31(h[2]*log(2)/2, h[0]*co, h[1]*co);
return deparabolic10(binary::parabolic3(h[0], h[1]) * xpush0(log(2)/2*h[2])); return deparabolic10(bt::parabolic3(h[0], h[1]) * xpush0(log(2)/2*h[2]));
} }
if(prod) { if(prod) {
return point3(h[0]/h[2], h[1]/h[2], pz); return point3(h[0]/h[2], h[1]/h[2], pz);
@ -792,8 +792,8 @@ void geometry_information::make_wall(int id, vector<hyperpoint> vertices, vector
h = zshift(normalize_flat(h), center_altitude * (1-x-y) + altitudes[a] * x + altitudes[b] * y); h = zshift(normalize_flat(h), center_altitude * (1-x-y) + altitudes[a] * x + altitudes[b] * y);
hpcpush(h); return; hpcpush(h); return;
} }
if(solnih || !binarytiling) { hpcpush(normalize(h)); return; } if(solnih || !bt::in()) { hpcpush(normalize(h)); return; }
hyperpoint res = binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2]); hyperpoint res = bt::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
hpcpush(res); hpcpush(res);
}); });
} }
@ -810,8 +810,8 @@ void geometry_information::make_wall(int id, vector<hyperpoint> vertices, vector
} }
if(nil) if(nil)
h = nilv::on_geodesic(vertices[a], vertices[(a+1)%n], y * 1. / STEP); h = nilv::on_geodesic(vertices[a], vertices[(a+1)%n], y * 1. / STEP);
if(solnih || !binarytiling) { hpcpush(normalize(h)); continue; } if(solnih || !bt::in()) { hpcpush(normalize(h)); continue; }
hyperpoint res = binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2]); hyperpoint res = bt::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
hpcpush(res); hpcpush(res);
} }
hpcpush(hpc[last->s]); hpcpush(hpc[last->s]);
@ -848,7 +848,7 @@ void geometry_information::reserve_wall3d(int i) {
void geometry_information::create_wall3d() { void geometry_information::create_wall3d() {
if(WDIM == 2) return; if(WDIM == 2) return;
reserve_wall3d(penrose ? 22 : hybri ? 0 : S7); reserve_wall3d(penrose ? 22 : hybri ? 0 : S7);
if(GDIM == 3 && binarytiling && geometry == gBinary3) { if(GDIM == 3 && bt::in() && geometry == gBinary3) {
hyperpoint h00 = point3(-1,-1,-1); hyperpoint h00 = point3(-1,-1,-1);
hyperpoint h01 = point3(-1,0,-1); hyperpoint h01 = point3(-1,0,-1);
hyperpoint h02 = point3(-1,+1,-1); hyperpoint h02 = point3(-1,+1,-1);
@ -871,7 +871,7 @@ void geometry_information::create_wall3d() {
make_wall(8, make4(h22+down, h02+down, h20+down)); make_wall(8, make4(h22+down, h02+down, h20+down));
} }
if(GDIM == 3 && binarytiling && geometry == gHoroTris) { if(GDIM == 3 && bt::in() && geometry == gHoroTris) {
ld r = sqrt(3)/6; ld r = sqrt(3)/6;
ld r1 = r; ld r1 = r;
ld r2 = r * 2; ld r2 = r * 2;
@ -897,7 +897,7 @@ void geometry_information::create_wall3d() {
if(geometry == gHoroRec) { if(geometry == gHoroRec) {
ld r2 = sqrt(2); ld r2 = sqrt(2);
ld z = binary::hororec_scale; ld z = bt::hororec_scale;
hyperpoint a00 = point3(-r2*z,-2*z,-.5); hyperpoint a00 = point3(-r2*z,-2*z,-.5);
hyperpoint a01 = point3(+r2*z,-2*z,-.5); hyperpoint a01 = point3(+r2*z,-2*z,-.5);
@ -919,8 +919,8 @@ void geometry_information::create_wall3d() {
if(geometry == gHoroHex) { if(geometry == gHoroHex) {
ld z = log(3) / log(2) / 2; ld z = log(3) / log(2) / 2;
ld r3 = sqrt(3) / 2 * binary::horohex_scale; ld r3 = sqrt(3) / 2 * bt::horohex_scale;
ld h = binary::horohex_scale / 2; ld h = bt::horohex_scale / 2;
hyperpoint down = point3(0,0,2*z); hyperpoint down = point3(0,0,2*z);
for(int j=0; j<4; j++) for(int i=0; i<3; i++) { for(int j=0; j<4; j++) for(int i=0; i<3; i++) {
@ -1002,7 +1002,7 @@ void geometry_information::create_wall3d() {
} }
} }
if(GDIM == 3 && !euclid && !binarytiling && !nonisotropic && !hybri && !penrose) { if(GDIM == 3 && !euclid && !bt::in() && !nonisotropic && !hybri && !penrose) {
reg3::generate(); reg3::generate();
int facesize = isize(reg3::cellshape) / S7; int facesize = isize(reg3::cellshape) / S7;
for(int w=0; w<S7; w++) { for(int w=0; w<S7; w++) {
@ -1084,7 +1084,7 @@ void geometry_information::create_wall3d() {
if(penrose) { if(penrose) {
auto kv = kite::make_walls(); auto kv = kite::make_walls();
for(auto& v: kv.first) for(auto& h: v) { for(auto& v: kv.first) for(auto& h: v) {
h = binary::deparabolic3(h); h = bt::deparabolic3(h);
h = point3(h[1], h[2], h[0] / (log(2)/2)); h = point3(h[1], h[2], h[0] / (log(2)/2));
} }
for(int i=0; i<isize(kv.first); i++) make_wall(i, kv.first[i], kv.second[i]); for(int i=0; i<isize(kv.first); i++) make_wall(i, kv.first[i], kv.second[i]);

View File

@ -68,7 +68,7 @@ EX bool available() {
return false; return false;
if((solnih || nil) && pmodel == mdGeodesic) if((solnih || nil) && pmodel == mdGeodesic)
return true; return true;
if(euclid && pmodel == mdPerspective && !binarytiling) if(euclid && pmodel == mdPerspective && !bt::in())
return true; return true;
if(prod && PURE) if(prod && PURE)
return true; return true;
@ -183,10 +183,10 @@ void enable_raycaster() {
int flat1 = 0, flat2 = S7; int flat1 = 0, flat2 = S7;
if(hyperbolic && binarytiling) { if(hyperbolic && bt::in()) {
fsh += "uniform mediump float uBLevel;\n"; fsh += "uniform mediump float uBLevel;\n";
flat1 = binary::dirs_outer(); flat1 = bt::dirs_outer();
flat2 -= binary::dirs_inner(); flat2 -= bt::dirs_inner();
} }
if(IN_ODS || hyperbolic) fsh += if(IN_ODS || hyperbolic) fsh +=
@ -217,7 +217,7 @@ void enable_raycaster() {
fsh += fsh +=
"vec2 map_texture(vec4 pos, int which) {\n"; "vec2 map_texture(vec4 pos, int which) {\n";
if(nil) fsh += "if(which == 2 || which == 5) pos.z = 0.;\n"; if(nil) fsh += "if(which == 2 || which == 5) pos.z = 0.;\n";
else if(hyperbolic && binarytiling) fsh += else if(hyperbolic && bt::in()) fsh +=
"pos = vec4(-log(pos.w-pos.x), pos.y, pos.z, 1);\n" "pos = vec4(-log(pos.w-pos.x), pos.y, pos.z, 1);\n"
"pos.yz *= exp(pos.x);\n"; "pos.yz *= exp(pos.x);\n";
else if(hyperbolic) fsh += else if(hyperbolic) fsh +=
@ -356,7 +356,7 @@ void enable_raycaster() {
// 20: get to horosphere +uBLevel (take smaller root) // 20: get to horosphere +uBLevel (take smaller root)
// 21: get to horosphere -uBLevel (take larger root) // 21: get to horosphere -uBLevel (take larger root)
if(hyperbolic && binarytiling) { if(hyperbolic && bt::in()) {
fmain += fmain +=
"for(int i=20; i<22; i++) {\n" "for(int i=20; i<22; i++) {\n"
"float sgn = i == 20 ? -1. : 1.;\n" "float sgn = i == 20 ? -1. : 1.;\n"
@ -597,7 +597,7 @@ void enable_raycaster() {
"tangent /= sqrt(dot(tangent.xyz, tangent.xyz) - tangent.w*tangent.w);\n"; "tangent /= sqrt(dot(tangent.xyz, tangent.xyz) - tangent.w*tangent.w);\n";
#endif #endif
if(hyperbolic && binarytiling) { if(hyperbolic && bt::in()) {
fmain += fmain +=
"if(which == 20) {\n" "if(which == 20) {\n"
" float best = 999.;\n" " float best = 999.;\n"
@ -695,7 +695,7 @@ void enable_raycaster() {
if(use_reflect) { if(use_reflect) {
if(prod) fmain += "if(reflect && which >= "+its(S7)+") { zspeed = -zspeed; continue; }\n"; if(prod) fmain += "if(reflect && which >= "+its(S7)+") { zspeed = -zspeed; continue; }\n";
if(hyperbolic && binarytiling) fmain += if(hyperbolic && bt::in()) fmain +=
"if(reflect && (which < "+its(flat1)+" || which >= "+its(flat2)+")) {\n" "if(reflect && (which < "+its(flat1)+" || which >= "+its(flat2)+")) {\n"
" float x = -log(position.w - position.x);\n" " float x = -log(position.w - position.x);\n"
" vec4 xtan = xpush(-x) * tangent;\n" " vec4 xtan = xpush(-x) * tangent;\n"
@ -992,7 +992,7 @@ EX void cast() {
if(o->uPLevel != -1) if(o->uPLevel != -1)
glUniform1f(o->uPLevel, cgi.plevel / 2); glUniform1f(o->uPLevel, cgi.plevel / 2);
if(o->uBLevel != -1) if(o->uBLevel != -1)
glUniform1f(o->uBLevel, log(binary::expansion()) / 2); glUniform1f(o->uBLevel, log(bt::expansion()) / 2);
glUniform1f(o->uLinearSightRange, sightranges[geometry]); glUniform1f(o->uLinearSightRange, sightranges[geometry]);
glUniform1f(o->uExpDecay, exp_decay_current()); glUniform1f(o->uExpDecay, exp_decay_current());

View File

@ -6,7 +6,7 @@
* *
* works with spherical and hyperbolic ones -- Euclidean cubic tiling implemented in euclid.cpp * works with spherical and hyperbolic ones -- Euclidean cubic tiling implemented in euclid.cpp
* includes non-quotient spaces as well as field quotient and elliptic spaces * includes non-quotient spaces as well as field quotient and elliptic spaces
* hyperbolic honeycombs rely on binary:: to deal with floating point errors (just like archimedean) * hyperbolic honeycombs rely on bt:: to deal with floating point errors (just like archimedean)
*/ */
#include "hyper.h" #include "hyper.h"
@ -644,7 +644,7 @@ EX namespace reg3 {
if(hyperbolic) { if(hyperbolic) {
dynamicval<eGeometry> g(geometry, gBinary3); dynamicval<eGeometry> g(geometry, gBinary3);
binary::build_tmatrix(); bt::build_tmatrix();
alt = tailored_alloc<heptagon> (S7); alt = tailored_alloc<heptagon> (S7);
alt->s = hsOrigin; alt->s = hsOrigin;
alt->emeraldval = 0; alt->emeraldval = 0;
@ -653,7 +653,7 @@ EX namespace reg3 {
alt->alt = alt; alt->alt = alt;
alt->cdata = NULL; alt->cdata = NULL;
alt->c7 = NULL; alt->c7 = NULL;
binary_map = binary::new_alt_map(alt); binary_map = bt::new_alt_map(alt);
T = xpush(.01241) * spin(1.4117) * xpush(0.1241) * cspin(0, 2, 1.1249) * xpush(0.07) * Id; T = xpush(.01241) * spin(1.4117) * xpush(0.1241) * cspin(0, 2, 1.1249) * xpush(0.07) * Id;
} }
@ -917,7 +917,7 @@ EX int celldistance(cell *c1, cell *c2) {
if(close_distances.count(b)) return close_distances[b]; if(close_distances.count(b)) return close_distances[b];
dynamicval<eGeometry> g(geometry, gBinary3); dynamicval<eGeometry> g(geometry, gBinary3);
return 20 + binary::celldistance3(r->reg_gmatrix[c1->master].first, r->reg_gmatrix[c2->master].first); return 20 + bt::celldistance3(r->reg_gmatrix[c1->master].first, r->reg_gmatrix[c2->master].first);
} }
EX bool pseudohept(cell *c) { EX bool pseudohept(cell *c) {
@ -987,7 +987,7 @@ EX void generate_cellrotations() {
ld adistance(cell *c) { ld adistance(cell *c) {
hyperpoint h = tC0(regmap()->reg_gmatrix[c->master].second); hyperpoint h = tC0(regmap()->reg_gmatrix[c->master].second);
h = binary::deparabolic3(h); h = bt::deparabolic3(h);
return regmap()->reg_gmatrix[c->master].first->distance * log(2) - h[0]; return regmap()->reg_gmatrix[c->master].first->distance * log(2) - h[0];
} }

View File

@ -659,9 +659,9 @@ EX void apply() {
reflect_view(); reflect_view();
View = ypush(-shift_angle * degree) * spin(-movement_angle * degree) * View; View = ypush(-shift_angle * degree) * spin(-movement_angle * degree) * View;
if(GDIM == 2) if(GDIM == 2)
View = binary::parabolic(parabolic_length * t / period) * View; View = bt::parabolic(parabolic_length * t / period) * View;
else else
View = binary::parabolic3(parabolic_length * t / period, 0) * View; View = bt::parabolic3(parabolic_length * t / period, 0) * View;
View = spin(movement_angle * degree) * ypush(shift_angle * degree) * View; View = spin(movement_angle * degree) * ypush(shift_angle * degree) * View;
moved(); moved();
break; break;

View File

@ -1215,7 +1215,7 @@ EX void set_geometry(eGeometry target) {
if(DUAL && geometry != gArchimedean) if(DUAL && geometry != gArchimedean)
variation = ginf[geometry].default_variation; variation = ginf[geometry].default_variation;
#if CAP_BT #if CAP_BT
if(binarytiling || WDIM == 3 || penrose) if(!hybri) variation = eVariation::pure; if(bt::in() || WDIM == 3 || penrose) if(!hybri) variation = eVariation::pure;
#endif #endif
if(S3 == OINF) variation = eVariation::pure; if(S3 == OINF) variation = eVariation::pure;
if(was_default) pmodel = default_model(); if(was_default) pmodel = default_model();
@ -1229,7 +1229,7 @@ EX void set_geometry(eGeometry target) {
EX void set_variation(eVariation target) { EX void set_variation(eVariation target) {
if(variation != target) { if(variation != target) {
stop_game(); stop_game();
if(binarytiling || sol || penrose || WDIM == 3) if(!prod) geometry = gNormal; if(bt::in() || sol || penrose || WDIM == 3) if(!prod) geometry = gNormal;
auto& cd = ginf[gCrystal]; auto& cd = ginf[gCrystal];
if(target == eVariation::bitruncated && cryst && cd.sides == 8 && cd.vertex == 4) { if(target == eVariation::bitruncated && cryst && cd.sides == 8 && cd.vertex == 4) {
cd.vertex = 3; cd.vertex = 3;

View File

@ -430,7 +430,7 @@ void mapTexture(cell *c, textureinfo& mi, patterns::patterninfo &si, const trans
transmatrix iv = inverse(applyPatterndir(c, si)); transmatrix iv = inverse(applyPatterndir(c, si));
int sd = si.dir; int sd = si.dir;
if((NONSTDVAR) || binarytiling) sd = 0; if((NONSTDVAR) || bt::in()) sd = 0;
for(int i=0; i<c->type; i++) { for(int i=0; i<c->type; i++) {
hyperpoint h1 = iv * get_corner_position(c, (i + sd + shift) % c->type); hyperpoint h1 = iv * get_corner_position(c, (i + sd + shift) % c->type);

View File

@ -287,7 +287,7 @@ EX namespace yendor {
ycw += best; ycw += best;
} }
else if(binarytiling) { else if(bt::in()) {
// make it challenging // make it challenging
vector<int> ds; vector<int> ds;
for(int d=0; d<ycw.at->type; d++) { for(int d=0; d<ycw.at->type; d++) {