mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-30 07:29:54 +00:00
replaced some instances of double to ld, so that everything compiles when ld is redefined to float
This commit is contained in:
parent
aefea03ce1
commit
6e26508a77
@ -353,7 +353,7 @@ struct debugScreen {
|
|||||||
dialog::addSelItem("land param (hex)", itsh8(what->landparam), 0);
|
dialog::addSelItem("land param (hex)", itsh8(what->landparam), 0);
|
||||||
dialog::addSelItem("land param (heat)", fts(HEAT(what)), 't');
|
dialog::addSelItem("land param (heat)", fts(HEAT(what)), 't');
|
||||||
dialog::add_action([what] () {
|
dialog::add_action([what] () {
|
||||||
static double d = HEAT(what);
|
static ld d = HEAT(what);
|
||||||
dialog::editNumber(d, -2, 2, 0.1, d, "landparam",
|
dialog::editNumber(d, -2, 2, 0.1, d, "landparam",
|
||||||
"Extra value that is important in some lands. The specific meaning depends on the land.");
|
"Extra value that is important in some lands. The specific meaning depends on the land.");
|
||||||
dialog::reaction = [what] () { HEAT(what) = d; };
|
dialog::reaction = [what] () { HEAT(what) = d; };
|
||||||
|
@ -2610,7 +2610,7 @@ void drawaura() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if CAP_SDL || CAP_GL
|
#if CAP_SDL || CAP_GL
|
||||||
double bak[3];
|
ld bak[3];
|
||||||
bak[0] = ((backcolor>>16)&255)/255.;
|
bak[0] = ((backcolor>>16)&255)/255.;
|
||||||
bak[1] = ((backcolor>>8)&255)/255.;
|
bak[1] = ((backcolor>>8)&255)/255.;
|
||||||
bak[2] = ((backcolor>>0)&255)/255.;
|
bak[2] = ((backcolor>>0)&255)/255.;
|
||||||
@ -2639,14 +2639,14 @@ void drawaura() {
|
|||||||
if(alpha >= AURA) alpha -= AURA;
|
if(alpha >= AURA) alpha -= AURA;
|
||||||
|
|
||||||
int rm = int(alpha);
|
int rm = int(alpha);
|
||||||
double fr = alpha-rm;
|
ld fr = alpha-rm;
|
||||||
|
|
||||||
if(rm<0 || rm >= AURA) continue;
|
if(rm<0 || rm >= AURA) continue;
|
||||||
|
|
||||||
color_t& p = qpixel(s, x, y);
|
color_t& p = qpixel(s, x, y);
|
||||||
for(int c=0; c<3; c++) {
|
for(int c=0; c<3; c++) {
|
||||||
double c1 = aurac[rm][2-c] / (aurac[rm][3]+.1);
|
ld c1 = aurac[rm][2-c] / (aurac[rm][3]+.1);
|
||||||
double c2 = aurac[rm+1][2-c] / (aurac[rm+1][3]+.1);
|
ld c2 = aurac[rm+1][2-c] / (aurac[rm+1][3]+.1);
|
||||||
const ld one = 1;
|
const ld one = 1;
|
||||||
part(p, c) = int(255 * min(one, bak[2-c] + cmul * ((c1 + fr * (c2-c1) - bak[2-c]))));
|
part(p, c) = int(255 * min(one, bak[2-c] + cmul * ((c1 + fr * (c2-c1) - bak[2-c]))));
|
||||||
}
|
}
|
||||||
|
4
hyper.h
4
hyper.h
@ -1339,7 +1339,7 @@ namespace rug {
|
|||||||
|
|
||||||
struct edge {
|
struct edge {
|
||||||
struct rugpoint *target;
|
struct rugpoint *target;
|
||||||
double len;
|
ld len;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dexp_data {
|
struct dexp_data {
|
||||||
@ -3331,7 +3331,7 @@ transmatrix rgpushxto0(const hyperpoint& H);
|
|||||||
|
|
||||||
string its(int i);
|
string its(int i);
|
||||||
|
|
||||||
double hdist0(const hyperpoint& mh);
|
ld hdist0(const hyperpoint& mh);
|
||||||
|
|
||||||
extern bool fading;
|
extern bool fading;
|
||||||
extern ld fadeout;
|
extern ld fadeout;
|
||||||
|
@ -584,7 +584,7 @@ transmatrix inverse(const transmatrix& T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// distance between mh and 0
|
// distance between mh and 0
|
||||||
double hdist0(const hyperpoint& mh) {
|
ld hdist0(const hyperpoint& mh) {
|
||||||
switch(cgclass) {
|
switch(cgclass) {
|
||||||
case gcHyperbolic:
|
case gcHyperbolic:
|
||||||
if(mh[DIM] < 1) return 0;
|
if(mh[DIM] < 1) return 0;
|
||||||
@ -616,7 +616,7 @@ ld circlelength(ld r) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// distance between two points
|
// distance between two points
|
||||||
double hdist(const hyperpoint& h1, const hyperpoint& h2) {
|
ld hdist(const hyperpoint& h1, const hyperpoint& h2) {
|
||||||
// return hdist0(gpushxto0(h1) * h2);
|
// return hdist0(gpushxto0(h1) * h2);
|
||||||
ld iv = intval(h1, h2);
|
ld iv = intval(h1, h2);
|
||||||
switch(cgclass) {
|
switch(cgclass) {
|
||||||
|
@ -691,7 +691,7 @@ void dqi_poly::gldraw() {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
double scale_at(const transmatrix& T) {
|
ld scale_at(const transmatrix& T) {
|
||||||
if(DIM == 3 && pmodel == mdPerspective) return 1 / (tC0(T))[2];
|
if(DIM == 3 && pmodel == mdPerspective) return 1 / (tC0(T))[2];
|
||||||
using namespace hyperpoint_vec;
|
using namespace hyperpoint_vec;
|
||||||
hyperpoint h1, h2, h3;
|
hyperpoint h1, h2, h3;
|
||||||
@ -701,7 +701,7 @@ double scale_at(const transmatrix& T) {
|
|||||||
return sqrt(hypot_d(2, h2-h1) * hypot_d(2, h3-h1) / .0001);
|
return sqrt(hypot_d(2, h2-h1) * hypot_d(2, h3-h1) / .0001);
|
||||||
}
|
}
|
||||||
|
|
||||||
double linewidthat(const hyperpoint& h) {
|
ld linewidthat(const hyperpoint& h) {
|
||||||
if(!(vid.antialias & AA_LINEWIDTH)) return 1;
|
if(!(vid.antialias & AA_LINEWIDTH)) return 1;
|
||||||
else if(hyperbolic && pmodel == mdDisk && vid.alpha == 1) {
|
else if(hyperbolic && pmodel == mdDisk && vid.alpha == 1) {
|
||||||
double dz = h[DIM];
|
double dz = h[DIM];
|
||||||
|
2
rug.cpp
2
rug.cpp
@ -1029,7 +1029,7 @@ void addNewPoints() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
double dist = hdist0(points[qvalid]->h) + .1e-6;
|
ld dist = hdist0(points[qvalid]->h) + .1e-6;
|
||||||
|
|
||||||
int oqvalid = qvalid;
|
int oqvalid = qvalid;
|
||||||
|
|
||||||
|
@ -1418,8 +1418,8 @@ hyperpoint keytarget(int i) {
|
|||||||
return 0;
|
return 0;
|
||||||
} */
|
} */
|
||||||
|
|
||||||
double getSwordSize() { return sword_size; }
|
ld getSwordSize() { return sword_size; }
|
||||||
double getHornsSize() { return scalefactor * 0.33; }
|
ld getHornsSize() { return scalefactor * 0.33; }
|
||||||
|
|
||||||
// used in 3D
|
// used in 3D
|
||||||
transmatrix swordmatrix[MAXPLAYER];
|
transmatrix swordmatrix[MAXPLAYER];
|
||||||
|
2
util.cpp
2
util.cpp
@ -167,7 +167,7 @@ cld exp_parser::parse(int prio) {
|
|||||||
else if(eat("conj(")) res = std::conj(parsepar());
|
else if(eat("conj(")) res = std::conj(parsepar());
|
||||||
else if(eat("floor(")) res = floor(real(parsepar()));
|
else if(eat("floor(")) res = floor(real(parsepar()));
|
||||||
else if(eat("frac(")) { res = parsepar(); res = res - floor(real(res)); }
|
else if(eat("frac(")) { res = parsepar(); res = res - floor(real(res)); }
|
||||||
else if(eat("to01(")) { res = parsepar(); return atan(res) / M_PI + 0.5; }
|
else if(eat("to01(")) { res = parsepar(); return atan(res) / ld(M_PI) + ld(0.5); }
|
||||||
else if(eat("ifp(")) {
|
else if(eat("ifp(")) {
|
||||||
cld cond = parse(0);
|
cld cond = parse(0);
|
||||||
if(next() != ',') {at = -1; return 0; } at++;
|
if(next() != ',') {at = -1; return 0; } at++;
|
||||||
|
Loading…
Reference in New Issue
Block a user