diff --git a/blizzard.cpp b/blizzard.cpp index ca39147c..88aba928 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 : (c->type == 6 && (i&1)) ? hexhexdist : crossf; + return nonbitrunc ? tessf * whirl::scale : (c->type == 6 && (i&1)) ? hexhexdist : crossf; } transmatrix cellrelmatrix(cell *c, int i) { diff --git a/cell.cpp b/cell.cpp index 6fd369a3..2ced5827 100644 --- a/cell.cpp +++ b/cell.cpp @@ -739,6 +739,13 @@ cell *createMov(cell *c, int d) { } if(c->mov[d]) return c->mov[d]; + else if(nonbitrunc && whirl::whirl) { + whirl::extend_map(c, d); + if(!c->mov[d]) { + printf("extend failed to create for %p/%d\n", c, d); + exit(1); + } + } else if(nonbitrunc) { heptagon *h2 = createStep(c->master, d); merge(c,d,h2->c7,c->master->spin(d),false); @@ -928,6 +935,7 @@ void verifycell(cell *c) { } void verifycells(heptagon *at) { + if(whirl::whirl) 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)]); } @@ -1343,10 +1351,11 @@ int celldistance(cell *c1, cell *c2) { return eudist(decodeId(c1->master) - decodeId(c2->master)); } - if(sphere || quotient == 1) { + if(sphere || quotient == 1 || whirl::whirl) { celllister cl(c1, 64, 1000, c2); for(int i=0; itype; l++) v.push_back(getId(createMov(c, l))); + if(whirl::whirl) + for(int l=0; lmaster, l)->c7)); + else + for(int l=0; ltype; l++) v.push_back(getId(createMov(c, l))); } int N = size(samples); diff --git a/geom-exp.cpp b/geom-exp.cpp index d8d4e519..816d53c6 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; @@ -244,7 +244,6 @@ double hexshiftat(cell *c) { return 0; } - transmatrix ddspin(cell *c, int d, int bonus) { int hdir = displaydir(c, d) + bonus; double ha = hexshiftat(c); @@ -252,7 +251,7 @@ transmatrix ddspin(cell *c, int d, int bonus) { return getspinmatrix(hdir); } -transmatrix iddspin(cell *c, int d, int bonus = 0) { +transmatrix iddspin(cell *c, int d, int bonus) { int hdir = displaydir(c, d) + bonus; double ha = hexshiftat(c); if(ha) return spin(ha) * getspinmatrix(-hdir); @@ -291,11 +290,11 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) { if(!euclid) for(int a=0; amondir, S42); - if(weirdhyperbolic || sphere) Vb = Vb * xpush(-(hexhexdist - hcrossf7)); - if(ctof(c) && !euclid) Vb = Vb * xpush(hexhexdist - hcrossf); + if(whirl::whirl) Vb = Vb * xpush(crossf * .6); + else { + if(weirdhyperbolic || sphere) Vb = Vb * xpush(-(hexhexdist - hcrossf7)); + if(ctof(c) && !euclid) Vb = Vb * xpush(hexhexdist - hcrossf); + } return drawMonsterTypeDH(m, c, Vb, col, darkhistory, footphase); } diff --git a/hud.cpp b/hud.cpp index a6efee83..6395928a 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) + if(geometry == gNormal && !whirl::whirl) 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) { + if(geometry == gNormal && nonbitrunc && !whirl::whirl) { 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 bb898068..dd410e7a 100644 --- a/hyper.h +++ b/hyper.h @@ -1804,6 +1804,7 @@ namespace linepatterns { }; transmatrix ddspin(cell *c, int d, int bonus = 0); +transmatrix iddspin(cell *c, int d, int bonus = 0); bool doexiton(int sym, int uni); void switchFullscreen(); string turnstring(int i); @@ -2940,3 +2941,16 @@ string XLAT(string x, stringpar p1, stringpar p2); 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 { + extern bool whirl; + void compute_geometry(); + void extend_map(cell *c, int d); + } + +int get_sightrange(); +int gamerange(); + +int numplayers(); + +extern int base_distlimit; diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 225128ed..385ea8dd 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -322,6 +322,11 @@ transmatrix spintox(const hyperpoint& H) { return T; } +void set_column(transmatrix& T, int i, const hyperpoint& H) { + for(int j=0; j<3; j++) + T[j][i] = H[j]; + } + // reverse of spintox(H) transmatrix rspintox(const hyperpoint& H) { transmatrix T = Id; diff --git a/hypgraph.cpp b/hypgraph.cpp index ef7ac43c..81d25780 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -453,9 +453,78 @@ 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)) : V; + return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7 + (nonbitrunc ? M_PI:0) + whirl::alpha) : V; } +namespace whirl { + +/* +void drawrec(cell *c, const transmatrix& V) { + if(dodrawcell(c)) + drawcell(c, V, 0, false); + for(int i=0; itype; i++) { + cell *c2 = c->mov[i]; + if(!c2) continue; + if(c2->mov[0] != c) continue; + if(c2 == c2->master->c7) continue; + transmatrix V1 = V * ddspin(c, i) * xpush(crossf) * iddspin(c2, 0) * spin(M_PI); + drawrec(c2, V1); + } + } */ + + hyperpoint atz(const transmatrix& T, loc at) { + int sp = 0; + while(at.first < 0 || at.second < 0) + at = at * eudir(1), sp++; + if(sp>3) sp -= 6; + + hyperpoint h = spin(2*M_PI*sp/S7) * T * hpxyz(at.first, at.second, 1); + h = mid(h,h); + return h; + } + + void drawrec(cell *c, const transmatrix& V, const transmatrix& T, whirl::loc at, int dir) { + if(dodrawcell(c)) { + hyperpoint h = atz(T, at); + hyperpoint hl = atz(T, at + eudir(dir)); + + transmatrix T1 = V * rgpushxto0(h) * rspintox(gpushxto0(h) * hl) * spin(M_PI); + drawcell(c, T1, 0, false); + } + for(int i=0; itype; i++) { + cell *c2 = c->mov[i]; + if(!c2) continue; + if(c2->mov[0] != c) continue; + if(c2 == c2->master->c7) continue; + drawrec(c2, V, T, at + eudir(dir+i), dir + i + 3); + } + } + + void drawrec(cell *c, const transmatrix& V) { + if(dodrawcell(c)) + drawcell(c, V, 0, false); + for(int i=0; itype; i++) { + cell *c2 = c->mov[i]; + if(!c2) continue; + if(c2->mov[0] != c) continue; + if(c2 == c2->master->c7) continue; + transmatrix T; + set_column(T, 0, C0); + set_column(T, 1, ddspin(c, i) * xpush(tessf) * C0); + set_column(T, 2, ddspin(c, i+1) * xpush(tessf) * C0); + transmatrix corners; + set_column(corners, 0, hpxyz(0, 0, 1)); + set_column(corners, 1, hpxyz(whirl::param.first, whirl::param.second, 1)); + loc nx = param * loc(0,1); + set_column(corners, 2, hpxyz(nx.first, nx.second, 1)); + // corners * e[i] = corner[i] + T = T * inverse(corners); + + drawrec(c2, V, T, whirl::loc(1,0), 3); + } + } + } + void drawrec(const heptspin& hs, int lev, hstate s, const transmatrix& V) { // shmup::calc_relative_matrix(cwt.c, hs.h); @@ -465,9 +534,14 @@ void drawrec(const heptspin& hs, int lev, hstate s, const transmatrix& V) { transmatrix V10; const transmatrix& V1 = hs.mirrored ? (V10 = V * Mirror) : V; - if(dodrawcell(c)) { + if(whirl::whirl) { + whirl::drawrec(c, actualV(hs, V1)); + } + + else if(dodrawcell(c)) { reclevel = maxreclevel - lev; - drawcell(c, actualV(hs, V1), 0, hs.mirrored); + transmatrix V2 = actualV(hs, V1); + drawcell(c, V2, 0, hs.mirrored); } if(lev <= 0) return; diff --git a/init.cpp b/init.cpp index cf357f1a..de9ddad0 100644 --- a/init.cpp +++ b/init.cpp @@ -387,8 +387,8 @@ void addMessage(string s, char spamtype = 0); #define ALPHA (M_PI*2/S7) #define S7 ginf[geometry].sides #define S3 ginf[geometry].vertex -#define weirdhyperbolic ((S7 > 7 || S3 > 3) && hyperbolic) -#define stdhyperbolic (S7 == 7 && S3 == 3) +#define weirdhyperbolic ((S7 > 7 || S3 > 3 || whirl::whirl) && hyperbolic) +#define stdhyperbolic (S7 == 7 && S3 == 3 && !whirl::whirl) #define cgclass (ginf[geometry].cclass) #define euclid (cgclass == gcEuclid) diff --git a/landgen.cpp b/landgen.cpp index 6126b1f0..71f34696 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?200:2) && !safety) + if(hrand(2000) < (chaosmode ? 1000 : (nonbitrunc && !whirl::whirl) ?200:2) && !safety) hive::createBugArmy(c); if(hrand(2000) < 100 && !c->wall && !c->item && !c->monst) { int nww = 0; diff --git a/menus.cpp b/menus.cpp index 7e19e5d7..a280750b 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 && !chaosmode && !(geometry == gEuclid && isCrossroads(specialland)) && !(weirdhyperbolic && specialland == laCrossroads4)) { + else if((geometry != gNormal || whirl::whirl) && !chaosmode && !(geometry == gEuclid && isCrossroads(specialland)) && !(weirdhyperbolic && specialland == laCrossroads4)) { runGeometryExperiments(); } else { diff --git a/pattern2.cpp b/pattern2.cpp index 5503748f..e9d3ce3e 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -36,7 +36,7 @@ bool ishex1(cell *c) { int emeraldval(cell *c) { if(euclid) return eupattern(c); if(sphere) return 0; - if(ctof(c)) + if(ctof(c) || whirl::whirl) return c->master->emeraldval >> 3; else { return emerald_hexagon( @@ -92,6 +92,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); int a0 = cdist50(createMov(c,0)); int a1 = cdist50(createMov(c,2)); int a2 = cdist50(createMov(c,4)); @@ -313,7 +314,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)) return c->master->fieldval/S7; + if(ctof(c) || whirl::whirl) return c->master->fieldval/S7; else { int z = 0; for(int u=0; u c) if(gmatrix.count(c2)) if(celldist(c) != celldist(c2)) { - queueline(tC0(V), gmatrix[c2]*C0, - darkena(backcolor ^ 0xFFFFFF, 0, col), - 2); + if(whirl::whirl) { + if(c->master->c7 != c) if(gmatrix.count(c->mov[0])) + queueline(tC0(V), gmatrix[c->mov[0]]*C0, + darkena(backcolor ^ 0xFFFFFF, 0, col), + 2); + } + else { + forCellEx(c2, c) if(c2 > c) if(gmatrix.count(c2)) if(celldist(c) != celldist(c2)) { + queueline(tC0(V), gmatrix[c2]*C0, + darkena(backcolor ^ 0xFFFFFF, 0, col), + 2); + } } break; diff --git a/polygons.cpp b/polygons.cpp index 378c1410..903391b4 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -1094,7 +1094,7 @@ struct usershape { usershape *usershapes[USERSHAPEGROUPS][USERSHAPEIDS]; void drawTentacle(hpcshape &h, ld rad, ld var, ld divby) { - double tlength = max(crossf, hexhexdist); + double tlength = max(crossf, hexhexdist * whirl::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--) @@ -1345,10 +1345,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; 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; bshape(shFullFloor[1], PPR_FLOOR); for(int t=0; t<=S7; t++) hpcpush(ddi(t*S12+td, x) * C0); } @@ -1356,10 +1362,13 @@ void buildpolys() { {double x = hexvdist; bshape(shFullCross[0], PPR_FLOOR); x *= bscale6; + x *= whirl::scale; + if(whirl::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; bshape(shFullCross[1], PPR_FLOOR); for(int t=0; t<=S7; t++) { hpcpush(C0); if(t) hpcpush(ddi(t*S12+td, x) * C0); } } @@ -1593,6 +1602,8 @@ void buildpolys() { if(nonbitrunc && a38) disksize *= 2; else if(a38) disksize *= 1.5; else if(nonbitrunc && S6 == 8) disksize *= 1.5; + + if(a38 && whirl::whirl) disksize /= 2; bshape(shDisk, PPR_ITEM); for(int i=0; i<=S84; i+=S3) @@ -1810,6 +1821,12 @@ void buildpolys() { if(a46 && !nonbitrunc) spzoom6 *= .9; if(a47 && !nonbitrunc) spzoom6 *= .85; + ld whirlf = 1; + + if(whirl::scale != 1) whirlf = whirl::scale * 1.6; + + ld whirlf2 = whirl::scale; + double espzoom6 = spzoom6, espzoomd7 = spzoomd7; // if(euclid) espzoom6 *= 1.5, espzoomd7 *= 1.2; @@ -1836,7 +1853,7 @@ void buildpolys() { bshape(shCrossFloor[0], PPR_FLOOR, scalef*espzoom6*gsca(sphere,.9)*ffscale2, 5, ffspin2); bshape(shCrossFloor[1], 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)); + double ntscale = gsca(nonbitrunc, gsca(a38, 1.4, a47, 2, a46, 1.525)) * whirl::scale; double ntrot = grot(a46&&nonbitrunc, .25, a38&&nonbitrunc, -.2); bshape(shChargedFloor[0], PPR_FLOOR, scalef*espzoom6*gsca(sphere,.9)*ffscale2, 7, ffspin2); @@ -1848,8 +1865,8 @@ void buildpolys() { bshape(shSStarFloor[1], 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, 1, 368 + S7 - 5, 0); - else bshape(shOverFloor[1], PPR_FLOOR, gsca(a38,1.3, sphere, .83), 14, octroll + grot(a38,.4)); + 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)); } else bshape(shOverFloor[1], PPR_FLOOR, scalef*spzoom7, 15); bshape(shOverFloor[2], PPR_FLOOR, euclid?scalef*1.2:spzoom7, 16); @@ -1859,8 +1876,8 @@ void buildpolys() { 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, gsca(euclid,.9) * spzoom6 * gsca(a467,1.7, a46,.8, a38,1.4) * gsca(euclid&&a4, .7), 23); - bshape(shBarrowFloor[1], PPR_FLOOR, 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, 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[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(shNewFloor[1], PPR_FLOOR, scalef*espzoomd7 * ffscale2, 27, octroll); @@ -1949,12 +1966,12 @@ void buildpolys() { bshape(shSwitchFloor[0], PPR_FLOOR, scalef*spzoom6*ffscale2, 377, ffspin2); bshape(shSwitchFloor[1], PPR_FLOOR, scalef*spzoomd7*ffscale2, 378, ffspin2); - bshape(shSwitchFloor[2], PPR_FLOOR, euclid?scalef*1.2:spzoom7, 379, ffspin2); + bshape(shSwitchFloor[2], PPR_FLOOR, euclid?scalef*1.2:scalef*spzoom7, 379, ffspin2); bshape(shSwitchDisk, PPR_FLOOR); for(int i=0; i<=S84; i+=S3) hpcpush(ddi(i, .06) * C0); - bshape(shTurtleFloor[0], PPR_FLOOR, 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, scalef * gsca(euclid,.9, a4, .9, a47,1.3) * gsca(euclid&&a4, .8), 177, octroll - grot(a47,.1)); + 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[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); @@ -2023,17 +2040,17 @@ void buildpolys() { bshape(shWormTail, PPR_TENTACLE1, scalef, 383); bshape(shSmallWormTail, PPR_TENTACLE1, scalef, 384); - if(nonbitrunc) bshape(shDragonSegment, PPR_TENTACLE1, 1, 233); + if(nonbitrunc) bshape(shDragonSegment, PPR_TENTACLE1, whirl::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, 1, 239); + if(nonbitrunc) bshape(shDragonTail, PPR_TENTACLE1, whirl::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, 1, 245); + if(nonbitrunc) bshape(shSeaTentacle, PPR_TENTACLE1, whirl::scale, 245); else bshape(shSeaTentacle, PPR_TENTACLE1, 1, 246); - ld ksc = nonbitrunc ? 1.8 : 1.5; + ld ksc = (nonbitrunc ? 1.8 : 1.5) * whirl::scale; bshape(shKrakenHead, PPR_ONTENTACLE, ksc, 247); bshape(shKrakenEye, PPR_ONTENTACLE_EYES, ksc, 248); bshape(shKrakenEye2, PPR_ONTENTACLE_EYES2, ksc, 249); @@ -2264,10 +2281,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, 1, 243); + if(nonbitrunc) bshape(shMagicSword, PPR_MAGICSWORD, whirl::scale, 243); else bshape(shMagicSword, PPR_MAGICSWORD, 1, 244); - if(nonbitrunc) bshape(shMagicShovel, PPR_MAGICSWORD, 1, 333); + if(nonbitrunc) bshape(shMagicShovel, PPR_MAGICSWORD, whirl::scale, 333); else bshape(shMagicShovel, PPR_MAGICSWORD, 1, 333); bshape(shBead0, 20, 1, 250); @@ -3486,6 +3503,8 @@ NEWSHAPE /* floors */ // need eswap +#define nbtplain (nonbitrunc && !whirl::whirl) + #define DESERTFLOOR (nonbitrunc ? shCloudFloor : shDesertFloor)[ct6] #define BUTTERFLYFLOOR (nonbitrunc ? shFloor : shButterflyFloor)[ct6] #define PALACEFLOOR (nonbitrunc?shFloor:shPalaceFloor)[ct6] @@ -3496,10 +3515,10 @@ NEWSHAPE #define NEWFLOOR (nonbitrunc ? shCloudFloor : shNewFloor)[ct6] #define CROSSFLOOR (nonbitrunc ? shFloor : shCrossFloor)[ct6] #define TROLLFLOOR shTrollFloor[ct6] -#define BARROWFLOOR shBarrowFloor[(euclid&&!a4)?0:nonbitrunc?2:ct6] +#define BARROWFLOOR shBarrowFloor[(euclid&&!a4)?0:nbtplain?2:ct6] #define LAVAFLOOR (nonbitrunc ? shFloor : shLavaFloor)[ct6] #define TRIFLOOR ((nonbitrunc ? shFloor : shTriFloor)[ct6]) -#define TURTLEFLOOR shTurtleFloor[nonbitrunc ? 2 : ct6] +#define TURTLEFLOOR shTurtleFloor[nbtplain ? 2 : ct6] #define ROSEFLOOR shRoseFloor[ct6] #define ECT ((euclid&&!a4)?2:ct6) @@ -3515,7 +3534,7 @@ NEWSHAPE #define MFLOOR2 shMFloor2[ct6] #define STARFLOOR shStarFloor[ECT] #define DRAGONFLOOR shDragonFloor[ECT] -#define SWITCHFLOOR shSwitchFloor[nonbitrunc?2:ct6] +#define SWITCHFLOOR shSwitchFloor[nbtplain?2:ct6] // fix Warp // fix Kraken diff --git a/system.cpp b/system.cpp index 14e07fc6..459695e2 100644 --- a/system.cpp +++ b/system.cpp @@ -102,7 +102,7 @@ void initgame() { if(isGravityLand(firstland) && !tactic::on) firstland = laCrossroads; cwt.c = currentmap->gamestart(); cwt.spin = 0; cwt.mirrored = false; - cwt.c->land = (geometry && !safety) ? specialland : firstland; + cwt.c->land = ((geometry || whirl::whirl) && !safety) ? specialland : firstland; chaosAchieved = false; @@ -1107,9 +1107,10 @@ void restartGame(char switchWhat, bool push, bool keep_screens) { tour::on = !tour::on; } #endif - if(switchWhat == '7') { + if(switchWhat == '7' || switchWhat == 'w') { if(euclid6) geometry = gNormal; nonbitrunc = !nonbitrunc; + whirl::whirl = (switchWhat == 'w'); resetGeometry(); #if CAP_TEXTURE if(texture::config.tstate == texture::tsActive) @@ -1123,6 +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; resetGeometry(); #if CAP_TEXTURE