diff --git a/bigstuff.cpp b/bigstuff.cpp index 863a2fec..ac6e1420 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -591,6 +591,7 @@ void buildEquidistant(cell *c) { #if CAP_BT if(binarytiling) { int skip = geometry == gHoroRec ? 3 : 2; + int up = binary::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) @@ -600,9 +601,9 @@ void buildEquidistant(cell *c) { if(c->move(d) && c->move(d)->landflags) c->landflags = 1; } - else if(WDIM == 3 && c->landparam % skip != 1 && c->move(S7-1) && c->move(S7-1)->landflags) + else if(WDIM == 3 && c->landparam % skip != 1 && c->move(up) && c->move(up)->landflags) c->landflags = 1; - else if(WDIM == 3 && c->landparam % skip == 1 && c->move(S7-1) && c->move(S7-1)->c.spin(S7-1) == (c->c.spin(S7-1)) && c->move(S7-1)->move(S7-1)->landflags) + else if(WDIM == 3 && c->landparam % skip == 1 && c->move(up) && c->move(up)->c.spin(up) == (c->c.spin(up)) && c->move(up)->move(up)->landflags) c->landflags = 1; if(c->landflags) c->wall = (WDIM == 3 ? waTrunk3 : waTrunk); } @@ -1535,7 +1536,7 @@ void moreBigStuff(cell *c) { if(i > 1) c->wall = waColumn; } else if(geometry == gHoroTris || geometry == gHoroRec) { - if(c->c.spin(S7-1) != 0) c->wall = waColumn; + if(c->c.spin(binary::updir()) != 0) c->wall = waColumn; } else if(geometry == gKiteDart3) { if(kite::getshape(c->master) == kite::pKite) c->wall = waColumn; diff --git a/binary-tiling.cpp b/binary-tiling.cpp index f989ab17..fb8e199e 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -478,6 +478,24 @@ namespace binary { return (use_direct >> dir) & 1; } + ld expansion() { + switch(geometry) { + case gHoroRec: + return sqrt(2); + case gHoroHex: + return sqrt(3); + case gKiteDart3: + return (sqrt(5)+1)/2; + default: + return 2; + } + } + + int updir() { + if(penrose) return 4; + return S7-1; + } + void build_tmatrix() { if(among(geometry, gBinaryTiling, gSol)) return; // unused use_direct = (1 << (S7-1)) - 1; diff --git a/landgen.cpp b/landgen.cpp index a9d82b7d..cfed495c 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -2523,7 +2523,8 @@ void setdist(cell *c, int d, cell *from) { cell *cseek = c; int step = 0; if(geometry == gHoroHex) z *= 2; - while(z < 3.999 && step < 10) cseek = cseek->cmove(penrose ? 4 : S7-1), z *= 2; + ld scale = binary::expansion(); + while(z < 3.999 && step < 10) cseek = cseek->cmove(binary::updir()), z *= scale; if(cseek->master->emeraldval) setland(c, eLand(cseek->master->emeraldval)); }