1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-11-23 21:07:17 +00:00

removed the EUCSCALE parameter for consistency

This commit is contained in:
Zeno Rogue 2018-02-20 11:15:08 +01:00
parent 2dc2b6ed6d
commit babb8fbde4
4 changed files with 6 additions and 26 deletions

View File

@ -1,9 +1,6 @@
// This is the main header file of HyperRogue. Mostly everything is dumped here. // This is the main header file of HyperRogue. Mostly everything is dumped here.
// It is quite chaotic. // It is quite chaotic.
// scale the Euclidean
#define EUCSCALE 2.3
#define NUMWITCH 7 #define NUMWITCH 7
// achievements // achievements

View File

@ -28,11 +28,11 @@ hyperpoint gethyper(ld x, ld y) {
return ghpm; return ghpm;
} }
if(euclid)
return hpxy(hx * (EUCSCALE + vid.alpha), hy * (EUCSCALE + vid.alpha));
if(vid.camera_angle) camrotate(hx, hy); 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; ld hr = hx*hx+hy*hy;
if(hr > .9999 && !sphere) return Hypc; if(hr > .9999 && !sphere) return Hypc;
@ -100,7 +100,7 @@ void apply_depth(hyperpoint &f, ld z) {
void applymodel(hyperpoint H, hyperpoint& ret) { 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(tz < BEHIND_LIMIT && tz > -BEHIND_LIMIT) tz = BEHIND_LIMIT;
if(pmodel == mdUnchanged) { if(pmodel == mdUnchanged) {
@ -457,7 +457,7 @@ void drawEuclidean() {
transmatrix View0 = View; transmatrix View0 = View;
ld cellrad = vid.radius / (EUCSCALE + vid.alpha); ld cellrad = vid.radius / (1 + vid.alpha);
ld centerd = matrixnorm(View0); ld centerd = matrixnorm(View0);
@ -641,7 +641,6 @@ transmatrix atscreenpos(ld x, ld y, ld size) {
V[0][0] = size * 2 * hcrossf / crossf; V[0][0] = size * 2 * hcrossf / crossf;
V[1][1] = size * 2 * hcrossf / crossf; V[1][1] = size * 2 * hcrossf / crossf;
V[2][2] = stereo::scrdist; V[2][2] = stereo::scrdist;
if(euclid) V[2][2] /= EUCSCALE;
return V; return V;
} }

View File

@ -157,13 +157,7 @@ void addpoint(const hyperpoint& H) {
} }
for(int i=0; i<3; i++) Hscr[i] *= vid.radius; for(int i=0; i<3; i++) Hscr[i] *= vid.radius;
add1(Hscr); 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() { 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; {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); mat[14] = GLfloat(vid.alpha);
if(mat[10] + vid.alpha < 0 && !sphere && !euclid) { if(mat[10] + vid.alpha < 0 && !sphere && !euclid) {

View File

@ -435,12 +435,10 @@ void buildTorusRug() {
applymodel(tC0(eumove(x, y)), onscreen); applymodel(tC0(eumove(x, y)), onscreen);
// take point (1,0) // take point (1,0)
// apply eumove(1,0) // apply eumove(1,0)
// divide by EUCSCALE
// multiply by vid.radius (= HTEXTURESIZE * rugzoom) // multiply by vid.radius (= HTEXTURESIZE * rugzoom)
// add 1, divide by texturesize // add 1, divide by texturesize
r->x1 = onscreen[0]; r->x1 = onscreen[0];
r->y1 = onscreen[1]; r->y1 = onscreen[1];
// r->y1 = (1 + onscreen[1] * rugzoom / EUCSCALE)/2;
hyperpoint h1 = hpxyz(x, y, 0); hyperpoint h1 = hpxyz(x, y, 0);
hyperpoint h2 = z2 * h1; hyperpoint h2 = z2 * h1;
double alpha = -h2[0] * 2 * M_PI; double alpha = -h2[0] * 2 * M_PI;