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 MAXMDIM >= 4
// 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);
#endif

View File

@ -485,7 +485,7 @@ EX int coastval(cell *c, eLand base) {
EX bool checkInTree(cell *c, int maxv) {
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;
}
if(!maxv) return false;
@ -611,15 +611,15 @@ EX void buildEquidistant(cell *c) {
if(c->land == laEndorian) {
int ct = c->type;
#if CAP_BT
if(binarytiling) {
if(bt::in()) {
int skip = geometry == gHoroRec ? 3 : 2;
int up = binary::updir();
int up = bt::updir();
if(c->landparam == 1)
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;
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)
c->landflags = 1;
}
@ -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 && !binarytiling && !arcm::in() && !penrose && !experimental && !hybri;
return hyperbolic && !bt::in() && !arcm::in() && !penrose && !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 && !binarytiling) || experimental) return;
if(sphere || quotient || nonisotropic || (penrose && !bt::in()) || experimental) return;
if(chaosmode > 1) return;
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); */
}
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() &&
items[itEmerald] >= U5 && !tactic::on && !racing::on))) {
int rtr = newRoundTableRadius();
@ -1664,7 +1664,7 @@ EX int masterAlt(cell *c) {
EX void moreBigStuff(cell *c) {
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);
if(quotient) return;
@ -1701,7 +1701,7 @@ EX void moreBigStuff(cell *c) {
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 && !chaosmode) currentmap->generateAlts(c->master);
preventbarriers(c);
@ -1725,7 +1725,7 @@ EX void moreBigStuff(cell *c) {
c->wall = waColumn;
}
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) {
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) currentmap->generateAlts(c->master);
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) currentmap->generateAlts(c->master);
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;
if(tactic::on && specialland == laWhirlpool)
fullwhirlpool = true;

View File

@ -8,9 +8,12 @@
#include "hyper.h"
namespace hr {
EX namespace binary {
EX namespace 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
enum bindir {
bd_right = 0,
@ -194,10 +197,10 @@ EX namespace binary {
set_seed();
origin = hyperbolic_origin();
#if DEBUG_BINARY_TILING
binary::xcode.clear();
binary::rxcode.clear();
binary::xcode[&h] = (1 << 16);
binary::rxcode[1<<16] = &h;
bt::xcode.clear();
bt::rxcode.clear();
bt::xcode[&h] = (1 << 16);
bt::rxcode[1<<16] = &h;
#endif
origin->zebraval = 0;
origin->emeraldval = 0;
@ -461,7 +464,7 @@ EX namespace binary {
vector<hyperpoint> res;
ld yy = log(2) / 2;
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) {
case gBinary3:
@ -610,7 +613,7 @@ EX namespace binary {
if(geometry == gTernary) return 4;
if(geometry == gBinaryTiling) return 5;
if(penrose) return 0;
if(!binarytiling) return 0;
if(!bt::in()) return 0;
return S7-1;
}
@ -945,7 +948,7 @@ EX int celldistance3(heptagon *c1, heptagon *c2) {
case gHoroRec: return celldistance3_rec(c1, c2);
case gHoroHex: return celldistance3_hex(c1, c2);
default:
if(sol || !binarytiling) {
if(sol || !bt::in()) {
println(hlog, "called celldistance3 for wrong geometry"); return 0;
}
return celldistance3_approx(c1, c2);
@ -956,7 +959,7 @@ EX int celldistance3(cell *c1, cell *c2) { return celldistance3(c1->master, c2->
#endif
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) {
@ -1011,7 +1014,7 @@ EX hyperpoint get_corner_horo_coordinates(cell *c, int i) {
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();
#endif
#if MAXMDIM >= 4
else if(WDIM == 3 && !binarytiling) currentmap = reg3::new_map();
else if(WDIM == 3 && !bt::in()) currentmap = reg3::new_map();
#endif
else if(sphere) currentmap = new_spherical_map();
else if(quotient) currentmap = quotientspace::new_map();
#if CAP_BT
else if(binarytiling) currentmap = binary::new_map();
else if(bt::in()) currentmap = bt::new_map();
#endif
else if(S3 >= OINF) currentmap = inforder::new_map();
else currentmap = new hrmap_hyperbolic;
@ -325,7 +325,7 @@ template<class T> void subcell(cell *c, const T& t) {
subcell(c2, t);
}
}
else if(BITRUNCATED && !arcm::in() && !binarytiling)
else if(BITRUNCATED && !arcm::in() && !bt::in())
forCellEx(c2, c) t(c2);
t(c);
}
@ -377,7 +377,7 @@ EX void clearfrom(heptagon *at) {
}
}
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)) {
if(at->move(i)->alt != &deletion_marker)
q.push(at->move(i));
@ -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 || 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(IRREGULAR) return irr::celldist(c, false);
#endif
@ -477,7 +477,7 @@ EX int celldistAlt(cell *c) {
return d;
}
#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
if(nil) return c->master->zebraval + abs(c->master->emeraldval) + (specialland == laCamelot && !tactic::on? 30 : 0);;
#if CAP_CRYSTAL
@ -746,9 +746,9 @@ cdata *getHeptagonCdata(heptagon *h) {
if(sphere || quotient) h = currentmap->gamestart()->master;
bool starting = h->s == hsOrigin;
if(binarytiling) {
if(binary::mapside(h) == 0) starting = true;
for(int i=0; i<h->type; i++) if(binary::mapside(h->cmove(i)) == 0) starting = true;
if(bt::in()) {
if(bt::mapside(h) == 0) starting = true;
for(int i=0; i<h->type; i++) if(bt::mapside(h->cmove(i)) == 0) starting = true;
}
if(starting) {
@ -759,7 +759,7 @@ cdata *getHeptagonCdata(heptagon *h) {
return h->cdata;
}
int dir = binarytiling ? 5 : 0;
int dir = bt::in() ? 5 : 0;
cdata mydata = *getHeptagonCdata(h->cmove(dir));
@ -920,8 +920,8 @@ EX int heptdistance(heptagon *h1, heptagon *h2) {
if(h1 == h2) return d;
for(int i=0; i<S7; i++) if(h1->move(i) == h2) return d + 1;
int d1 = h1->distance, d2 = h2->distance;
if(d1 >= d2) d++, h1 = createStep(h1, binary::updir());
if(d2 > d1) d++, h2 = createStep(h2, binary::updir());
if(d1 >= d2) d++, h1 = createStep(h1, bt::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 CAP_BT && MAXMDIM >= 4
if(binarytiling && WDIM == 3)
return binary::celldistance3(c1, c2);
if(bt::in() && WDIM == 3)
return bt::celldistance3(c1, c2);
#endif
#if MAXMDIM >= 4
@ -1238,7 +1238,7 @@ EX vector<int> reverse_directions(heptagon *c, int dir) {
}
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);
for(int t=0; t<c->type; t++) {
if(!c->move(t)) continue;
if(binarytiling && !sol && !among(t, 5, 6, 8)) continue;
if(!binarytiling && c->move(t) < c) continue;
if(bt::in() && !sol && !among(t, 5, 6, 8)) continue;
if(!bt::in() && c->move(t) < c) continue;
dynamicval<color_t> g(poly_outline, gridcolor(c, c->move(t)));
queuepoly(V, cgi.shWireframe3D[ofs + t], 0);
}
}
#endif
#if CAP_BT
else if(binarytiling && WDIM == 2 && geometry != gTernary) {
else if(bt::in() && WDIM == 2 && geometry != gTernary) {
ld yx = log(2) / 2;
ld yy = yx;
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) {
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);
};
horizontal(yy, 2*xx, xx, 4, binary::bd_up_right);
horizontal(yy, xx, -xx, 8, binary::bd_up);
horizontal(yy, -xx, -2*xx, 4, binary::bd_up_left);
horizontal(yy, 2*xx, xx, 4, bt::bd_up_right);
horizontal(yy, xx, -xx, 8, bt::bd_up);
horizontal(yy, -xx, -2*xx, 4, bt::bd_up_left);
}
#endif
else if(isWarped(c) && has_nice_dual()) {
@ -1027,7 +1027,7 @@ void celldrawer::set_land_floor(const transmatrix& Vf) {
case laSwitch:
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));
break;
@ -1639,7 +1639,7 @@ void celldrawer::check_rotations() {
if(0);
#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) {
usethis = true;
spd = 1;

View File

@ -1120,7 +1120,7 @@ EX namespace mirror {
return true;
}
#endif
if(binarytiling || IRREGULAR) {
if(bt::in() || IRREGULAR) {
// mirrors not supported
if(is_mirrorland(c)) {
c->item = itShard;
@ -1245,7 +1245,7 @@ EX namespace mirror {
cell *c = cw.at;
#if MAXMDIM >= 4
if(WDIM == 3 && !binarytiling) {
if(WDIM == 3 && !bt::in()) {
if(shmup::on) for(int i=0; i<cw.at->type; i++)
createMirror(cw + i + wstep - i, cpid);
return;
@ -1276,7 +1276,7 @@ EX namespace mirror {
}
#endif
#if MAXMDIM >= 4
if(WDIM == 3 && !binarytiling) {
if(WDIM == 3 && !bt::in()) {
if(shmup::on) for(int i=0; i<cw.at->type; i++)
createMirror(cw + i + wstep - i, cpid);
return;
@ -2700,7 +2700,7 @@ EX namespace sword {
sword_angles = 2;
if(SWORDDIM == 3) sword_angles = 1;
else if(IRREGULAR) sword_angles = 840;
else if(binarytiling) sword_angles = 42;
else if(bt::in()) sword_angles = 42;
else if(arcm::in()) {
if(!PURE) possible_divisor((BITRUNCATED ? 2 : 1) * isize(arcm::current.faces));
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++) {
cell *c1 = c->cmove(i);
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);
}
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++) {
cell *c1 = c->cmove(i);
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);
}
@ -487,7 +487,7 @@ EX bool sizes_known() {
if(GDIM == 3) return false;
if(bounded) return false;
// Castle Anthrax is infinite
if(binarytiling) return false;
if(bt::in()) return false;
// not implemented
if(arcm::in()) return false;
if(penrose) return false;
@ -795,7 +795,7 @@ void expansion_analyzer::view_distances_dialog() {
dialog::addBreak(100 * scrolltime / scrollspeed);
if(sizes_known() || binarytiling) {
if(sizes_known() || bt::in()) {
if(euclid) {
dialog::addBreak(200);
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;
#endif
#if CAP_BT
else if(binarytiling) sibling_limit = 3;
else if(bt::in()) sibling_limit = 3;
#endif
#if CAP_GP
else {
@ -989,7 +989,7 @@ EX void set_sibling_limit() {
}
int celldist0(cell *c) {
if(binarytiling) return celldistAlt(c);
if(bt::in()) return celldistAlt(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);
#if CAP_BT
if(binarytiling) {
if(bt::in()) {
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);
for(int i=0; i<sides; i++) {
hyperpoint h0 = binary::get_corner_horo_coordinates(c, i) * size;
hyperpoint h1 = binary::get_corner_horo_coordinates(c, i+1) * size;
hyperpoint h0 = bt::get_corner_horo_coordinates(c, i) * size;
hyperpoint h1 = bt::get_corner_horo_coordinates(c, i+1) * size;
if(t) h0 *= SHADMUL, h1 *= SHADMUL;
hyperpoint hd = (h1 - h0) / STEP;
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]);
@ -284,11 +284,11 @@ void geometry_information::bshape_regular(floorshape &fsh, int id, int sides, in
for(int i=0; i<c->type; i++) {
sizeto(fsh.gpside[k][i], id);
bshape(fsh.gpside[k][i][id], PPR::LAKEWALL);
hyperpoint h0 = binary::get_corner_horo_coordinates(c, i) * size;
hyperpoint h1 = binary::get_corner_horo_coordinates(c, i+1) * size;
hyperpoint h0 = bt::get_corner_horo_coordinates(c, i) * size;
hyperpoint h1 = bt::get_corner_horo_coordinates(c, i+1) * size;
hyperpoint hd = (h1 - h0) / STEP;
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);
}
}
@ -326,7 +326,7 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
for(auto pfsh: all_plain_floorshapes) {
auto& fsh = *pfsh;
if(STDVAR && (standard_tiling() || binarytiling)) {
if(STDVAR && (standard_tiling() || bt::in())) {
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;
#if CAP_BT
if(binarytiling)
if(bt::in())
for(int t=0; t<c->type; t++)
texture_order([&] (ld x, ld y) {
hyperpoint left = binary::get_corner_horo_coordinates(c, t);
hyperpoint right = binary::get_corner_horo_coordinates(c, t+1);
hpcpush(orthogonal_move(binary::get_horopoint(left * x + right * y), dfloor_table[k]));
hyperpoint left = bt::get_corner_horo_coordinates(c, t);
hyperpoint right = bt::get_corner_horo_coordinates(c, t+1);
hpcpush(orthogonal_move(bt::get_horopoint(left * x + right * y), dfloor_table[k]));
});
else
#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 top = co ? (FLOOR + WALL) / 2 : WALL;
#if CAP_BT
if(binarytiling)
if(bt::in())
for(int t=0; t<c->type; t++)
texture_order([&] (ld x, ld y) {
hyperpoint left = binary::get_corner_horo_coordinates(c, t);
hyperpoint right = binary::get_corner_horo_coordinates(c, t+1);
hpcpush(orthogonal_move(binary::get_horopoint(left * x + right * y), top + h * (x+y)));
hyperpoint left = bt::get_corner_horo_coordinates(c, t);
hyperpoint right = bt::get_corner_horo_coordinates(c, t+1);
hpcpush(orthogonal_move(bt::get_horopoint(left * x + right * y), top + h * (x+y)));
});
else
#endif
@ -725,7 +725,7 @@ void geometry_information::generate_floorshapes() {
else {
cell model;
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", [] {
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", [] {
return forced_quotient() && !elliptic;
@ -290,7 +290,7 @@ void set_or_configure_geometry(eGeometry g) {
if(g == gRotSpace) {
bool ok = true;
if(arcm::in()) ok = PURE;
else if(binarytiling || penrose) ok = false;
else if(bt::in() || penrose) ok = false;
else ok = PURE || BITRUNCATED;
if(!ok) {
addMessage(XLAT("Only works with (semi-)regular tilings"));
@ -611,7 +611,7 @@ EX void showEuclideanMenu() {
}
#endif
#if CAP_BT
else if(binarytiling)
else if(bt::in())
spf = "6,[6,7],7";
#endif
else if(BITRUNCATED)
@ -664,7 +664,7 @@ EX void showEuclideanMenu() {
else if(hybri) {
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::add_action([] {
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"),
#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
#if CAP_ARCM
arcm::in() && (WDIM == 2) ? arcm::current.world_size() :

View File

@ -442,7 +442,7 @@ void geometry_information::prepare_basics() {
goto hybrid_finish;
}
if((sphere || hyperbolic) && WDIM == 3 && !binarytiling) {
if((sphere || hyperbolic) && WDIM == 3 && !bt::in()) {
rhexf = hexf = 0.378077;
crossf = hcrossf = 0.620672;
tessf = 1.090550;
@ -509,12 +509,12 @@ void geometry_information::prepare_basics() {
}
#endif
#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(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
#if CAP_BT && MAXMDIM >= 4
if(binarytiling) binary::build_tmatrix();
if(bt::in()) bt::build_tmatrix();
#endif
hybrid_finish:
@ -880,7 +880,7 @@ EX void check_cgi() {
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)));
@ -891,7 +891,7 @@ EX void check_cgi() {
if(geometry == gFieldQuotient) { V("S3=", its(S3)); V("S7=", 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) {
V("CAMERA", fts(vid.camera));

View File

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

View File

@ -3012,7 +3012,7 @@ EX int countMinesAround(cell *c) {
}
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);
if(si.reflect) V = V * Mirror;
if(euclid) return V;
@ -3155,7 +3155,7 @@ EX bool has_nice_dual() {
#if CAP_ARCM
if(arcm::in()) return geosupport_football() >= 2;
#endif
if(binarytiling) return false;
if(bt::in()) return false;
if(BITRUNCATED) return true;
if(a4) return false;
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(sol) return darkval_sol[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 == 12) return darkval_s12[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 *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 CAP_IRR
if(IRREGULAR)
@ -228,7 +228,7 @@ heptagon *createStep(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:
int pard=0;
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 S7 cginf.sides
#define S3 cginf.vertex
#define hyperbolic_37 (S7 == 7 && S3 == 3 && !binarytiling && !arcm::in())
#define hyperbolic_not37 ((S7 > 7 || S3 > 3 || binarytiling || arcm::in()) && hyperbolic)
#define weirdhyperbolic ((S7 > 7 || S3 > 3 || !STDVAR || binarytiling || arcm::in()) && hyperbolic)
#define stdhyperbolic (S7 == 7 && S3 == 3 && STDVAR && !binarytiling && !arcm::in())
#define hyperbolic_37 (S7 == 7 && S3 == 3 && !bt::in() && !arcm::in())
#define hyperbolic_not37 ((S7 > 7 || S3 > 3 || bt::in() || arcm::in()) && hyperbolic)
#define weirdhyperbolic ((S7 > 7 || S3 > 3 || !STDVAR || bt::in() || arcm::in()) && hyperbolic)
#define stdhyperbolic (S7 == 7 && S3 == 3 && STDVAR && !bt::in() && !arcm::in())
#define cgflags cginf.flags
#define binarytiling (cgflags & qBINARY)
#define cryst (cgflags & qCRYSTAL)
#define penrose (cgflags & qPENROSE)
@ -127,7 +126,7 @@ void addMessage(string s, char spamtype = 0);
#define experimental (cgflags & qEXPERIMENTAL)
// 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 euclid (cgclass == gcEuclid)
@ -403,7 +402,7 @@ typedef function<int(struct cell*)> cellfunction;
// passable flags
#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 ROCKSNAKELENGTH 50
#define WORMLENGTH 15

View File

@ -973,7 +973,7 @@ EX ld master_to_c7_angle() {
#if CAP_GP
if(cgi.gpdata) alpha = cgi.gpdata->alpha;
#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) {
@ -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);
#endif
#if CAP_BT
if(binarytiling) return V;
if(bt::in()) return V;
#endif
if(penrose) return 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)
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;
#if MAXMDIM >= 4
else if(euc::in(3))
@ -705,7 +705,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
int dy = gmod(y, 3);
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;
else if(a4 || sphere || arcm::in())
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:
// 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);
if(celldist(from) > 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(binarytiling && WDIM == 3 && !c->land && !solnih) {
if(bt::in() && WDIM == 3 && !c->land && !solnih) {
ld z = vid.binary_width;
cell *cseek = c;
int step = 0;
if(geometry == gHoroHex) z *= 2;
ld scale = binary::expansion();
while(z < 3.999 && step < 10) cseek = cseek->cmove(binary::updir()), z *= scale;
ld scale = bt::expansion();
while(z < 3.999 && step < 10) cseek = cseek->cmove(bt::updir()), z *= scale;
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(l == laWarpCoast) return ugly_version_nofull;
if(l == laWineyard && hyperbolic && !binarytiling && S7 == 6) return lv::pattern_special;
if(l == laEmerald && hyperbolic && !binarytiling && S7 == 12) return lv::pattern_special;
if(l == laWineyard && hyperbolic && !bt::in() && S7 == 6) 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(among(l, laWhirlpool, laPrairie, laWestWall, laBull)) return lv::not_3d;
if(l == laEndorian && geometry == gKiteDart3) return not_implemented;
if(l == laEndorian && sol) return not_implemented;
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 == 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 == 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(binarytiling) {
if(bt::in()) {
if(among(l, laMountain, laTemple)) return lv::pattern_compatibility_sole;
if(among(l, laDungeon, laIvoryTower, laOcean, laEndorian)) return lv::pattern_compatibility;
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)
return not_implemented;
if(binarytiling && among(l, laMirror, laMirrorOld))
if(bt::in() && among(l, laMirror, laMirrorOld))
return dont_work;
if(l == laWhirlwind && hyperbolic_not37)
@ -1191,7 +1191,7 @@ EX land_validity_t& land_validity(eLand l) {
if(l == laWildWest && !randomPatternsMode)
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 ok;

View File

@ -165,7 +165,7 @@ namespace mapstream {
if(hybri && VERNUM_HEX >= 0xA80C) {
hybrid::in_underlying_geometry([&] { save_geometry(f); });
}
if(binarytiling && VERNUM_HEX >= 0xA80C)
if(bt::in() && VERNUM_HEX >= 0xA80C)
f.write(vid.binary_width);
if(euc::in()) {
f.write(euc::eu_input.user_axes);
@ -251,7 +251,7 @@ namespace mapstream {
load_geometry(f);
set_geometry(g);
}
if(binarytiling && VERNUM_HEX >= 0xA80C)
if(bt::in() && VERNUM_HEX >= 0xA80C)
f.read(vid.binary_width);
if(euc::in() && VERNUM_HEX >= 0xA80D) {
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;
push += wstep;
cell *c2 = push.at;
if(binarytiling) {
if(bt::in()) {
auto rd = reverse_directions(push.at, push.spin);
for(int i: rd) {
push.spin = i;

View File

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

View File

@ -18,7 +18,7 @@ EX int ctof(cell *c) {
if(PURE) return 1;
// if(euclid) return 0;
if(!c) return 1;
if(binarytiling) return c->type == 7;
if(bt::in()) return c->type == 7;
return ishept(c) ? 1 : 0;
// c->type == 6 ? 0 : 1;
}
@ -386,7 +386,7 @@ EX int fieldval_uniq(cell *c) {
if(bounded) return p.first + (p.second << 16);
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(WDIM == 3) return c->master->fieldval;
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) {
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(a38) val38(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.symmetries = c->type;
if(binarytiling) {
if(bt::in()) {
if(pat == PAT_SINGLETYPE) si.id = 0;
else si.id = c->type & 1;
si.dir = 2;
@ -1202,14 +1202,14 @@ EX bool geosupport_chessboard() {
(arcm::in() && PURE) ? arcm::current.support_chessboard() :
(arcm::in() && DUAL) ? arcm::current.support_threecolor_bitruncated() :
#endif
(binarytiling || penrose) ? 0 :
(bt::in() || penrose) ? 0 :
(S3 >= OINF) ? true :
(VALENCE % 2 == 0);
}
EX int geosupport_threecolor() {
if(IRREGULAR) return 0;
if(penrose || binarytiling) return 0;
if(penrose || 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(binarytiling || penrose) return 0;
if(bt::in() || penrose) return 0;
#if CAP_ARCM
if(arcm::in() && DUAL) return false;
@ -1264,7 +1264,7 @@ EX int pattern_threecolor(cell *c) {
}
#endif
if(arb::in()) return 0;
if(IRREGULAR || binarytiling) return !pseudohept(c);
if(IRREGULAR || bt::in()) return !pseudohept(c);
#if CAP_GP
if(S3 == 3 && !(S7&1) && gp_threecolor() == 1 && c->master->c7 != 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(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(binarytiling) return binary::pseudohept(c);
if(bt::in()) return bt::pseudohept(c);
#endif
if(S3 >= OINF) return c->master->distance % 3 == 1;
#if MAXMDIM == 4
@ -1657,7 +1657,7 @@ EX namespace patterns {
int y = (c->master->fieldval >> 12) & 4095;
ignore(x);
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(hrand(100) == 0) return 0;
return 0x1000000 | (0xFFFFFF & (0x671349 + y * 0x512369));
@ -2572,7 +2572,7 @@ EX namespace linepatterns {
case patTree:
if(is_master(c)) {
int dir = binarytiling ? binary::updir() : 0;
int dir = bt::in() ? bt::updir() : 0;
cell *c2 = c->master->move(dir)->c7;
if(gmatrix.count(c2)) {
if(S3 >= OINF)

View File

@ -39,12 +39,12 @@ transmatrix meupush(ld x, ld y) {
if(euclid)
return eupush(euscale * x, euscale * y);
else
return binary::parabolic3(x, y);
return bt::parabolic3(x, y);
}
hyperpoint mhpxy(ld x, ld 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;
@ -149,7 +149,7 @@ struct hrmap_kite : hrmap {
heptagon *h = tailored_alloc<heptagon> (8);
h->s = hstate(s);
h->dm4 = h->distance = dist;
if(binarytiling || dist == 0)
if(bt::in() || dist == 0)
h->c7 = newCell(euclid ? 4 : s == pKite ? 12 : 10, h);
else
h->c7 = NULL;
@ -163,7 +163,7 @@ struct hrmap_kite : hrmap {
heptagon *hspawn(heptagon *of, int our, int their, pshape s) {
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);
return h;
}

View File

@ -412,12 +412,12 @@ void geometry_information::procedural_shapes() {
if(0);
#if CAP_BT
else if(binarytiling) {
else if(bt::in()) {
for(int i=0; i<2; i++) {
bshape(shWall[i], PPR::WALL);
hpcpush(binary::get_horopoint(log(2)/8, .1));
hpcpush(binary::get_horopoint(log(2)/8, -.1));
hpcpush(binary::get_horopoint(-log(2)/8, 0));
hpcpush(bt::get_horopoint(log(2)/8, .1));
hpcpush(bt::get_horopoint(log(2)/8, -.1));
hpcpush(bt::get_horopoint(-log(2)/8, 0));
}
}
#endif
@ -709,10 +709,10 @@ void geometry_information::compute_cornerbonus() { }
hyperpoint ray_kleinize(hyperpoint h, int id, ld pz) {
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;
// 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) {
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);
hpcpush(h); return;
}
if(solnih || !binarytiling) { hpcpush(normalize(h)); return; }
hyperpoint res = binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
if(solnih || !bt::in()) { hpcpush(normalize(h)); return; }
hyperpoint res = bt::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
hpcpush(res);
});
}
@ -810,8 +810,8 @@ void geometry_information::make_wall(int id, vector<hyperpoint> vertices, vector
}
if(nil)
h = nilv::on_geodesic(vertices[a], vertices[(a+1)%n], y * 1. / STEP);
if(solnih || !binarytiling) { hpcpush(normalize(h)); continue; }
hyperpoint res = binary::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
if(solnih || !bt::in()) { hpcpush(normalize(h)); continue; }
hyperpoint res = bt::parabolic3(h[0], h[1]) * xpush0(yy*h[2]);
hpcpush(res);
}
hpcpush(hpc[last->s]);
@ -848,7 +848,7 @@ void geometry_information::reserve_wall3d(int i) {
void geometry_information::create_wall3d() {
if(WDIM == 2) return;
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 h01 = point3(-1,0,-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));
}
if(GDIM == 3 && binarytiling && geometry == gHoroTris) {
if(GDIM == 3 && bt::in() && geometry == gHoroTris) {
ld r = sqrt(3)/6;
ld r1 = r;
ld r2 = r * 2;
@ -897,7 +897,7 @@ void geometry_information::create_wall3d() {
if(geometry == gHoroRec) {
ld r2 = sqrt(2);
ld z = binary::hororec_scale;
ld z = bt::hororec_scale;
hyperpoint a00 = 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) {
ld z = log(3) / log(2) / 2;
ld r3 = sqrt(3) / 2 * binary::horohex_scale;
ld h = binary::horohex_scale / 2;
ld r3 = sqrt(3) / 2 * bt::horohex_scale;
ld h = bt::horohex_scale / 2;
hyperpoint down = point3(0,0,2*z);
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();
int facesize = isize(reg3::cellshape) / S7;
for(int w=0; w<S7; w++) {
@ -1084,7 +1084,7 @@ void geometry_information::create_wall3d() {
if(penrose) {
auto kv = kite::make_walls();
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));
}
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;
if((solnih || nil) && pmodel == mdGeodesic)
return true;
if(euclid && pmodel == mdPerspective && !binarytiling)
if(euclid && pmodel == mdPerspective && !bt::in())
return true;
if(prod && PURE)
return true;
@ -183,10 +183,10 @@ void enable_raycaster() {
int flat1 = 0, flat2 = S7;
if(hyperbolic && binarytiling) {
if(hyperbolic && bt::in()) {
fsh += "uniform mediump float uBLevel;\n";
flat1 = binary::dirs_outer();
flat2 -= binary::dirs_inner();
flat1 = bt::dirs_outer();
flat2 -= bt::dirs_inner();
}
if(IN_ODS || hyperbolic) fsh +=
@ -217,7 +217,7 @@ void enable_raycaster() {
fsh +=
"vec2 map_texture(vec4 pos, int which) {\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.yz *= exp(pos.x);\n";
else if(hyperbolic) fsh +=
@ -356,7 +356,7 @@ void enable_raycaster() {
// 20: get to horosphere +uBLevel (take smaller root)
// 21: get to horosphere -uBLevel (take larger root)
if(hyperbolic && binarytiling) {
if(hyperbolic && bt::in()) {
fmain +=
"for(int i=20; i<22; i++) {\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";
#endif
if(hyperbolic && binarytiling) {
if(hyperbolic && bt::in()) {
fmain +=
"if(which == 20) {\n"
" float best = 999.;\n"
@ -695,7 +695,7 @@ void enable_raycaster() {
if(use_reflect) {
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"
" float x = -log(position.w - position.x);\n"
" vec4 xtan = xpush(-x) * tangent;\n"
@ -992,7 +992,7 @@ EX void cast() {
if(o->uPLevel != -1)
glUniform1f(o->uPLevel, cgi.plevel / 2);
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->uExpDecay, exp_decay_current());

View File

@ -6,7 +6,7 @@
*
* 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
* 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"
@ -644,7 +644,7 @@ EX namespace reg3 {
if(hyperbolic) {
dynamicval<eGeometry> g(geometry, gBinary3);
binary::build_tmatrix();
bt::build_tmatrix();
alt = tailored_alloc<heptagon> (S7);
alt->s = hsOrigin;
alt->emeraldval = 0;
@ -653,7 +653,7 @@ EX namespace reg3 {
alt->alt = alt;
alt->cdata = 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;
}
@ -917,7 +917,7 @@ EX int celldistance(cell *c1, cell *c2) {
if(close_distances.count(b)) return close_distances[b];
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) {
@ -987,7 +987,7 @@ EX void generate_cellrotations() {
ld adistance(cell *c) {
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];
}

View File

@ -659,9 +659,9 @@ EX void apply() {
reflect_view();
View = ypush(-shift_angle * degree) * spin(-movement_angle * degree) * View;
if(GDIM == 2)
View = binary::parabolic(parabolic_length * t / period) * View;
View = bt::parabolic(parabolic_length * t / period) * View;
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;
moved();
break;

View File

@ -1215,7 +1215,7 @@ EX void set_geometry(eGeometry target) {
if(DUAL && geometry != gArchimedean)
variation = ginf[geometry].default_variation;
#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
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(binarytiling || sol || penrose || WDIM == 3) if(!prod) geometry = gNormal;
if(bt::in() || sol || penrose || WDIM == 3) if(!prod) geometry = gNormal;
auto& cd = ginf[gCrystal];
if(target == eVariation::bitruncated && cryst && cd.sides == 8 && cd.vertex == 4) {
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));
int sd = si.dir;
if((NONSTDVAR) || binarytiling) sd = 0;
if((NONSTDVAR) || bt::in()) sd = 0;
for(int i=0; i<c->type; i++) {
hyperpoint h1 = iv * get_corner_position(c, (i + sd + shift) % c->type);

View File

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