1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-06-27 07:22:51 +00:00

removed 'stdeuclid' and using 'masterless' since it was too similar to 'stdeuc'

This commit is contained in:
Zeno Rogue 2018-08-18 17:35:39 +02:00
parent 682f804576
commit a92cc33426
4 changed files with 25 additions and 26 deletions

View File

@ -987,7 +987,7 @@ void verifycell(cell *c) {
for(int i=0; i<t; i++) { for(int i=0; i<t; i++) {
cell *c2 = c->move(i); cell *c2 = c->move(i);
if(c2) { if(c2) {
if(!stdeuclid && !nonbitrunc && c == c->master->c7) verifycell(c2); if(!masterless && !nonbitrunc && c == c->master->c7) verifycell(c2);
if(c2->move(c->c.spin(i)) && c2->move(c->c.spin(i)) != c) { if(c2->move(c->c.spin(i)) && c2->move(c->c.spin(i)) != c) {
printf("cell error %p:%d [%d] %p:%d [%d]\n", c, i, c->type, c2, c->c.spin(i), c2->type); printf("cell error %p:%d [%d] %p:%d [%d]\n", c, i, c->type, c2, c->c.spin(i), c2->type);
exit(1); exit(1);
@ -1061,7 +1061,7 @@ int celldist(cell *c) {
int euclidAlt(short x, short y); int euclidAlt(short x, short y);
int celldistAlt(cell *c) { int celldistAlt(cell *c) {
if(stdeuclid) { if(masterless) {
if(torus) return celldist(c); if(torus) return celldist(c);
int x, y; int x, y;
tie(x,y) = vec_to_pair(decodeId(c->master)); tie(x,y) = vec_to_pair(decodeId(c->master));
@ -1375,7 +1375,7 @@ cdata *getEuclidCdata(int h) {
} }
int getCdata(cell *c, int j) { int getCdata(cell *c, int j) {
if(stdeuclid) return getEuclidCdata(decodeId(c->master))->val[j]; if(masterless) return getEuclidCdata(decodeId(c->master))->val[j];
else if(geometry) return 0; else if(geometry) return 0;
else if(ctof(c)) return getHeptagonCdata(c->master)->val[j]*3; else if(ctof(c)) return getHeptagonCdata(c->master)->val[j]*3;
else { else {
@ -1388,7 +1388,7 @@ int getCdata(cell *c, int j) {
} }
int getBits(cell *c) { int getBits(cell *c) {
if(stdeuclid) return getEuclidCdata(decodeId(c->master))->bits; if(masterless) return getEuclidCdata(decodeId(c->master))->bits;
else if(geometry) return 0; else if(geometry) return 0;
else if(c->type != 6) return getHeptagonCdata(c->master)->bits; else if(c->type != 6) return getHeptagonCdata(c->master)->bits;
else { else {
@ -1432,7 +1432,7 @@ map<pair<cell*, cell*>, int> saved_distances;
int celldistance(cell *c1, cell *c2) { int celldistance(cell *c1, cell *c2) {
int d = 0; int d = 0;
if((stdeuclid) && (euclid6 || (euclid4 && nonbitrunc))) { if((masterless) && (euclid6 || (euclid4 && nonbitrunc))) {
if(!torus) if(!torus)
return eudist(decodeId(c1->master) - decodeId(c2->master)); return eudist(decodeId(c1->master) - decodeId(c2->master));
else if(torus && torusconfig::torus_mode == 0) else if(torus && torusconfig::torus_mode == 0)
@ -1457,7 +1457,7 @@ int celldistance(cell *c1, cell *c2) {
return 64; return 64;
} }
if(gp::on || stdeuclid || irr::on || syntetic || binarytiling) { if(gp::on || masterless || irr::on || syntetic || binarytiling) {
if(saved_distances.count(make_pair(c1,c2))) if(saved_distances.count(make_pair(c1,c2)))
return saved_distances[make_pair(c1,c2)]; return saved_distances[make_pair(c1,c2)];

View File

@ -248,7 +248,7 @@ int displaydir(cell *c, int d) {
int dirs[8] = {0, 11, 21, 31, 42, 53, 63, 73}; int dirs[8] = {0, 11, 21, 31, 42, 53, 63, 73};
return -21-dirs[d]; return -21-dirs[d];
} }
else if(stdeuclid) else if(masterless)
return - d * S84 / c->type; return - d * S84 / c->type;
else else
return S42 - d * S84 / c->type; return S42 - d * S84 / c->type;
@ -286,7 +286,7 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) {
if(onplayer && (items[itOrbSword] || items[itOrbSword2])) { if(onplayer && (items[itOrbSword] || items[itOrbSword2])) {
using namespace sword; using namespace sword;
double esh = stdeuclid ? M_PI - M_PI*3/S84 + 2.5 * M_PI/S42: 0; double esh = masterless ? M_PI - M_PI*3/S84 + 2.5 * M_PI/S42: 0;
if(shmup::on) { if(shmup::on) {
#if CAP_POLY #if CAP_POLY
@ -305,7 +305,7 @@ void drawPlayerEffects(const transmatrix& V, cell *c, bool onplayer) {
transmatrix Vnow = gmatrix[c] * rgpushxto0(inverse(gmatrix[c]) * tC0(V)) * (irr::on ? ddspin(c,0,S42) : spin(-hexshiftat(c))); transmatrix Vnow = gmatrix[c] * rgpushxto0(inverse(gmatrix[c]) * tC0(V)) * (irr::on ? ddspin(c,0,S42) : spin(-hexshiftat(c)));
#if CAP_QUEUE #if CAP_QUEUE
if(!stdeuclid) for(int a=0; a<S42; a++) { if(!masterless) for(int a=0; a<S42; a++) {
int dda = S42 + (-1-2*a); int dda = S42 + (-1-2*a);
if(a == ang && items[itOrbSword]) continue; if(a == ang && items[itOrbSword]) continue;
if(nonbitrunc && !gp::on && !irr::on && a%3 != ang%3) continue; if(nonbitrunc && !gp::on && !irr::on && a%3 != ang%3) continue;
@ -2054,7 +2054,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, int col) {
if(d>=4) cw += 2; if(d>=4) cw += 2;
transmatrix Vs = Vparam; transmatrix Vs = Vparam;
bool mirr = cw.mirrored; bool mirr = cw.mirrored;
Vs = Vs * ddspin(c, cw.spin-cwt.spin, stdeuclid ? 0 : S42); Vs = Vs * ddspin(c, cw.spin-cwt.spin, masterless ? 0 : S42);
nospins = applyAnimation(cwt.at, Vs, footphase, LAYER_SMALL); nospins = applyAnimation(cwt.at, Vs, footphase, LAYER_SMALL);
if(!nospins) Vs = Vs * ddspin(c, cwt.spin); if(!nospins) Vs = Vs * ddspin(c, cwt.spin);
if(mirr) Vs = Vs * Mirror; if(mirr) Vs = Vs * Mirror;
@ -2118,7 +2118,7 @@ bool drawMonster(const transmatrix& Vparam, int ct, cell *c, int col) {
Vb = Vb * xpush(tentacle_length - cellgfxdist(c, c->mondir)); Vb = Vb * xpush(tentacle_length - cellgfxdist(c, c->mondir));
} }
// if(ctof(c) && !stdeuclid) Vb = Vb * xpush(hexhexdist - hcrossf); // if(ctof(c) && !masterless) Vb = Vb * xpush(hexhexdist - hcrossf);
// return nonbitrunc ? tessf * gp::scale : (c->type == 6 && (i&1)) ? hexhexdist : crossf; // return nonbitrunc ? tessf * gp::scale : (c->type == 6 && (i&1)) ? hexhexdist : crossf;
return drawMonsterTypeDH(m, c, Vb, col, darkhistory, footphase); return drawMonsterTypeDH(m, c, Vb, col, darkhistory, footphase);
} }
@ -2406,7 +2406,7 @@ void set_towerfloor(cell *c, cellfunction *cf = coastvalEdge) {
} }
int j = -1; int j = -1;
if(stdeuclid) j = 10; if(masterless) j = 10;
else if((*cf)(c) > 1) { else if((*cf)(c) > 1) {
int i = towerval(c, cf); int i = towerval(c, cf);
if(i == 4) j = 0; if(i == 4) j = 0;
@ -2431,7 +2431,7 @@ void set_towerfloor(cell *c, cellfunction *cf = coastvalEdge) {
void set_zebrafloor(cell *c) { void set_zebrafloor(cell *c) {
if(stdeuclid) { set_floor(shTower[10]); return; } if(masterless) { set_floor(shTower[10]); return; }
if(weirdhyperbolic) { if(weirdhyperbolic) {
set_floor(shFloor); return; set_floor(shFloor); return;
} }
@ -2520,7 +2520,7 @@ void draw_reptile(cell *c, const transmatrix &V, int col) {
} }
void set_emeraldfloor(cell *c) { void set_emeraldfloor(cell *c) {
if(!stdeuclid && !nonbitrunc) { if(!masterless && !nonbitrunc) {
auto si = patterns::getpatterninfo(c, 'f', patterns::SPF_SYM0123); auto si = patterns::getpatterninfo(c, 'f', patterns::SPF_SYM0123);
int j = -1; int j = -1;
@ -2600,7 +2600,7 @@ bool drawstaratvec(double dx, double dy) {
int reptilecolor(cell *c) { int reptilecolor(cell *c) {
int i = zebra40(c); int i = zebra40(c);
if(!stdeuclid) { if(!masterless) {
if(i >= 4 && i < 16) i = 0; if(i >= 4 && i < 16) i = 0;
else if(i >= 16 && i < 28) i = 1; else if(i >= 16 && i < 28) i = 1;
else if(i >= 28 && i < 40) i = 2; else if(i >= 28 && i < 40) i = 2;
@ -3107,7 +3107,7 @@ bool is_nice_dual(cell *c) {
} }
bool use_swapped_duals() { bool use_swapped_duals() {
return (stdeuclid && !a4) || gp::on; return (masterless && !a4) || gp::on;
} }
void floorShadow(cell *c, const transmatrix& V, int col) { void floorShadow(cell *c, const transmatrix& V, int col) {
@ -5187,7 +5187,7 @@ void drawthemap() {
compute_graphical_distance(); compute_graphical_distance();
centdist = 1e20; centdist = 1e20;
if(!stdeuclid) centerover.at = NULL; if(!masterless) centerover.at = NULL;
for(int i=0; i<multi::players; i++) { for(int i=0; i<multi::players; i++) {
multi::ccdist[i] = 1e20; multi::ccat[i] = NULL; multi::ccdist[i] = 1e20; multi::ccat[i] = NULL;
@ -5207,7 +5207,7 @@ void drawthemap() {
arrowtraps.clear(); arrowtraps.clear();
profile_start(1); profile_start(1);
if(stdeuclid) if(masterless)
drawEuclidean(); drawEuclidean();
else if(binarytiling) else if(binarytiling)
binary::draw(); binary::draw();
@ -5301,7 +5301,7 @@ void drawmovestar(double dx, double dy) {
ld R = sqrt(H[0] * H[0] + H[1] * H[1]); ld R = sqrt(H[0] * H[0] + H[1] * H[1]);
transmatrix Centered = Id; transmatrix Centered = Id;
if(stdeuclid) if(masterless)
Centered = eupush(H[0], H[1]); Centered = eupush(H[0], H[1]);
else if(R > 1e-9) Centered = rgpushxto0(H); else if(R > 1e-9) Centered = rgpushxto0(H);
@ -5737,7 +5737,7 @@ void restartGraph() {
View = Id; View = Id;
if(!autocheat) linepatterns::clearAll(); if(!autocheat) linepatterns::clearAll();
if(currentmap) { if(currentmap) {
if(stdeuclid) { if(masterless) {
centerover = vec_to_cellwalker(0); centerover = vec_to_cellwalker(0);
} }
else { else {
@ -5870,7 +5870,7 @@ void drawBug(const cellwalker& cw, int col) {
} }
cell *viewcenter() { cell *viewcenter() {
if(stdeuclid) return centerover.at; if(masterless) return centerover.at;
else return viewctr.at->c7; else return viewctr.at->c7;
} }

View File

@ -103,8 +103,7 @@ void addMessage(string s, char spamtype = 0);
#define smallbounded (sphere || (quotient & qSMALL) || torus) #define smallbounded (sphere || (quotient & qSMALL) || torus)
#define bounded (sphere || quotient || torus) #define bounded (sphere || quotient || torus)
#define masterless among(geometry, gEuclid, gEuclidSquare) #define masterless among(geometry, gEuclid, gEuclidSquare, gTorus)
#define stdeuclid (torus || masterless)
#define stdsphere (sphere && !syntetic) #define stdsphere (sphere && !syntetic)
#define a4 (S3 == 4) #define a4 (S3 == 4)
@ -119,8 +118,8 @@ void addMessage(string s, char spamtype = 0);
#define smallsphere (S7 < 5) #define smallsphere (S7 < 5)
#define bigsphere (S7 == 5) #define bigsphere (S7 == 5)
#define ap4 (a4 && nonbitrunc) #define ap4 (a4 && nonbitrunc)
#define euclid4 (euclid && a4) #define euclid4 (masterless && a4)
#define euclid6 (euclid && !a4) #define euclid6 (masterless && !a4)
#define S6 (S3*2) #define S6 (S3*2)
#define S42 (S7*S6) #define S42 (S7*S6)

View File

@ -865,7 +865,7 @@ void resetview() {
DEBB(DF_GRAPH, (debugfile,"reset view\n")); DEBB(DF_GRAPH, (debugfile,"reset view\n"));
View = Id; View = Id;
// EUCLIDEAN // EUCLIDEAN
if(!stdeuclid) if(!masterless)
viewctr.at = cwt.at->master, viewctr.at = cwt.at->master,
viewctr.spin = cwt.spin; viewctr.spin = cwt.spin;
else centerover = cwt; else centerover = cwt;