1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 01:00:25 +00:00

renamed MAXDIM to MAXMDIM (conflict with crystal)

This commit is contained in:
? 2019-02-27 23:30:26 +01:00 committed by Zeno Rogue
parent ccc77b05fb
commit 54f278963c
12 changed files with 26 additions and 26 deletions

View File

@ -94,7 +94,7 @@ namespace binary {
return h;
}
#if MAXDIM==4
#if MAXMDIM==4
heptagon *build3(heptagon *parent, int d, int d1, int delta) {
int side = 0;
if(d < 4) side = (parent->zebraval * 2 + d) % 5;
@ -157,7 +157,7 @@ namespace binary {
return NULL;
}
#if MAXDIM==4
#if MAXMDIM==4
heptagon *createStep3(heptagon *parent, int d) {
auto h = parent;
switch(d) {
@ -220,7 +220,7 @@ namespace binary {
return direct_tmatrix[dir];
}
#if MAXDIM == 4
#if MAXMDIM == 4
void queuecube(const transmatrix& V, ld size, color_t linecolor, color_t facecolor) {
ld yy = log(2) / 2;

View File

@ -439,7 +439,7 @@ int celldistAlt(cell *c) {
if(sphere || quotient) {
return celldist(c) - 3;
}
#if MAXDIM == 4
#if MAXMDIM == 4
if(euclid && DIM == 3) return euclid3::dist_alt(c);
#endif
if(!c->master->alt) return 0;

View File

@ -465,7 +465,7 @@ heptagon* encodeId(int id) {
// 3D Euclidean space
#if MAXDIM == 4
#if MAXMDIM == 4
namespace euclid3 {

View File

@ -94,7 +94,7 @@ transmatrix calc_relative_matrix(cell *c2, cell *c1, const hyperpoint& point_hin
#if CAP_BT
if(binarytiling) return binary::relative_matrix(c2->master, c1->master);
#endif
#if MAXDIM == 4
#if MAXMDIM == 4
if(euclid && DIM == 3) return euclid3::relative_matrix(c2->master, c1->master);
if(sphere && DIM == 3) return sphere3::relative_matrix(c2->master, c1->master);
#endif

View File

@ -5194,7 +5194,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
prec += vid.linequality;
if(0);
#if MAXDIM == 4
#if MAXMDIM == 4
else if(DIM == 3) {
for(int t=0; t<c->type; t++) {
if(!c->move(t)) continue;
@ -5823,7 +5823,7 @@ void drawthemap() {
else if(archimedean)
arcm::draw();
#endif
#if MAXDIM == 4
#if MAXMDIM == 4
else if(euclid && DIM == 3)
euclid3::draw();
else if(sphere && DIM == 3)

View File

@ -227,11 +227,11 @@ heptagon *createStep(heptagon *h, int d) {
if(!h->move(d) && binarytiling && DIM == 2)
return binary::createStep(h, d);
#endif
#if CAP_BT && MAXDIM == 4
#if CAP_BT && MAXMDIM == 4
if(!h->move(d) && binarytiling && DIM == 3)
return binary::createStep3(h, d);
#endif
#if MAXDIM == 4
#if MAXMDIM == 4
if(!h->move(d) && euclid && DIM == 3)
return euclid3::createStep(h, d);
#endif

18
hyper.h
View File

@ -182,7 +182,7 @@ typedef complex<ld> cld;
#define DEBSM(x)
#if MAXDIM == 3
#if MAXMDIM == 3
#define DIM 2
#else
#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;
struct hyperpoint : array<ld, MAXDIM> {
struct hyperpoint : array<ld, MAXMDIM> {
hyperpoint() {}
hyperpoint(ld x, ld y, ld z, ld w) {
(*this)[0] = x; (*this)[1] = y; (*this)[2] = z;
if(MAXDIM == 4) (*this)[3] = w;
if(MAXMDIM == 4) (*this)[3] = w;
}
};
struct transmatrix {
ld tab[MAXDIM][MAXDIM];
ld tab[MAXMDIM][MAXMDIM];
ld * operator [] (int i) { 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) {
#if MAXDIM==3
#if MAXMDIM==3
return transmatrix{{{a,0,0}, {0,b,0}, {0,0,c}}};
#else
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, 4> glvec4;
#if MAXDIM == 4
#if MAXMDIM == 4
#define SHDIM 4
typedef glvec4 glvertex;
#else
@ -4240,7 +4240,7 @@ hyperpoint get_horopoint3(ld y, ld x, ld z);
namespace binary {
heptagon *createStep(heptagon *parent, int d);
#if MAXDIM == 4
#if MAXMDIM == 4
heptagon *createStep3(heptagon *parent, int d);
#endif
transmatrix parabolic(ld u);
@ -4249,7 +4249,7 @@ namespace binary {
}
#endif
#if MAXDIM == 4
#if MAXMDIM == 4
namespace euclid3 {
heptagon *createStep(heptagon *parent, int d);
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> 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) {
print(hs, "("); comma_printer c(hs);
for(int i=0; i<MDIM; i++)

View File

@ -303,7 +303,7 @@ inline hyperpoint xspinpush0(ld alpha, ld x) {
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) {
#if MAXDIM==3
#if MAXMDIM==3
return transmatrix {{{a,b,c},{d,e,f},{g,h,i}}};
#else
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) {
#if MAXDIM==3
#if MAXMDIM==3
return transmatrix {{{a,b,d},{e,f,h},{m,n,p}}};
#else
return transmatrix {{{a,b,c,d},{e,f,g,h},{i,j,k,l},{m,n,o,p}}};

View File

@ -1118,7 +1118,7 @@ void optimizeview() {
if(0) ;
#if CAP_BT || CAP_ARCM || MAXDIM == 4
#if CAP_BT || CAP_ARCM || MAXMDIM == 4
else if(binarytiling || archimedean || DIM == 3) {
turn = -1, best = hdist0(tC0(View));
for(int i=0; i<viewctr.at->c7->type; i++) {
@ -1128,7 +1128,7 @@ void optimizeview() {
#if CAP_BT
if(binarytiling) T = binary::relative_matrix(h2, viewctr.at);
#endif
#if MAXDIM == 4
#if MAXMDIM == 4
if(euclid && DIM == 3) T = euclid3::relative_matrix(h2, viewctr.at);
if(sphere && DIM == 3) T = sphere3::relative_matrix(h2, viewctr.at);
#endif

View File

@ -1290,7 +1290,7 @@ bool pseudohept(cell *c) {
#if CAP_BT
if(binarytiling) return binary::pseudohept(c);
#endif
#if MAXDIM == 4
#if MAXMDIM == 4
if(DIM == 3) {
if(euclid) return euclid3::pseudohept(c);
if(sphere) return sphere3::pseudohept(c);

View File

@ -614,7 +614,7 @@ void init() {
hyperpoint gltopoint(const glvertex& t) {
hyperpoint h;
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;
}

View File

@ -443,7 +443,7 @@ union SDL_Event;
#endif
#endif
#define MAXDIM 4
#define MAXMDIM 4
#ifndef CAP_GEOMETRY
#define CAP_GEOMETRY (!(ISMINI))