mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 18:00:34 +00:00
renamed MAXDIM to MAXMDIM (conflict with crystal)
This commit is contained in:
parent
ccc77b05fb
commit
54f278963c
@ -94,7 +94,7 @@ namespace binary {
|
|||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAXDIM==4
|
#if MAXMDIM==4
|
||||||
heptagon *build3(heptagon *parent, int d, int d1, int delta) {
|
heptagon *build3(heptagon *parent, int d, int d1, int delta) {
|
||||||
int side = 0;
|
int side = 0;
|
||||||
if(d < 4) side = (parent->zebraval * 2 + d) % 5;
|
if(d < 4) side = (parent->zebraval * 2 + d) % 5;
|
||||||
@ -157,7 +157,7 @@ namespace binary {
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAXDIM==4
|
#if MAXMDIM==4
|
||||||
heptagon *createStep3(heptagon *parent, int d) {
|
heptagon *createStep3(heptagon *parent, int d) {
|
||||||
auto h = parent;
|
auto h = parent;
|
||||||
switch(d) {
|
switch(d) {
|
||||||
@ -220,7 +220,7 @@ namespace binary {
|
|||||||
return direct_tmatrix[dir];
|
return direct_tmatrix[dir];
|
||||||
}
|
}
|
||||||
|
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
|
|
||||||
void queuecube(const transmatrix& V, ld size, color_t linecolor, color_t facecolor) {
|
void queuecube(const transmatrix& V, ld size, color_t linecolor, color_t facecolor) {
|
||||||
ld yy = log(2) / 2;
|
ld yy = log(2) / 2;
|
||||||
|
2
cell.cpp
2
cell.cpp
@ -439,7 +439,7 @@ int celldistAlt(cell *c) {
|
|||||||
if(sphere || quotient) {
|
if(sphere || quotient) {
|
||||||
return celldist(c) - 3;
|
return celldist(c) - 3;
|
||||||
}
|
}
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
if(euclid && DIM == 3) return euclid3::dist_alt(c);
|
if(euclid && DIM == 3) return euclid3::dist_alt(c);
|
||||||
#endif
|
#endif
|
||||||
if(!c->master->alt) return 0;
|
if(!c->master->alt) return 0;
|
||||||
|
@ -465,7 +465,7 @@ heptagon* encodeId(int id) {
|
|||||||
|
|
||||||
// 3D Euclidean space
|
// 3D Euclidean space
|
||||||
|
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
|
|
||||||
namespace euclid3 {
|
namespace euclid3 {
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ transmatrix calc_relative_matrix(cell *c2, cell *c1, const hyperpoint& point_hin
|
|||||||
#if CAP_BT
|
#if CAP_BT
|
||||||
if(binarytiling) return binary::relative_matrix(c2->master, c1->master);
|
if(binarytiling) return binary::relative_matrix(c2->master, c1->master);
|
||||||
#endif
|
#endif
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
if(euclid && DIM == 3) return euclid3::relative_matrix(c2->master, c1->master);
|
if(euclid && DIM == 3) return euclid3::relative_matrix(c2->master, c1->master);
|
||||||
if(sphere && DIM == 3) return sphere3::relative_matrix(c2->master, c1->master);
|
if(sphere && DIM == 3) return sphere3::relative_matrix(c2->master, c1->master);
|
||||||
#endif
|
#endif
|
||||||
|
@ -5194,7 +5194,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
|||||||
prec += vid.linequality;
|
prec += vid.linequality;
|
||||||
|
|
||||||
if(0);
|
if(0);
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
else if(DIM == 3) {
|
else if(DIM == 3) {
|
||||||
for(int t=0; t<c->type; t++) {
|
for(int t=0; t<c->type; t++) {
|
||||||
if(!c->move(t)) continue;
|
if(!c->move(t)) continue;
|
||||||
@ -5823,7 +5823,7 @@ void drawthemap() {
|
|||||||
else if(archimedean)
|
else if(archimedean)
|
||||||
arcm::draw();
|
arcm::draw();
|
||||||
#endif
|
#endif
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
else if(euclid && DIM == 3)
|
else if(euclid && DIM == 3)
|
||||||
euclid3::draw();
|
euclid3::draw();
|
||||||
else if(sphere && DIM == 3)
|
else if(sphere && DIM == 3)
|
||||||
|
@ -227,11 +227,11 @@ heptagon *createStep(heptagon *h, int d) {
|
|||||||
if(!h->move(d) && binarytiling && DIM == 2)
|
if(!h->move(d) && binarytiling && DIM == 2)
|
||||||
return binary::createStep(h, d);
|
return binary::createStep(h, d);
|
||||||
#endif
|
#endif
|
||||||
#if CAP_BT && MAXDIM == 4
|
#if CAP_BT && MAXMDIM == 4
|
||||||
if(!h->move(d) && binarytiling && DIM == 3)
|
if(!h->move(d) && binarytiling && DIM == 3)
|
||||||
return binary::createStep3(h, d);
|
return binary::createStep3(h, d);
|
||||||
#endif
|
#endif
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
if(!h->move(d) && euclid && DIM == 3)
|
if(!h->move(d) && euclid && DIM == 3)
|
||||||
return euclid3::createStep(h, d);
|
return euclid3::createStep(h, d);
|
||||||
#endif
|
#endif
|
||||||
|
18
hyper.h
18
hyper.h
@ -182,7 +182,7 @@ typedef complex<ld> cld;
|
|||||||
|
|
||||||
#define DEBSM(x)
|
#define DEBSM(x)
|
||||||
|
|
||||||
#if MAXDIM == 3
|
#if MAXMDIM == 3
|
||||||
#define DIM 2
|
#define DIM 2
|
||||||
#else
|
#else
|
||||||
#define DIM ((geometry == gBinary3 || geometry == gCubeTiling || geometry == gCell120 || geometry == gECell120) ? 3 : 2)
|
#define DIM ((geometry == gBinary3 || geometry == gCubeTiling || geometry == gCell120 || geometry == gECell120) ? 3 : 2)
|
||||||
@ -191,17 +191,17 @@ typedef complex<ld> cld;
|
|||||||
|
|
||||||
extern array<ld, gGUARD> sightranges;
|
extern array<ld, gGUARD> sightranges;
|
||||||
|
|
||||||
struct hyperpoint : array<ld, MAXDIM> {
|
struct hyperpoint : array<ld, MAXMDIM> {
|
||||||
hyperpoint() {}
|
hyperpoint() {}
|
||||||
|
|
||||||
hyperpoint(ld x, ld y, ld z, ld w) {
|
hyperpoint(ld x, ld y, ld z, ld w) {
|
||||||
(*this)[0] = x; (*this)[1] = y; (*this)[2] = z;
|
(*this)[0] = x; (*this)[1] = y; (*this)[2] = z;
|
||||||
if(MAXDIM == 4) (*this)[3] = w;
|
if(MAXMDIM == 4) (*this)[3] = w;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
struct transmatrix {
|
struct transmatrix {
|
||||||
ld tab[MAXDIM][MAXDIM];
|
ld tab[MAXMDIM][MAXMDIM];
|
||||||
ld * operator [] (int i) { return tab[i]; }
|
ld * operator [] (int i) { return tab[i]; }
|
||||||
const ld * operator [] (int i) const { return tab[i]; }
|
const ld * operator [] (int i) const { return tab[i]; }
|
||||||
};
|
};
|
||||||
@ -226,7 +226,7 @@ inline transmatrix operator * (const transmatrix& T, const transmatrix& U) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constexpr transmatrix diag(ld a, ld b, ld c, ld d) {
|
constexpr transmatrix diag(ld a, ld b, ld c, ld d) {
|
||||||
#if MAXDIM==3
|
#if MAXMDIM==3
|
||||||
return transmatrix{{{a,0,0}, {0,b,0}, {0,0,c}}};
|
return transmatrix{{{a,0,0}, {0,b,0}, {0,0,c}}};
|
||||||
#else
|
#else
|
||||||
return transmatrix{{{a,0,0,0}, {0,b,0,0}, {0,0,c,0}, {0,0,0,d}}};
|
return transmatrix{{{a,0,0,0}, {0,b,0,0}, {0,0,c,0}, {0,0,0,d}}};
|
||||||
@ -2792,7 +2792,7 @@ typedef array<GLfloat, 2> glvec2;
|
|||||||
typedef array<GLfloat, 3> glvec3;
|
typedef array<GLfloat, 3> glvec3;
|
||||||
typedef array<GLfloat, 4> glvec4;
|
typedef array<GLfloat, 4> glvec4;
|
||||||
|
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
#define SHDIM 4
|
#define SHDIM 4
|
||||||
typedef glvec4 glvertex;
|
typedef glvec4 glvertex;
|
||||||
#else
|
#else
|
||||||
@ -4240,7 +4240,7 @@ hyperpoint get_horopoint3(ld y, ld x, ld z);
|
|||||||
|
|
||||||
namespace binary {
|
namespace binary {
|
||||||
heptagon *createStep(heptagon *parent, int d);
|
heptagon *createStep(heptagon *parent, int d);
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
heptagon *createStep3(heptagon *parent, int d);
|
heptagon *createStep3(heptagon *parent, int d);
|
||||||
#endif
|
#endif
|
||||||
transmatrix parabolic(ld u);
|
transmatrix parabolic(ld u);
|
||||||
@ -4249,7 +4249,7 @@ namespace binary {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
namespace euclid3 {
|
namespace euclid3 {
|
||||||
heptagon *createStep(heptagon *parent, int d);
|
heptagon *createStep(heptagon *parent, int d);
|
||||||
hrmap* new_map();
|
hrmap* new_map();
|
||||||
@ -4510,7 +4510,7 @@ struct comma_printer {
|
|||||||
template<class T, size_t X> void print(hstream& hs, const array<T, X>& a) { print(hs, "("); comma_printer c(hs); for(const T& t: a) c(t); print(hs, ")"); }
|
template<class T, size_t X> void print(hstream& hs, const array<T, X>& a) { print(hs, "("); comma_printer c(hs); for(const T& t: a) c(t); print(hs, ")"); }
|
||||||
template<class T> void print(hstream& hs, const vector<T>& a) { print(hs, "("); comma_printer c(hs); for(const T& t: a) c(t); print(hs, ")"); }
|
template<class T> void print(hstream& hs, const vector<T>& a) { print(hs, "("); comma_printer c(hs); for(const T& t: a) c(t); print(hs, ")"); }
|
||||||
|
|
||||||
inline void print(hstream& hs, const hyperpoint h) { print(hs, (const array<ld, MAXDIM>&)h); }
|
inline void print(hstream& hs, const hyperpoint h) { print(hs, (const array<ld, MAXMDIM>&)h); }
|
||||||
inline void print(hstream& hs, const transmatrix T) {
|
inline void print(hstream& hs, const transmatrix T) {
|
||||||
print(hs, "("); comma_printer c(hs);
|
print(hs, "("); comma_printer c(hs);
|
||||||
for(int i=0; i<MDIM; i++)
|
for(int i=0; i<MDIM; i++)
|
||||||
|
@ -303,7 +303,7 @@ inline hyperpoint xspinpush0(ld alpha, ld x) {
|
|||||||
transmatrix ypush(ld alpha) { return cpush(1, alpha); }
|
transmatrix ypush(ld alpha) { return cpush(1, alpha); }
|
||||||
|
|
||||||
transmatrix matrix3(ld a, ld b, ld c, ld d, ld e, ld f, ld g, ld h, ld i) {
|
transmatrix matrix3(ld a, ld b, ld c, ld d, ld e, ld f, ld g, ld h, ld i) {
|
||||||
#if MAXDIM==3
|
#if MAXMDIM==3
|
||||||
return transmatrix {{{a,b,c},{d,e,f},{g,h,i}}};
|
return transmatrix {{{a,b,c},{d,e,f},{g,h,i}}};
|
||||||
#else
|
#else
|
||||||
return transmatrix {{{a,b,c,0},{d,e,f,0},{g,h,i,0},{0,0,0,1}}};
|
return transmatrix {{{a,b,c,0},{d,e,f,0},{g,h,i,0},{0,0,0,1}}};
|
||||||
@ -311,7 +311,7 @@ transmatrix matrix3(ld a, ld b, ld c, ld d, ld e, ld f, ld g, ld h, ld i) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
transmatrix matrix4(ld a, ld b, ld c, ld d, ld e, ld f, ld g, ld h, ld i, ld j, ld k, ld l, ld m, ld n, ld o, ld p) {
|
transmatrix matrix4(ld a, ld b, ld c, ld d, ld e, ld f, ld g, ld h, ld i, ld j, ld k, ld l, ld m, ld n, ld o, ld p) {
|
||||||
#if MAXDIM==3
|
#if MAXMDIM==3
|
||||||
return transmatrix {{{a,b,d},{e,f,h},{m,n,p}}};
|
return transmatrix {{{a,b,d},{e,f,h},{m,n,p}}};
|
||||||
#else
|
#else
|
||||||
return transmatrix {{{a,b,c,d},{e,f,g,h},{i,j,k,l},{m,n,o,p}}};
|
return transmatrix {{{a,b,c,d},{e,f,g,h},{i,j,k,l},{m,n,o,p}}};
|
||||||
|
@ -1118,7 +1118,7 @@ void optimizeview() {
|
|||||||
|
|
||||||
if(0) ;
|
if(0) ;
|
||||||
|
|
||||||
#if CAP_BT || CAP_ARCM || MAXDIM == 4
|
#if CAP_BT || CAP_ARCM || MAXMDIM == 4
|
||||||
else if(binarytiling || archimedean || DIM == 3) {
|
else if(binarytiling || archimedean || DIM == 3) {
|
||||||
turn = -1, best = hdist0(tC0(View));
|
turn = -1, best = hdist0(tC0(View));
|
||||||
for(int i=0; i<viewctr.at->c7->type; i++) {
|
for(int i=0; i<viewctr.at->c7->type; i++) {
|
||||||
@ -1128,7 +1128,7 @@ void optimizeview() {
|
|||||||
#if CAP_BT
|
#if CAP_BT
|
||||||
if(binarytiling) T = binary::relative_matrix(h2, viewctr.at);
|
if(binarytiling) T = binary::relative_matrix(h2, viewctr.at);
|
||||||
#endif
|
#endif
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
if(euclid && DIM == 3) T = euclid3::relative_matrix(h2, viewctr.at);
|
if(euclid && DIM == 3) T = euclid3::relative_matrix(h2, viewctr.at);
|
||||||
if(sphere && DIM == 3) T = sphere3::relative_matrix(h2, viewctr.at);
|
if(sphere && DIM == 3) T = sphere3::relative_matrix(h2, viewctr.at);
|
||||||
#endif
|
#endif
|
||||||
|
@ -1290,7 +1290,7 @@ bool pseudohept(cell *c) {
|
|||||||
#if CAP_BT
|
#if CAP_BT
|
||||||
if(binarytiling) return binary::pseudohept(c);
|
if(binarytiling) return binary::pseudohept(c);
|
||||||
#endif
|
#endif
|
||||||
#if MAXDIM == 4
|
#if MAXMDIM == 4
|
||||||
if(DIM == 3) {
|
if(DIM == 3) {
|
||||||
if(euclid) return euclid3::pseudohept(c);
|
if(euclid) return euclid3::pseudohept(c);
|
||||||
if(sphere) return sphere3::pseudohept(c);
|
if(sphere) return sphere3::pseudohept(c);
|
||||||
|
@ -614,7 +614,7 @@ void init() {
|
|||||||
hyperpoint gltopoint(const glvertex& t) {
|
hyperpoint gltopoint(const glvertex& t) {
|
||||||
hyperpoint h;
|
hyperpoint h;
|
||||||
h[0] = t[0]; h[1] = t[1]; h[2] = t[2];
|
h[0] = t[0]; h[1] = t[1]; h[2] = t[2];
|
||||||
if(SHDIM == 4 && MAXDIM == 4) h[3] = t[3];
|
if(SHDIM == 4 && MAXMDIM == 4) h[3] = t[3];
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -443,7 +443,7 @@ union SDL_Event;
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define MAXDIM 4
|
#define MAXMDIM 4
|
||||||
|
|
||||||
#ifndef CAP_GEOMETRY
|
#ifndef CAP_GEOMETRY
|
||||||
#define CAP_GEOMETRY (!(ISMINI))
|
#define CAP_GEOMETRY (!(ISMINI))
|
||||||
|
Loading…
Reference in New Issue
Block a user