adjusted to older C++

This commit is contained in:
Zeno Rogue 2019-03-01 18:53:32 +01:00
parent cb8e34204f
commit 9a3167e0ed
2 changed files with 5 additions and 4 deletions

View File

@ -3589,6 +3589,7 @@ string helptitle(string s, color_t col);
pair<int, int> cell_to_pair(cell *c);
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, 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) {
#if SHDIM == 3
return glvertex({x,y,z});
return make_array(x, y, z);
#else
return glvertex({x,y,z,1});
return make_array<GLfloat>(x, y, z, 1);
#endif
}

View File

@ -205,7 +205,7 @@ void gen600() {
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
array<int, 4> tab;
@ -258,7 +258,7 @@ void gen600() {
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 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;
for(int z=0; z<4; z++) set_column(T, z, vertices120[ijkl[z]]);
if(det(T) > 0) js[i] = ijkl;