diff --git a/hyper.h b/hyper.h index 0d037774..8643ab05 100644 --- a/hyper.h +++ b/hyper.h @@ -3589,6 +3589,7 @@ string helptitle(string s, color_t col); pair cell_to_pair(cell *c); extern bool nohud, nofps, nomap; +template array make_array(T a, T b, T c, T d) { array x; x[0] = a; x[1] = b; x[2] = c; x[3] = d; return x; } template array make_array(T a, T b, T c) { array x; x[0] = a; x[1] = b; x[2] = c; return x; } template array make_array(T a, T b) { array 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(x, y, z, 1); #endif } diff --git a/sphere.cpp b/sphere.cpp index aaa9d5db..9e016aa7 100644 --- a/sphere.cpp +++ b/sphere.cpp @@ -205,7 +205,7 @@ void gen600() { ld phi = (1 + sqrt(5)) / 2; - array coo = {1, phi, 1/phi, 0}; + array coo = make_array(1, phi, 1/phi, 0); // all permutations array 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 ijkl = {i, j, k, l}; + array 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;