diff --git a/achievement.cpp b/achievement.cpp index 493a625c..d5e404b4 100644 --- a/achievement.cpp +++ b/achievement.cpp @@ -85,7 +85,7 @@ bool wrongMode(char flags) { if(cheater) return true; if(flags == 'x') return false; if(nonbitrunc != (flags == '7')) return true; - if(whirl::whirl) return true; + if(gp::on) return true; switch(flags) { case 'e': @@ -622,7 +622,7 @@ void achievement_final(bool really_final) { if(shmup::on) specials++; if(chaosmode) specials++; if(nonbitrunc) specials++; - if(whirl::whirl) specials++; + if(gp::on) specials++; if(inv::on) specials++; if(specials > 1) return; diff --git a/barriers.cpp b/barriers.cpp index ad8b8758..dc806ef4 100644 --- a/barriers.cpp +++ b/barriers.cpp @@ -743,7 +743,7 @@ bool buildBarrierNowall(cell *c, eLand l2, bool force) { for(int i=0; itype; i++) { int d = ds[i]; -/* if(warpv && whirl::whirl) { +/* if(warpv && gp::on) { d = hrand(c->type); */ if(warpv && c->mov[d] && c->mov[d]->mpdist < c->mpdist) continue; /* } diff --git a/bigstuff.cpp b/bigstuff.cpp index b70c6d11..ff55e758 100644 --- a/bigstuff.cpp +++ b/bigstuff.cpp @@ -105,7 +105,7 @@ void generateAlts(heptagon *h, int levs, bool link_cdata) { if(!h->alt) return; preventbarriers(h->c7); for(int i=0; ic7->mov[i]); - if(whirl::whirl) + if(gp::on) for(int i=0; ic7); for(int i=0; ialt, i)->alt = h->alt->alt; @@ -957,8 +957,8 @@ bool mouse_reachability_test(cell *c) { bool horo_ok() { if(!hyperbolic) return false; - if(!whirl::whirl) return true; - if(whirl::param.second) return false; + if(!gp::on) return true; + if(gp::param.second) return false; return true; } @@ -995,7 +995,7 @@ void buildBigStuff(cell *c, cell *from) { // buildgreatwalls - if(celldist(c) < 3 && !whirl::whirl) { + if(celldist(c) < 3 && !gp::on) { if(top_land && c == cwt.c->master->move[3]->c7) { buildBarrierStrong(c, 6, true, top_land); } @@ -1085,7 +1085,7 @@ void buildBigStuff(cell *c, cell *from) { createAlternateMap(c, 2, hsA); if(c->land == laOvergrown && ctof(c) && - (quickfind(laClearing) || (hrand(I2000) < 25 && !whirl::whirl && + (quickfind(laClearing) || (hrand(I2000) < 25 && !gp::on && !randomPatternsMode && items[itMutant] >= U5 && isLandIngame(laClearing) && !tactic::on && !yendor::on))) { diff --git a/blizzard.cpp b/blizzard.cpp index 88aba928..d16488db 100644 --- a/blizzard.cpp +++ b/blizzard.cpp @@ -4,7 +4,7 @@ double randd() { return (rand() + .5) / (RAND_MAX + 1.); } double cellgfxdist(cell *c, int i) { - return nonbitrunc ? tessf * whirl::scale : (c->type == 6 && (i&1)) ? hexhexdist : crossf; + return nonbitrunc ? tessf * gp::scale : (c->type == 6 && (i&1)) ? hexhexdist : crossf; } transmatrix cellrelmatrix(cell *c, int i) { diff --git a/cell.cpp b/cell.cpp index 878d493b..9ca25b45 100644 --- a/cell.cpp +++ b/cell.cpp @@ -739,8 +739,8 @@ cell *createMov(cell *c, int d) { } if(c->mov[d]) return c->mov[d]; - else if(nonbitrunc && whirl::whirl) { - whirl::extend_map(c, d); + else if(nonbitrunc && gp::on) { + gp::extend_map(c, d); if(!c->mov[d]) { printf("extend failed to create for %p/%d\n", c, d); exit(1); @@ -935,7 +935,7 @@ void verifycell(cell *c) { } void verifycells(heptagon *at) { - if(whirl::whirl) return; + if(gp::on) return; for(int i=0; imove[i] && at->move[i]->move[at->spin(i)] && at->move[i]->move[at->spin(i)] != at) { printf("hexmix error %p [%d s=%d] %p %p\n", at, i, at->spin(i), at->move[i], at->move[i]->move[at->spin(i)]); } @@ -983,7 +983,7 @@ int celldist(cell *c) { } if(sphere) return celldistance(c, currentmap->gamestart()); if(ctof(c)) return c->master->distance; - if(whirl::whirl) return whirl::compute_dist(c, celldist); + if(gp::on) return gp::compute_dist(c, celldist); int dx[MAX_S3]; for(int u=0; umaster->distance; @@ -1010,7 +1010,7 @@ int celldistAlt(cell *c) { } if(!c->master->alt) return 0; if(ctof(c)) return c->master->alt->distance; - if(whirl::whirl) return whirl::compute_dist(c, celldistAlt); + if(gp::on) return gp::compute_dist(c, celldistAlt); int dx[MAX_S3]; dx[0] = 0; for(int u=0; umaster->alt == NULL) return ALTDIST_UNKNOWN; @@ -1370,7 +1370,7 @@ int celldistance(cell *c1, cell *c2) { return eudist(decodeId(c1->master) - decodeId(c2->master)); } - if(sphere || quotient == 1 || whirl::whirl) { + if(sphere || quotient == 1 || gp::on) { celllister cl(c1, 64, 1000, c2); for(int i=0; imaster, l)->c7)); else for(int l=0; ltype; l++) v.push_back(getId(createMov(c, l))); diff --git a/debug.cpp b/debug.cpp index 95bc6cc5..cec7b203 100644 --- a/debug.cpp +++ b/debug.cpp @@ -323,8 +323,8 @@ void debugScreen() { dialog::addSelItem("pathdist", its(mouseover->pathdist), 0); dialog::addSelItem("celldistAlt", mouseover->master->alt ? its(celldistAlt(mouseover)) : "--", 0); dialog::addSelItem("temporary", its(mouseover->aitmp), 0); - if(whirl::whirl) - dialog::addSelItem("whirl", whirl::disp(whirl::get_local_info(mouseover).relative), 0); + if(gp::on) + dialog::addSelItem("whirl", gp::disp(gp::get_local_info(mouseover).relative), 0); dialog::addBreak(50); dialog::addSelItem("monster", dnameof2(mouseover->monst, mouseover->mondir), 0); dialog::addSelItem("stuntime/hitpoints", its(mouseover->stuntime)+"/"+its(mouseover->hitpoints), 0); diff --git a/game.cpp b/game.cpp index 37b159b8..ac46d834 100644 --- a/game.cpp +++ b/game.cpp @@ -3139,7 +3139,7 @@ void toggleGates(cell *ct, eWall type, int rad) { void toggleGates(cell *ct, eWall type) { playSound(ct, "click"); numgates = 0; - if(type == waClosePlate && nonbitrunc && !whirl::whirl) + if(type == waClosePlate && nonbitrunc && !gp::on) toggleGates(ct, type, 2); else toggleGates(ct, type, 3); diff --git a/geom-exp.cpp b/geom-exp.cpp index 816d53c6..78b15709 100644 --- a/geom-exp.cpp +++ b/geom-exp.cpp @@ -236,7 +236,7 @@ void showEuclideanMenu() { landvisited[laCA] = true; // for(int i=2; itype == 6 ? 0 : 1; @@ -290,11 +290,11 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) { if(!euclid) for(int a=0; amondir, S42); - if(whirl::whirl) Vb = Vb * xpush(crossf * .6); + if(gp::on) Vb = Vb * xpush(crossf * .6); else { if(weirdhyperbolic || sphere) Vb = Vb * xpush(-(hexhexdist - hcrossf7)); if(ctof(c) && !euclid) Vb = Vb * xpush(hexhexdist - hcrossf); @@ -2508,7 +2508,7 @@ void drawEmeraldFloor(const transmatrix& V, cell *c, int col) { int ct6 = ctof(c); int xct6 = ct6; - if(whirl::whirl && has_nice_dual() && pseudohept(c) && !ishept(c)) xct6 = 2; + if(gp::on && has_nice_dual() && pseudohept(c) && !ishept(c)) xct6 = 2; qfloor(c, V, CAVEFLOOR, col); } @@ -3050,8 +3050,8 @@ bool noAdjacentChasms(cell *c) { // does the current geometry allow nice duals bool has_nice_dual() { if(!nonbitrunc) return true; - if(!whirl::whirl) return false; - return (whirl::param.first + whirl::param.second * 2) % 3 == 0; + if(!gp::on) return false; + return (gp::param.first + gp::param.second * 2) % 3 == 0; } // does the current geometry allow nice duals @@ -3060,7 +3060,7 @@ bool is_nice_dual(cell *c) { } bool use_swapped_duals() { - return (euclid && !a4) || whirl::whirl; + return (euclid && !a4) || gp::on; } void floorShadow(cell *c, const transmatrix& V, int col, bool warp) { @@ -3194,7 +3194,7 @@ void placeSidewall(cell *c, int i, int sidepar, const transmatrix& V, bool warp, bool b = !(i&1); if(use_swapped_duals()) { if(!ishex1(c)) b = !b; - if(whirl::whirl) b = !b; + if(gp::on) b = !b; } if(b) return; } @@ -3344,7 +3344,7 @@ static const int trapcol[4] = {0x904040, 0xA02020, 0xD00000, 0x303030}; static const int terracol[8] = {0xD000, 0xE25050, 0xD0D0D0, 0x606060, 0x303030, 0x181818, 0x0080, 0x8080}; void qfloor_eswap(cell *c, const transmatrix& V, const hpcshape& sh, int col) { - if((euclid || whirl::whirl) && ishex1(c)) + if((euclid || gp::on) && ishex1(c)) qfloor(c, V, pispin, sh, col); else qfloor(c, V, sh, col); @@ -3491,7 +3491,7 @@ void draw_wall(cell *c, const transmatrix& V, int wcol, int& zcol, int ct6, int } void qfloor_caves(cell* c, const transmatrix& Vf, int col, int ct6, int xct6) { - /* if(whirl::whirl) { + /* if(gp::on) { if(pseudohept(c)) qfloor(c, Vf, shCaveFloor[ishept(c) ? 1 : 2], col); else if(ishex1(c)) @@ -3785,7 +3785,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { int ctype = c->type; int ct6 = ctof(c); int xct6 = ct6; - if(whirl::whirl && has_nice_dual() && pseudohept(c) && !ishept(c)) xct6 = 2; + if(gp::on && has_nice_dual() && pseudohept(c) && !ishept(c)) xct6 = 2; bool error = false; @@ -4102,7 +4102,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { break; case laTrollheim: - if(!eoh && !whirl::whirl) + if(!eoh && !gp::on) qfloor_eswap(c, Vf, TROLLFLOOR, darkena(fcol, fd, 0xFF)); else qfloor_caves(c, Vf, darkena(fcol, fd, 0xFF), ct6, xct6); diff --git a/heptagon.cpp b/heptagon.cpp index 742197c8..3a2278c4 100644 --- a/heptagon.cpp +++ b/heptagon.cpp @@ -96,7 +96,7 @@ heptagon *buildHeptagon(heptagon *parent, int d, hstate s, int pard = 0, int fix if(pard == 0) { h->dm4 = parent->dm4+1; if(fixdistance != COMPUTE) h->distance = fixdistance; - else if(whirl::whirl) h->distance = parent->distance + whirl::param.first; + else if(gp::on) h->distance = parent->distance + gp::param.first; else if(nonbitrunc) h->distance = parent->distance + 1; else if(parent->s == hsOrigin) h->distance = parent->distance + 2; else if(S3 == 4) { @@ -129,7 +129,7 @@ heptagon *buildHeptagon(heptagon *parent, int d, hstate s, int pard = 0, int fix else h->distance = parent->distance + 2; } else { - h->distance = parent->distance - (whirl::whirl?whirl::param.first:nonbitrunc?1:2); + h->distance = parent->distance - (gp::on?gp::param.first:nonbitrunc?1:2); if(S3 == 4 && S7 == 5) { if(h->s == hsOrigin) { printf("had to cheat!\n"); diff --git a/hud.cpp b/hud.cpp index 6395928a..8db25182 100644 --- a/hud.cpp +++ b/hud.cpp @@ -348,7 +348,7 @@ void drawStats() { int d = celldistance(ac[i], cwt.c); if(d >= 0 && d < 64) qty[d]++; } - if(geometry == gNormal && !whirl::whirl) + if(geometry == gNormal && !gp::on) for(int i=nonbitrunc?6:8; i<=15; i++) qty[i] = nonbitrunc ? @@ -363,7 +363,7 @@ void drawStats() { dialog::addHelp("a(d+4) = a(d+3) + a(d+2) + a(d+1) - a(d)"); dialog::addInfo("a(d) ~ 1.72208ᵈ", forecolor); } - if(geometry == gNormal && nonbitrunc && !whirl::whirl) { + if(geometry == gNormal && nonbitrunc && !gp::on) { dialog::addBreak(200); dialog::addHelp("a(d+2) = 3a(d+1) - a(d+2)"); dialog::addInfo("a(d) ~ 2.61803ᵈ", forecolor); diff --git a/hyper.h b/hyper.h index ba5f9c8d..aed796b7 100644 --- a/hyper.h +++ b/hyper.h @@ -2953,9 +2953,9 @@ string XLAT(string x, stringpar p1, stringpar p2, stringpar p3); string XLAT(string x, stringpar p1, stringpar p2, stringpar p3, stringpar p4); string XLAT(string x, stringpar p1, stringpar p2, stringpar p3, stringpar p4, stringpar p5); -namespace whirl { +namespace gp { typedef pair loc; - extern bool whirl; + extern bool on; void compute_geometry(); void extend_map(cell *c, int d); extern ld scale; diff --git a/hypgraph.cpp b/hypgraph.cpp index 8e42f336..d3222e76 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -453,14 +453,14 @@ bool confusingGeometry() { } transmatrix actualV(const heptspin& hs, const transmatrix& V) { - return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7 + (nonbitrunc ? M_PI:0) + whirl::alpha) : V; + return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7 + (nonbitrunc ? M_PI:0) + gp::alpha) : V; } transmatrix applyspin(const heptspin& hs, const transmatrix& V) { return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7) : V; } -namespace whirl { +namespace gp { /* void drawrec(cell *c, const transmatrix& V) { @@ -476,7 +476,7 @@ void drawrec(cell *c, const transmatrix& V) { } } */ - void drawrec(cell *c, const transmatrix& V, whirl::loc at, int dir, int maindir) { + void drawrec(cell *c, const transmatrix& V, gp::loc at, int dir, int maindir) { if(dodrawcell(c)) { /* auto li = get_local_info(c); if(fix6(dir) != fix6(li.total_dir)) printf("totaldir %d/%d\n", dir, li.total_dir); @@ -501,7 +501,7 @@ void drawrec(cell *c, const transmatrix& V) { if(!c2) continue; if(c2->mov[0] != c) continue; if(c2 == c2->master->c7) continue; - drawrec(c2, V, whirl::loc(1,0), 3, i); + drawrec(c2, V, gp::loc(1,0), 3, i); } } } @@ -515,8 +515,8 @@ void drawrec(const heptspin& hs, int lev, hstate s, const transmatrix& V) { transmatrix V10; const transmatrix& V1 = hs.mirrored ? (V10 = V * Mirror) : V; - if(whirl::whirl) { - whirl::drawrec(c, actualV(hs, V1)); + if(gp::on) { + gp::drawrec(c, actualV(hs, V1)); } else if(dodrawcell(c)) { diff --git a/init.cpp b/init.cpp index 00126085..fcb7cb9f 100644 --- a/init.cpp +++ b/init.cpp @@ -388,8 +388,8 @@ void addMessage(string s, char spamtype = 0); #define S7 ginf[geometry].sides #define S3 ginf[geometry].vertex #define hyperbolic_not37 ((S7 > 7 || S3 > 3) && hyperbolic) -#define weirdhyperbolic ((S7 > 7 || S3 > 3 || whirl::whirl) && hyperbolic) -#define stdhyperbolic (S7 == 7 && S3 == 3 && !whirl::whirl) +#define weirdhyperbolic ((S7 > 7 || S3 > 3 || gp::on) && hyperbolic) +#define stdhyperbolic (S7 == 7 && S3 == 3 && !gp::on) #define cgclass (ginf[geometry].cclass) #define euclid (cgclass == gcEuclid) diff --git a/landgen.cpp b/landgen.cpp index 88200fc9..8e217bb6 100644 --- a/landgen.cpp +++ b/landgen.cpp @@ -1299,7 +1299,7 @@ void giantLandSwitch(cell *c, int d, cell *from) { case laHive: if(d == 9) { - if(hrand(2000) < (chaosmode ? 1000 : (nonbitrunc && !whirl::whirl) ?200:2) && !safety) + if(hrand(2000) < (chaosmode ? 1000 : (nonbitrunc && !gp::on) ?200:2) && !safety) hive::createBugArmy(c); if(hrand(2000) < 100 && !c->wall && !c->item && !c->monst) { int nww = 0; @@ -2084,11 +2084,11 @@ void giantLandSwitch(cell *c, int d, cell *from) { ONEMPTY { if(nonbitrunc && c->land == laCrossroads5 && hrand(100) < 60) c->wall = waBarrier; - else if(!ctof(c) && !inv::on && items[itShard] >= 10 && hrand(8000) < 120*orbcrossfun(items[itShard]) && !whirl::whirl) + else if(!ctof(c) && !inv::on && items[itShard] >= 10 && hrand(8000) < 120*orbcrossfun(items[itShard]) && !gp::on) c->wall = hrand(2) ? waMirror : waCloud; - else if(!ctof(c) && hyperstonesUnlocked() && hrand(8000) < 100 && !whirl::whirl) + else if(!ctof(c) && hyperstonesUnlocked() && hrand(8000) < 100 && !gp::on) c->wall = hrand(2) ? waMirror : waCloud; - else if(!ctof(c) && tactic::on && isCrossroads(tactic::lasttactic) && hrand(8000) < 120 && !whirl::whirl) + else if(!ctof(c) && tactic::on && isCrossroads(tactic::lasttactic) && hrand(8000) < 120 && !gp::on) c->wall = hrand(2) ? waMirror : waCloud; else if(c->land == laCrossroads4 && hrand(24000) < 10 && tactic::on) c->wall = waRose; diff --git a/menus.cpp b/menus.cpp index a280750b..b21349d7 100644 --- a/menus.cpp +++ b/menus.cpp @@ -807,7 +807,7 @@ void setAppropriateOverview() { pushScreen(yendor::showMenu); else if(peace::on) pushScreen(peace::showMenu); - else if((geometry != gNormal || whirl::whirl) && !chaosmode && !(geometry == gEuclid && isCrossroads(specialland)) && !(weirdhyperbolic && specialland == laCrossroads4)) { + else if((geometry != gNormal || gp::on) && !chaosmode && !(geometry == gEuclid && isCrossroads(specialland)) && !(weirdhyperbolic && specialland == laCrossroads4)) { runGeometryExperiments(); } else { diff --git a/orbgen.cpp b/orbgen.cpp index fe78bdbe..28700e71 100644 --- a/orbgen.cpp +++ b/orbgen.cpp @@ -381,7 +381,7 @@ ld orbcrossfun(int tr) { bool buildPrizeMirror(cell *c, int freq) { if(inv::on) return false; - if(whirl::whirl) return false; + if(gp::on) return false; if(c->type == 7 && !nonbitrunc) return false; if(items[itShard] < 25) return false; if(freq && hrand(freq * 100 / orbprizefun(items[itShard])) >= 100) diff --git a/pattern2.cpp b/pattern2.cpp index 66634b66..b07c8cb6 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -30,21 +30,21 @@ bool ishept(cell *c) { bool ishex1(cell *c) { // EUCLIDEAN if(euclid) return eupattern(c) == 1; - else if(whirl::whirl) return c->master->c7 != c && !pseudohept(c->mov[0]); + else if(gp::on) return c->master->c7 != c && !pseudohept(c->mov[0]); else return c->type != S6; } bool ishex2(cell *c) { // EUCLIDEAN if(euclid) return eupattern(c) == 1; - else if(whirl::whirl) return c->master->c7 != c && whirl::pseudohept_val(c) == 1; + else if(gp::on) return c->master->c7 != c && gp::pseudohept_val(c) == 1; else return c->type != S6; } int emeraldval(cell *c) { if(euclid) return eupattern(c); if(sphere) return 0; - if(ctof(c) || whirl::whirl) + if(ctof(c) || gp::on) return c->master->emeraldval >> 3; else { return emerald_hexagon( @@ -100,7 +100,7 @@ int cdist50(cell *c) { else return "012333321112322232222321123"[eufifty(c)] - '0'; } if(c->type != 6) return cdist50(fiftyval(c)); - if(whirl::whirl) return cdist50(c->master->c7); + if(gp::on) return cdist50(c->master->c7); int a0 = cdist50(createMov(c,0)); int a1 = cdist50(createMov(c,2)); int a2 = cdist50(createMov(c,4)); @@ -162,7 +162,7 @@ int fiftyval049(cell *c) { // printf("%d,%d: %d\n", allcodes[0], allcodes[1], allcodes[0] + 7); return allcodes[0] + 7; } - else if(whirl::whirl) return fiftyval049(c->master->c7); + else if(gp::on) return fiftyval049(c->master->c7); else if(sphere) return 0; else { int a[3], qa=0; @@ -323,7 +323,7 @@ int fieldval_uniq(cell *c) { auto p = cell_to_pair(c); return gmod(p.first * torusconfig::dx + p.second * torusconfig::dy, torusconfig::qty); } - if(ctof(c) || whirl::whirl) return c->master->fieldval/S7; + if(ctof(c) || gp::on) return c->master->fieldval/S7; else { int z = 0; for(int u=0; umaster->fiftyval >> 1) & 3; else si.id = 0; - if(nonbitrunc && !whirl::whirl) + if(nonbitrunc && !gp::on) si.id *= 4; else si.id += 4; @@ -565,12 +565,12 @@ namespace patterns { } else { int sp = c->spin(0); - if(whirl::whirl) { - sp = whirl::last_dir(c); + if(gp::on) { + sp = gp::last_dir(c); sp ^= ishex2(c); } si.id = 8 * ((c->master->fiftyval & 1) ^ (sp & 1)); - if(whirl::whirl && pseudohept(c)) si.id = 4; + if(gp::on && pseudohept(c)) si.id = 4; bool dock = false; for(int i=0; itype; i+=2) { int fiv = createMov(c, i)->master->fiftyval; @@ -583,14 +583,14 @@ namespace patterns { if(symRotation) si.symmetries = 2; si.id += 8; si.id %= 12; - if(whirl::whirl && pat == PAT_COLORING) + if(gp::on && pat == PAT_COLORING) for(int i=0; itype; i++) { cell *c2 = createMov(c, i); int id2 = 4; if(!pseudohept(c2)) { int sp2 = c2->spin(0); - if(whirl::whirl) { - sp2 = whirl::last_dir(c2); + if(gp::on) { + sp2 = gp::last_dir(c2); sp2 ^= ishex2(c2); } id2 = 8 * ((c2->master->fiftyval & 1) ^ (sp2 & 1)); @@ -650,7 +650,7 @@ namespace patterns { if(u == 8 && qhex == 2) u = 12; else if(u == 2 && qhex == 1) u = 8; else if(u == 6 && qhex == 2) u = 10; - if(whirl::whirl && pseudohept(c) && !ishept(c)) + if(gp::on && pseudohept(c) && !ishept(c)) u = 13; si.id = u; @@ -709,7 +709,7 @@ namespace patterns { val_all(c, si, 0, 0); // get id: - if((whirl::whirl? (S3==3) : !weirdhyperbolic) && isWarped(c)) + if((gp::on? (S3==3) : !weirdhyperbolic) && isWarped(c)) val_warped(c, si); else { si.id = ishept(c) ? 1 : 0; @@ -737,7 +737,7 @@ namespace patterns { } } - if(whirl::whirl && has_nice_dual() && !ishept(c) && ishex1(c)) si.dir = fix6(si.dir+3); + if(gp::on && has_nice_dual() && !ishept(c) && ishex1(c)) si.dir = fix6(si.dir+3); } char whichPattern = 0; @@ -945,7 +945,7 @@ int pattern_threecolor(cell *c) { if(a38) { patterns::patterninfo si; patterns::val38(c, si, nonbitrunc ? 0 : patterns::SPF_ROT, patterns::PAT_COLORING); - if(whirl::whirl && pseudohept(c)) return 0; + if(gp::on && pseudohept(c)) return 0; return si.id >> 2; } if(a46 && !nonbitrunc) { @@ -960,8 +960,8 @@ int pattern_threecolor(cell *c) { } if(S7 == 4 && S3 == 3) { int codesN[6] = {0,1,2,1,2,0}; - if(whirl::whirl) { - auto li = whirl::get_local_info(c); + if(gp::on) { + auto li = gp::get_local_info(c); int sp = (MODFIXER + li.relative.first + 2 * li.relative.second) % 3; if(sp != 0) { if(li.last_dir & 1) @@ -1009,7 +1009,7 @@ int pattern_threecolor(cell *c) { // in the 'pure heptagonal' tiling, returns true for a set of cells // which roughly corresponds to the heptagons in the normal tiling bool pseudohept(cell *c) { - if(whirl::whirl) return whirl::pseudohept_val(c) == 0; + if(gp::on) return gp::pseudohept_val(c) == 0; return pattern_threecolor(c) == 0; } @@ -1020,7 +1020,7 @@ bool warptype(cell *c) { else return c->master->distance & 1; } - else if(whirl::whirl) + else if(gp::on) return pseudohept(c); else return pattern_threecolor(c) == 0; @@ -1682,7 +1682,7 @@ namespace linepatterns { break; case patTriNet: - if(whirl::whirl) { + if(gp::on) { if(c->master->c7 != c) if(gmatrix.count(c->mov[0])) queueline(tC0(V), gmatrix[c->mov[0]]*C0, darkena(backcolor ^ 0xFFFFFF, 0, col), diff --git a/polygons.cpp b/polygons.cpp index 55f678cc..dbc6ff05 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -1098,7 +1098,7 @@ struct usershape { usershape *usershapes[USERSHAPEGROUPS][USERSHAPEIDS]; void drawTentacle(hpcshape &h, ld rad, ld var, ld divby) { - double tlength = max(crossf, hexhexdist * whirl::scale); + double tlength = max(crossf, hexhexdist * gp::scale); for(int i=0; i<=20; i++) hpcpush(ddi(S21, rad + var * sin(i * M_PI/divby)) * ddi(0, tlength * i/20.) * C0); for(int i=20; i>=0; i--) @@ -1215,9 +1215,9 @@ void bshape(hpcshape& sh, int p, double shzoom, int shapeid, double bonus = 0, f hpcpush(ipoint(0, 1)); } -void bshape_whirl(hpcshape sh[3], int p, double shzoom, int shapeid, double bonus = 0) { +void bshape_goldberg(hpcshape sh[3], int p, double shzoom, int shapeid, double bonus = 0) { ld bonus2 = bonus; - if(S7 == 8 && whirl::whirl) + if(S7 == 8 && gp::on) bonus2 += M_PI / 8, bonus += M_PI / 6 + .4; bshape(sh[1], p, shzoom, shapeid, bonus2); bshape(sh[2], p, shzoom * .8, shapeid, bonus + M_PI/S7 - (a38? .25 : .15), 1); @@ -1366,16 +1366,16 @@ void buildpolys() { {double x = hexvdist; bshape(shFullFloor[0], PPR_FLOOR); x *= bscale6; - x *= whirl::scale; - if(whirl::scale != 1) x *= 1.6; - // if(whirl::whirl::coords == whirl::euc_coord(2,0)) x /= 1.2; - // if(whirl::whirl::coords == whirl::euc_coord(3,0)) x /= 2; + x *= gp::scale; + if(gp::scale != 1) x *= 1.6; + // if(gp::gp::coords == gp::euc_coord(2,0)) x /= 1.2; + // if(gp::gp::coords == gp::euc_coord(3,0)) x /= 2; for(int t=0; t<=S6; t++) hpcpush(ddi(S7 + t*S14, x) * C0); x = rhexf; x *= bscale7; - x *= whirl::scale; - if(whirl::scale != 1) x *= 1.6; + x *= gp::scale; + if(gp::scale != 1) x *= 1.6; bshape(shFullFloor[1], PPR_FLOOR); for(int t=0; t<=S7; t++) hpcpush(ddi(t*S12+td, x) * C0); } @@ -1383,13 +1383,13 @@ void buildpolys() { {double x = hexvdist; bshape(shFullCross[0], PPR_FLOOR); x *= bscale6; - x *= whirl::scale; - if(whirl::scale != 1) x /= 2; + x *= gp::scale; + if(gp::scale != 1) x /= 2; for(int t=0; t<=S6; t++) { hpcpush(C0); if(t) hpcpush(ddi(S7 + t*S14, x) * C0); } x = rhexf; x *= bscale7; - x *= whirl::scale; + x *= gp::scale; bshape(shFullCross[1], PPR_FLOOR); for(int t=0; t<=S7; t++) { hpcpush(C0); if(t) hpcpush(ddi(t*S12+td, x) * C0); } } @@ -1404,7 +1404,7 @@ void buildpolys() { double floorrad1 = strict ? hcrossf : euclid ? shexf*fac80*spzoom : shexf*fac94; - double triangleside = hcrossf*.94 * (whirl::whirl ? 1.5 * whirl::scale : 1); + double triangleside = hcrossf*.94 * (gp::on ? 1.5 * gp::scale : 1); if(euclid4) { if(nonbitrunc) @@ -1626,7 +1626,7 @@ void buildpolys() { else if(a38) disksize *= 1.5; else if(nonbitrunc && S6 == 8) disksize *= 1.5; - if(a38 && whirl::whirl) disksize /= 2; + if(a38 && gp::on) disksize /= 2; bshape(shDisk, PPR_ITEM); for(int i=0; i<=S84; i+=S3) @@ -1844,11 +1844,11 @@ void buildpolys() { if(a46 && !nonbitrunc) spzoom6 *= .9; if(a47 && !nonbitrunc) spzoom6 *= .85; - ld whirlf = 1; + ld goldbf = 1; - if(whirl::scale != 1) whirlf = whirl::scale * 1.6; + if(gp::scale != 1) goldbf = gp::scale * 1.6; - ld whirlf2 = whirl::scale; + ld goldbf2 = gp::scale; double espzoom6 = spzoom6, espzoomd7 = spzoomd7; @@ -1874,9 +1874,9 @@ void buildpolys() { bshape(shCloudFloor[2], PPR_FLOOR, euclid ? scalef2 : scalef2*spzoom6*.9, 3); bshape(shCrossFloor[0], PPR_FLOOR, scalef*espzoom6*gsca(sphere,.9)*ffscale2, 5, ffspin2); - bshape_whirl(shCrossFloor, PPR_FLOOR, scalef*espzoomd7*gsca(sphere,.9)*ffscale2 * gsca(a47,1.3), 6, octroll); + bshape_goldberg(shCrossFloor, PPR_FLOOR, scalef*espzoomd7*gsca(sphere,.9)*ffscale2 * gsca(a47,1.3), 6, octroll); - double ntscale = gsca(nonbitrunc, gsca(a38, 1.4, a47, 2, a46, 1.525)) * whirl::scale; + double ntscale = gsca(nonbitrunc, gsca(a38, 1.4, a47, 2, a46, 1.525)) * gp::scale; double ntrot = grot(a46&&nonbitrunc, .25, a38&&nonbitrunc, -.2); bshape(shChargedFloor[0], PPR_FLOOR, scalef*espzoom6*gsca(sphere,.9)*ffscale2, 7, ffspin2); @@ -1885,34 +1885,34 @@ void buildpolys() { bshape(shChargedFloor[3], 12, spzoomd7 * gsca(a4 && euclid, .4, a4,1.2,sphere&&nonbitrunc,.9)* ntscale, 10, ntrot + grot(euclid4 && nonbitrunc, M_PI/4 + .1)); // nonbitrunc variant bshape(shSStarFloor[0], PPR_FLOOR, scalef*spzoom6*gsca(sphere,.8)*ffscale2, 11, grot(a4,.775)); - bshape_whirl(shSStarFloor, PPR_FLOOR, scalef*spzoomd7*gsca(a4,.85), 12, octroll); + bshape_goldberg(shSStarFloor, PPR_FLOOR, scalef*spzoomd7*gsca(a4,.85), 12, octroll); bshape(shOverFloor[0], PPR_FLOOR, scalef*spzoom * gsca(a47,1.3, a45,1.3, a46,1.1), 13, grot(a47,-.75, a45,-.7, a46,.9)); if(nonbitrunc) { - if(a4) bshape(shOverFloor[1], PPR_FLOOR, whirlf2, 368 + S7 - 5, 0); - else bshape(shOverFloor[1], PPR_FLOOR, whirlf2 * gsca(a38,1.3, sphere, .83), 14, octroll + grot(a38,.4)); + if(a4) bshape(shOverFloor[1], PPR_FLOOR, goldbf2, 368 + S7 - 5, 0); + else bshape(shOverFloor[1], PPR_FLOOR, goldbf2 * gsca(a38,1.3, sphere, .83), 14, octroll + grot(a38,.4)); } else bshape(shOverFloor[1], PPR_FLOOR, scalef*spzoom7, 15); bshape(shOverFloor[2], PPR_FLOOR, euclid?scalef*1.2:spzoom7, 16); bshape(shTriFloor[0], PPR_FLOOR, scalef*espzoom6*gsca(sphere,.9, a4,.9)*ffscale2, 17, ffspin2 + grot(a47,.1)); - bshape_whirl(shTriFloor, PPR_FLOOR, scalef*espzoomd7*ffscale2*gsca(a4,1.2, a47,1.5), 18, octroll + grot(a4,.25, a47,-.1, sphere4,.7) + grot(euclid&&a4, M_PI/8)); + bshape_goldberg(shTriFloor, PPR_FLOOR, scalef*espzoomd7*ffscale2*gsca(a4,1.2, a47,1.5), 18, octroll + grot(a4,.25, a47,-.1, sphere4,.7) + grot(euclid&&a4, M_PI/8)); bshape(shFeatherFloor[0], PPR_FLOOR, scalef*spzoom6*ffscale2, 19, ffspin2); if(nonbitrunc) bshape(shFeatherFloor[1], PPR_FLOOR, sphere ? .83 : gsca(ap4,1.1) * ntscale, 20, ntrot); else bshape(shFeatherFloor[1], PPR_FLOOR, scalef*spzoom7*gsca(sphere,1.1,a4,1.1)*ffscale2*ntscale, 21, sphere?1.3:ntrot); bshape(shFeatherFloor[2], PPR_FLOOR, scalef*1.1, 22); // Euclidean variant - bshape(shBarrowFloor[0], PPR_FLOOR, whirlf * gsca(euclid,.9) * spzoom6 * gsca(a467,1.7, a46,.8, a38,1.4) * gsca(euclid&&a4, .7), 23); - bshape(shBarrowFloor[1], PPR_FLOOR, whirlf * spzoomd7 * gsca(a4,1.15, a467,1.9, a46,.8, a38,1.5, sphere&&nonbitrunc,.9) * gsca(euclid&&a4, .5), 24, octroll - grot(a47,.1)); + bshape(shBarrowFloor[0], PPR_FLOOR, goldbf * gsca(euclid,.9) * spzoom6 * gsca(a467,1.7, a46,.8, a38,1.4) * gsca(euclid&&a4, .7), 23); + bshape(shBarrowFloor[1], PPR_FLOOR, goldbf * spzoomd7 * gsca(a4,1.15, a467,1.9, a46,.8, a38,1.5, sphere&&nonbitrunc,.9) * gsca(euclid&&a4, .5), 24, octroll - grot(a47,.1)); bshape(shBarrowFloor[2], PPR_FLOOR, ntscale*gsca(sphere||euclid,.9) * gsca(euclid&&a4&&nonbitrunc, .5), 25, ntrot + grot(euclid&&a4&&nonbitrunc, M_PI/4)); bshape(shNewFloor[0], PPR_FLOOR, scalef*espzoom6 * ffscale2, 26, ffspin2); - bshape_whirl(shNewFloor, PPR_FLOOR, scalef*espzoomd7 * ffscale2, 27, octroll); + bshape_goldberg(shNewFloor, PPR_FLOOR, scalef*espzoomd7 * ffscale2, 27, octroll); bshape(shTrollFloor[0], PPR_FLOOR, spzoom6*gsca(a38,1.4, a467,1.6, a46,.8), 28); bshape(shTrollFloor[1], PPR_FLOOR, spzoomd7*gsca(a38, 1.6, a467,2.4, a46,.8), 29, octroll); bshape(shButterflyFloor[0], PPR_FLOOR, scalef*espzoom6*gsca(sphere,.9)*ffscale2, 325, ffspin2); - bshape_whirl(shButterflyFloor, PPR_FLOOR, scalef*espzoomd7*ffscale2, 326, sphere?.7:0); + bshape_goldberg(shButterflyFloor, PPR_FLOOR, scalef*espzoomd7*ffscale2, 326, sphere?.7:0); bshape(shLavaFloor[0], PPR_FLOOR, scalef*espzoom6 * ffscale2, 359, ffspin2); - bshape_whirl(shLavaFloor, PPR_FLOOR, scalef*espzoomd7 * ffscale2 * gsca(a467,1.4), 360, octroll); + bshape_goldberg(shLavaFloor, PPR_FLOOR, scalef*espzoomd7 * ffscale2 * gsca(a467,1.4), 360, octroll); bshape(shHalfFloor[0], PPR_FLOOR, scalef*spzoom6, 329); bshape(shHalfFloor[1], PPR_FLOOR, scalef*spzoom6, 327); @@ -1927,7 +1927,7 @@ void buildpolys() { bshape(shCloudSeabed[1], PPR_FLOOR, scalef*spzoom6 * gsca(a46,.5, a47,.6, a38,1.25, a45,.35), 337, grot(a46,-.2, a38,.2)); bshape(shCloudSeabed[2], PPR_FLOOR, scalef*espzoom6, 337); bshape(shCaveSeabed[0], PPR_FLOOR, scalef*spzoom6 * gsca(a45,.65, a46,.7, a47,.675), 338); - bshape_whirl(shCaveSeabed, PPR_FLOOR, scalef*spzoom6 * gsca(a45,.5, a46,.6, a47,.725), 339, grot(a46,-.3)); + bshape_goldberg(shCaveSeabed, PPR_FLOOR, scalef*spzoom6 * gsca(a45,.5, a46,.6, a47,.725), 339, grot(a46,-.3)); bshape(shCaveSeabed[3], PPR_FLOOR, scalef*spzoom6 * gsca(euclid,1.2), 54); if(false) for(int i=0; i<8; i++) { @@ -1963,7 +1963,7 @@ void buildpolys() { bshape(shTriheptaEucShadow[1], PPR_FLOOR, scalef*SHADMUL, 43); bshape(shTriheptaEucShadow[2], PPR_FLOOR, scalef*SHADMUL, 44); bshape(shPalaceFloor[0], PPR_FLOOR, scalef*espzoom6*ffscale2, 45, grot(a4,.775)); - bshape_whirl(shPalaceFloor, PPR_FLOOR, scalef*espzoomd7*gsca(a4,.85), 46, grot(a46,-.3, a38, -.6) + grot(euclid&&a4, M_PI/4)); + bshape_goldberg(shPalaceFloor, PPR_FLOOR, scalef*espzoomd7*gsca(a4,.85), 46, grot(a46,-.3, a38, -.6) + grot(euclid&&a4, M_PI/4)); bshape(shMercuryBridge[0], PPR_FLOOR, scalef*spzoom6, 365); bshape(shMercuryBridge[1], PPR_FLOOR, scalef*spzoomd7, 366); @@ -1972,20 +1972,20 @@ void buildpolys() { bshape(shPalaceGate, PPR_STRUCT1, scalef, 47); bshape(shSemiFeatherFloor[0], PPR_FLOOR, scalef*spzoom6, 48); bshape(shSemiFeatherFloor[1], PPR_FLOOR, scalef*spzoom6, 49); - bshape_whirl(shDemonFloor, PPR_FLOOR, scalef*espzoomd7 * ffscale2 * gsca(ap4,1.6, sphere,.9), 50, grot(sphere,M_PI, a38, .2)); + bshape_goldberg(shDemonFloor, PPR_FLOOR, scalef*espzoomd7 * ffscale2 * gsca(ap4,1.6, sphere,.9), 50, grot(sphere,M_PI, a38, .2)); bshape(shDemonFloor[0], PPR_FLOOR, scalef*espzoom6*gsca(sphere,.9) * ffscale2, 51, ffspin2); bshape(shCaveFloor[0], PPR_FLOOR, scalef*spzoom6 * ffscale2, 52, ffspin2); - bshape_whirl(shCaveFloor, PPR_FLOOR, scalef*spzoomd7 * ffscale2 * gsca(sphere,.9, ap4,1.6), 53, octroll); + bshape_goldberg(shCaveFloor, PPR_FLOOR, scalef*spzoomd7 * ffscale2 * gsca(sphere,.9, ap4,1.6), 53, octroll); bshape(shCaveFloor[3], PPR_FLOOR, scalef*1.1, 54); // Euclidean variant bshape(shDesertFloor[0], PPR_FLOOR, scalef*espzoom6*ffscale6, 55, ffspin6); - bshape_whirl(shDesertFloor, PPR_FLOOR, scalef*espzoomd7*gsca(sphere,.9), 56, octroll+ffspin7); + bshape_goldberg(shDesertFloor, PPR_FLOOR, scalef*espzoomd7*gsca(sphere,.9), 56, octroll+ffspin7); for(int i=1; i<=3; i++) for(int j=0; j<3; j++) zoomShape(shDesertFloor[j], shRedRockFloor[i-1][j], 1 - .1 * i, PPR_FLOORa+i); bshape(shPowerFloor[0], PPR_FLOOR_DRAGON, scalef*espzoom6*gsca(sphere,.8)*ffscale2, 57, ffspin2); - bshape_whirl(shPowerFloor, PPR_FLOOR_DRAGON, scalef*espzoomd7*ffscale2, 58, octroll); - bshape(shRoseFloor[2], PPR_FLOOR, whirlf, 173); // nonbitrunc - bshape(shRoseFloor[0], PPR_FLOOR, whirlf * gsca(euclid,.9), 174); - bshape(shRoseFloor[1], PPR_FLOOR, whirlf * gsca(euclid,.9) * scalef * gsca(ap4,.85), 175, grot(ap4, M_PI/8)); + bshape_goldberg(shPowerFloor, PPR_FLOOR_DRAGON, scalef*espzoomd7*ffscale2, 58, octroll); + bshape(shRoseFloor[2], PPR_FLOOR, goldbf, 173); // nonbitrunc + bshape(shRoseFloor[0], PPR_FLOOR, goldbf * gsca(euclid,.9), 174); + bshape(shRoseFloor[1], PPR_FLOOR, goldbf * gsca(euclid,.9) * scalef * gsca(ap4,.85), 175, grot(ap4, M_PI/8)); bshape(shSwitchFloor[0], PPR_FLOOR, scalef*spzoom6*ffscale2, 377, ffspin2); bshape(shSwitchFloor[1], PPR_FLOOR, scalef*spzoomd7*ffscale2, 378, ffspin2); @@ -1993,8 +1993,8 @@ void buildpolys() { bshape(shSwitchDisk, PPR_FLOOR); for(int i=0; i<=S84; i+=S3) hpcpush(ddi(i, .06) * C0); - bshape(shTurtleFloor[0], PPR_FLOOR, whirlf * gsca(euclid,.9, sphere, .9*1.3, a4, 1.6, a38, 1.3, a467, 1.4) * gsca(euclid&&a4, .9), 176); - bshape(shTurtleFloor[1], PPR_FLOOR, whirlf * scalef * gsca(euclid,.9, a4, .9, a47,1.3) * gsca(euclid&&a4, .8), 177, octroll - grot(a47,.1)); + bshape(shTurtleFloor[0], PPR_FLOOR, goldbf * gsca(euclid,.9, sphere, .9*1.3, a4, 1.6, a38, 1.3, a467, 1.4) * gsca(euclid&&a4, .9), 176); + bshape(shTurtleFloor[1], PPR_FLOOR, goldbf * scalef * gsca(euclid,.9, a4, .9, a47,1.3) * gsca(euclid&&a4, .8), 177, octroll - grot(a47,.1)); bshape(shTurtleFloor[2], PPR_FLOOR, ntscale * gsca(sphere && nonbitrunc, .9) * gsca(euclid&&a4&&nonbitrunc, .5), 178, ntrot + grot(euclid&&a4&&nonbitrunc, M_PI/4)); // nonbitrunc bshape(shDragonFloor[0], PPR_FLOOR_DRAGON, gsca(a4,1.6, a38, 1.3) * gsca(euclid&&a4, .5), 181, ffspin2); @@ -2063,17 +2063,17 @@ void buildpolys() { bshape(shWormTail, PPR_TENTACLE1, scalef, 383); bshape(shSmallWormTail, PPR_TENTACLE1, scalef, 384); - if(nonbitrunc) bshape(shDragonSegment, PPR_TENTACLE1, whirl::scale, 233); + if(nonbitrunc) bshape(shDragonSegment, PPR_TENTACLE1, gp::scale, 233); else bshape(shDragonSegment, PPR_TENTACLE1, scalef, 234); bshape(shDragonWings, PPR_ONTENTACLE, scalef, 237); bshape(shDragonLegs, PPR_TENTACLE0, scalef, 238); - if(nonbitrunc) bshape(shDragonTail, PPR_TENTACLE1, whirl::scale, 239); + if(nonbitrunc) bshape(shDragonTail, PPR_TENTACLE1, gp::scale, 239); else bshape(shDragonTail, PPR_TENTACLE1, scalef, 240); bshape(shDragonNostril, PPR_ONTENTACLE_EYES, scalef, 241); bshape(shDragonHead, PPR_ONTENTACLE, scalef, 242); - if(nonbitrunc) bshape(shSeaTentacle, PPR_TENTACLE1, whirl::scale, 245); + if(nonbitrunc) bshape(shSeaTentacle, PPR_TENTACLE1, gp::scale, 245); else bshape(shSeaTentacle, PPR_TENTACLE1, 1, 246); - ld ksc = (nonbitrunc ? 1.8 : 1.5) * whirl::scale; + ld ksc = (nonbitrunc ? 1.8 : 1.5) * gp::scale; bshape(shKrakenHead, PPR_ONTENTACLE, ksc, 247); bshape(shKrakenEye, PPR_ONTENTACLE_EYES, ksc, 248); bshape(shKrakenEye2, PPR_ONTENTACLE_EYES2, ksc, 249); @@ -2304,10 +2304,10 @@ void buildpolys() { for(int v=0; v<13; v++) for(int z=0; z<2; z++) copyshape(shTortoise[v][4+z], shTortoise[v][2+z], shTortoise[v][2+z].prio + (PPR_CARRIED-PPR_ITEM)); - if(nonbitrunc) bshape(shMagicSword, PPR_MAGICSWORD, whirl::scale, 243); + if(nonbitrunc) bshape(shMagicSword, PPR_MAGICSWORD, gp::scale, 243); else bshape(shMagicSword, PPR_MAGICSWORD, 1, 244); - if(nonbitrunc) bshape(shMagicShovel, PPR_MAGICSWORD, whirl::scale, 333); + if(nonbitrunc) bshape(shMagicShovel, PPR_MAGICSWORD, gp::scale, 333); else bshape(shMagicShovel, PPR_MAGICSWORD, 1, 333); bshape(shBead0, 20, 1, 250); @@ -3520,7 +3520,7 @@ NEWSHAPE /* floors */ // need eswap -#define nbtplain (nonbitrunc && !whirl::whirl) +#define nbtplain (nonbitrunc && !gp::on) #define nbtnice (!has_nice_dual()) diff --git a/shmup.cpp b/shmup.cpp index ca62b810..09e46164 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -3388,9 +3388,9 @@ transmatrix calc_relative_matrix_help(cell *c, heptagon *h1) { transmatrix gm = Id; heptagon *h2 = c->master; transmatrix where = Id; - if(whirl::whirl && c != c->master->c7) { - auto li = whirl::get_local_info(c); - where = whirl::Tf[li.last_dir][li.relative.first&31][li.relative.second&31][fix6(li.total_dir)]; + if(gp::on && c != c->master->c7) { + auto li = gp::get_local_info(c); + where = gp::Tf[li.last_dir][li.relative.first&31][li.relative.second&31][fix6(li.total_dir)]; } else if(!nonbitrunc) for(int d=0; dc7->mov[d] == c) where = hexmove[d]; diff --git a/system.cpp b/system.cpp index 8f87e86f..e07cafd1 100644 --- a/system.cpp +++ b/system.cpp @@ -102,7 +102,7 @@ void initgame() { if(isGravityLand(firstland) && !tactic::on) firstland = weirdhyperbolic ? laCrossroads4 : laCrossroads; cwt.c = currentmap->gamestart(); cwt.spin = 0; cwt.mirrored = false; - cwt.c->land = ((geometry || whirl::whirl) && !safety) ? specialland : firstland; + cwt.c->land = ((geometry || gp::on) && !safety) ? specialland : firstland; chaosAchieved = false; @@ -1110,7 +1110,7 @@ void restartGame(char switchWhat, bool push, bool keep_screens) { if(switchWhat == '7' || switchWhat == 'w') { if(euclid6) geometry = gNormal; nonbitrunc = !nonbitrunc; - whirl::whirl = (switchWhat == 'w'); + gp::on = (switchWhat == 'w'); resetGeometry(); #if CAP_TEXTURE if(texture::config.tstate == texture::tsActive) @@ -1124,7 +1124,7 @@ void restartGame(char switchWhat, bool push, bool keep_screens) { else geometry = targetgeometry; if(chaosmode && (euclid || sphere || quotient)) chaosmode = false; if(nonbitrunc && euclid6) nonbitrunc = false; - if(whirl::whirl && (S3 != 3 || elliptic)) whirl::whirl = false; + if(gp::on && (S3 != 3 || elliptic)) gp::on = false; resetGeometry(); #if CAP_TEXTURE diff --git a/textures.cpp b/textures.cpp index 882230fd..769f2c0c 100644 --- a/textures.cpp +++ b/textures.cpp @@ -264,10 +264,10 @@ int getTriangleID(cell *c, patterns::patterninfo& si, hyperpoint h) { return best; } -int whirlcode(cell *c, const patterns::patterninfo& si) { - if(!whirl::whirl) return 0; +int goldbergcode(cell *c, const patterns::patterninfo& si) { + if(!gp::on) return 0; else if(c == c->master->c7) return (fixdir(si.dir, c) << 8); - else return (get_code(whirl::get_local_info(c)) << 16) | (fixdir(si.dir, c) << 8); + else return (get_code(gp::get_local_info(c)) << 16) | (fixdir(si.dir, c) << 8); } void mapTexture(cell *c, textureinfo& mi, patterns::patterninfo &si, const transmatrix& T, int shift = 0) { @@ -275,15 +275,15 @@ void mapTexture(cell *c, textureinfo& mi, patterns::patterninfo &si, const trans mi.symmetries = si.symmetries; mi.current_type = c->type; - if(whirl::whirl) { + if(gp::on) { mi.M = T; mi.triangles.clear(); for(int i=0; itype; i++) { int d = si.dir; int i0 = fixdir(i + d + 0, c); int i1 = fixdir(i + d + 1, c); - hyperpoint h1 = whirl::get_corner_position(c, i0); - hyperpoint h2 = whirl::get_corner_position(c, i1); + hyperpoint h1 = gp::get_corner_position(c, i0); + hyperpoint h2 = gp::get_corner_position(c, i1); mi.triangles.emplace_back(make_array(C0, h1, h2), make_array(mi.M*C0, mi.M*h1, mi.M*h2)); } } @@ -331,9 +331,9 @@ bool texture_config::apply(cell *c, const transmatrix &V, int col) { return false; } try { - auto& mi = texture_map.at(si.id + whirlcode(c, si)); + auto& mi = texture_map.at(si.id + goldbergcode(c, si)); - qfi.spin = whirl::whirl ? Id : applyPatterndir(c, si); + qfi.spin = gp::on ? Id : applyPatterndir(c, si); int n = mi.vertices.size(); @@ -351,7 +351,7 @@ bool texture_config::apply(cell *c, const transmatrix &V, int col) { } lastptd().u.poly.tinf = &mi; - if(whirl::whirl) + if(gp::on) lastptd().u.poly.flags = POLY_INVERSE; if(grid_color) { queuepolyat(V, shFullFloor[ctof(c)], 0, PPR_FLOOR); @@ -383,7 +383,7 @@ bool texture_config::apply(cell *c, const transmatrix &V, int col) { return true; } catch(out_of_range) { - // printf("Ignoring tile #%d / %08x: not mapped\n", si.id, whirlcode(c, si)); + // printf("Ignoring tile #%d / %08x: not mapped\n", si.id, goldbergcode(c, si)); return false; } } @@ -426,7 +426,7 @@ void texture_config::perform_mapping() { // int sgn = sphere ? -1 : 1; - si.id += whirlcode(c, si); + si.id += goldbergcode(c, si); if(!texture_map.count(si.id)) replace = true; @@ -1403,7 +1403,7 @@ void texture_config::remap(eTextureState old_tstate, eTextureState old_tstate_ma auto si = patterns::getpatterninfo0(c); int oldid = si.id; - si.id += whirlcode(c, si); + si.id += goldbergcode(c, si); if(texture_map.count(si.id)) continue;