mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-10-31 19:36:16 +00:00
adjusted to older C++
This commit is contained in:
parent
cb8e34204f
commit
9a3167e0ed
5
hyper.h
5
hyper.h
@ -3589,6 +3589,7 @@ string helptitle(string s, color_t col);
|
|||||||
pair<int, int> cell_to_pair(cell *c);
|
pair<int, int> cell_to_pair(cell *c);
|
||||||
extern bool nohud, nofps, nomap;
|
extern bool nohud, nofps, nomap;
|
||||||
|
|
||||||
|
template<class T> array<T, 4> make_array(T a, T b, T c, T d) { array<T,4> x; x[0] = a; x[1] = b; x[2] = c; x[3] = d; return x; }
|
||||||
template<class T> array<T, 3> make_array(T a, T b, T c) { array<T,3> x; x[0] = a; x[1] = b; x[2] = c; return x; }
|
template<class T> array<T, 3> make_array(T a, T b, T c) { array<T,3> x; x[0] = a; x[1] = b; x[2] = c; return x; }
|
||||||
template<class T> array<T, 2> make_array(T a, T b) { array<T,2> x; x[0] = a; x[1] = b; return x; }
|
template<class T> array<T, 2> make_array(T a, T b) { array<T,2> x; x[0] = a; x[1] = b; return x; }
|
||||||
|
|
||||||
@ -3838,9 +3839,9 @@ namespace glhr {
|
|||||||
|
|
||||||
inline glvertex makevertex(GLfloat x, GLfloat y, GLfloat z) {
|
inline glvertex makevertex(GLfloat x, GLfloat y, GLfloat z) {
|
||||||
#if SHDIM == 3
|
#if SHDIM == 3
|
||||||
return glvertex({x,y,z});
|
return make_array(x, y, z);
|
||||||
#else
|
#else
|
||||||
return glvertex({x,y,z,1});
|
return make_array<GLfloat>(x, y, z, 1);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ void gen600() {
|
|||||||
|
|
||||||
ld phi = (1 + sqrt(5)) / 2;
|
ld phi = (1 + sqrt(5)) / 2;
|
||||||
|
|
||||||
array<ld, 4> coo = {1, phi, 1/phi, 0};
|
array<ld, 4> coo = make_array<ld>(1, phi, 1/phi, 0);
|
||||||
|
|
||||||
// all permutations
|
// all permutations
|
||||||
array<int, 4> tab;
|
array<int, 4> tab;
|
||||||
@ -258,7 +258,7 @@ void gen600() {
|
|||||||
for(int j=0; j<120; j++) if(inedge[i][j])
|
for(int j=0; j<120; j++) if(inedge[i][j])
|
||||||
for(int k=0; k<120; k++) if(inedge[i][k] && inedge[k][j])
|
for(int k=0; k<120; k++) if(inedge[i][k] && inedge[k][j])
|
||||||
for(int l=0; l<120; l++) if(inedge[i][l] && inedge[j][l] && inedge[k][l]) {
|
for(int l=0; l<120; l++) if(inedge[i][l] && inedge[j][l] && inedge[k][l]) {
|
||||||
array<int, 4> ijkl = {i, j, k, l};
|
array<int, 4> ijkl = make_array(i, j, k, l);
|
||||||
transmatrix T;
|
transmatrix T;
|
||||||
for(int z=0; z<4; z++) set_column(T, z, vertices120[ijkl[z]]);
|
for(int z=0; z<4; z++) set_column(T, z, vertices120[ijkl[z]]);
|
||||||
if(det(T) > 0) js[i] = ijkl;
|
if(det(T) > 0) js[i] = ijkl;
|
||||||
|
Loading…
Reference in New Issue
Block a user