From babb8fbde414e1602b1d1ff18c1368c48e3fc624 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 20 Feb 2018 11:15:08 +0100 Subject: [PATCH] removed the EUCSCALE parameter for consistency --- hyper.h | 3 --- hypgraph.cpp | 11 +++++------ polygons.cpp | 16 +--------------- rug.cpp | 2 -- 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/hyper.h b/hyper.h index bdd803d2..ae6a21f4 100644 --- a/hyper.h +++ b/hyper.h @@ -1,9 +1,6 @@ // This is the main header file of HyperRogue. Mostly everything is dumped here. // It is quite chaotic. -// scale the Euclidean -#define EUCSCALE 2.3 - #define NUMWITCH 7 // achievements diff --git a/hypgraph.cpp b/hypgraph.cpp index 02cf6039..812af14d 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -28,11 +28,11 @@ hyperpoint gethyper(ld x, ld y) { return ghpm; } - if(euclid) - return hpxy(hx * (EUCSCALE + vid.alpha), hy * (EUCSCALE + vid.alpha)); - if(vid.camera_angle) camrotate(hx, hy); + if(euclid) + return hpxy(hx * (1 + vid.alpha), hy * (1 + vid.alpha)); + ld hr = hx*hx+hy*hy; if(hr > .9999 && !sphere) return Hypc; @@ -100,7 +100,7 @@ void apply_depth(hyperpoint &f, ld z) { void applymodel(hyperpoint H, hyperpoint& ret) { - ld tz = euclid ? (EUCSCALE+vid.alpha) : vid.alpha+H[2]; + ld tz = euclid ? (1+vid.alpha) : vid.alpha+H[2]; if(tz < BEHIND_LIMIT && tz > -BEHIND_LIMIT) tz = BEHIND_LIMIT; if(pmodel == mdUnchanged) { @@ -457,7 +457,7 @@ void drawEuclidean() { transmatrix View0 = View; - ld cellrad = vid.radius / (EUCSCALE + vid.alpha); + ld cellrad = vid.radius / (1 + vid.alpha); ld centerd = matrixnorm(View0); @@ -641,7 +641,6 @@ transmatrix atscreenpos(ld x, ld y, ld size) { V[0][0] = size * 2 * hcrossf / crossf; V[1][1] = size * 2 * hcrossf / crossf; V[2][2] = stereo::scrdist; - if(euclid) V[2][2] /= EUCSCALE; return V; } diff --git a/polygons.cpp b/polygons.cpp index ae2124cf..85bdd431 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -157,13 +157,7 @@ void addpoint(const hyperpoint& H) { } for(int i=0; i<3; i++) Hscr[i] *= vid.radius; add1(Hscr); - } /* - else { - add1(H); - if(euclid) glcoords[qglcoords][2] *= EUCSCALE; - glcoords[qglcoords][2] += vid.alpha; - // glcoords[qglcoords][2] = 1; // EUCSCALE; - } */ + } } void coords_to_poly() { @@ -240,14 +234,6 @@ void glapplymatrix(const transmatrix& V) { } {for(int x=0; x<3; x++) mat[id++] = 0;} mat[id++] = 1; - if(euclid) { - /* mat[2] = 0; mat[6] = 0; mat[10] = -zz; - mat[12] = mat[8]; mat[13] = mat[9]; mat[14] = EUCSCALE+zz; */ - // mat[8] = mat[9] = 0; - // mat[11] = -EUCSCALE; - for(int i=2; i<16; i+=4) mat[i] *= EUCSCALE; - } - mat[14] = GLfloat(vid.alpha); if(mat[10] + vid.alpha < 0 && !sphere && !euclid) { diff --git a/rug.cpp b/rug.cpp index afb78901..525df032 100644 --- a/rug.cpp +++ b/rug.cpp @@ -435,12 +435,10 @@ void buildTorusRug() { applymodel(tC0(eumove(x, y)), onscreen); // take point (1,0) // apply eumove(1,0) - // divide by EUCSCALE // multiply by vid.radius (= HTEXTURESIZE * rugzoom) // add 1, divide by texturesize r->x1 = onscreen[0]; r->y1 = onscreen[1]; - // r->y1 = (1 + onscreen[1] * rugzoom / EUCSCALE)/2; hyperpoint h1 = hpxyz(x, y, 0); hyperpoint h2 = z2 * h1; double alpha = -h2[0] * 2 * M_PI;