mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-06-26 15:13:19 +00:00
fixed the warnings about comparing int and bool
This commit is contained in:
parent
8b35bf6d4b
commit
98ea11de86
|
@ -3461,7 +3461,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
|
||||||
|
|
||||||
// if(behindsphere(V)) return;
|
// if(behindsphere(V)) return;
|
||||||
|
|
||||||
if(callhandlers(0, hooks_drawcell, c, V)) return;
|
if(callhandlers(false, hooks_drawcell, c, V)) return;
|
||||||
|
|
||||||
ld dist0 = hdist0(tC0(V)) - 1e-6;
|
ld dist0 = hdist0(tC0(V)) - 1e-6;
|
||||||
if(dist0 < geom3::highdetail) detaillevel = 2;
|
if(dist0 < geom3::highdetail) detaillevel = 2;
|
||||||
|
|
6
hyper.h
6
hyper.h
|
@ -308,7 +308,7 @@ struct gcell {
|
||||||
|
|
||||||
inline void tsetspin(uint32_t& t, int d, int spin) { t &= ~(15 << (d<<2)); t |= spin << (d<<2); }
|
inline void tsetspin(uint32_t& t, int d, int spin) { t &= ~(15 << (d<<2)); t |= spin << (d<<2); }
|
||||||
inline int tspin(uint32_t& t, int d) { return (t >> (d<<2)) & 7; }
|
inline int tspin(uint32_t& t, int d) { return (t >> (d<<2)) & 7; }
|
||||||
inline int tmirror(uint32_t& t, int d) { return (t >> ((d<<2)+3)) & 1; }
|
inline bool tmirror(uint32_t& t, int d) { return (t >> ((d<<2)+3)) & 1; }
|
||||||
|
|
||||||
inline int fixrot(int a) { return (a+MODFIXER)% S7; }
|
inline int fixrot(int a) { return (a+MODFIXER)% S7; }
|
||||||
inline int fix42(int a) { return (a+MODFIXER)% S42; }
|
inline int fix42(int a) { return (a+MODFIXER)% S42; }
|
||||||
|
@ -325,7 +325,7 @@ struct heptagon {
|
||||||
// we are spin[i]-th neighbor of move[i]
|
// we are spin[i]-th neighbor of move[i]
|
||||||
uint32_t spintable;
|
uint32_t spintable;
|
||||||
int spin(int d) { return tspin(spintable, d); }
|
int spin(int d) { return tspin(spintable, d); }
|
||||||
int mirror(int d) { return tmirror(spintable, d); }
|
bool mirror(int d) { return tmirror(spintable, d); }
|
||||||
void setspin(int d, int sp) { tsetspin(spintable, d, sp); }
|
void setspin(int d, int sp) { tsetspin(spintable, d, sp); }
|
||||||
// neighbors; move[0] always goes towards origin,
|
// neighbors; move[0] always goes towards origin,
|
||||||
// and then we go clockwise
|
// and then we go clockwise
|
||||||
|
@ -373,7 +373,7 @@ struct cell : gcell {
|
||||||
uint32_t spintable;
|
uint32_t spintable;
|
||||||
int spin(int d) { return tspin(spintable, d); }
|
int spin(int d) { return tspin(spintable, d); }
|
||||||
int spn(int d) { return tspin(spintable, d); }
|
int spn(int d) { return tspin(spintable, d); }
|
||||||
int mirror(int d) { return tmirror(spintable, d); }
|
bool mirror(int d) { return tmirror(spintable, d); }
|
||||||
|
|
||||||
heptagon *master;
|
heptagon *master;
|
||||||
cell *mov[MAX_EDGE]; // meaning very similar to heptagon::move
|
cell *mov[MAX_EDGE]; // meaning very similar to heptagon::move
|
||||||
|
|
|
@ -1318,11 +1318,12 @@ namespace mapeditor {
|
||||||
printf("vernum = %x\n", vernum);
|
printf("vernum = %x\n", vernum);
|
||||||
|
|
||||||
if(vernum >= 0xA0A0) {
|
if(vernum >= 0xA0A0) {
|
||||||
int tg, nt, wp;
|
int tg, wp;
|
||||||
|
int nt;
|
||||||
fscanf(f, "%d%d%d%d\n", &tg, &nt, &wp, &patterns::subpattern_flags);
|
fscanf(f, "%d%d%d%d\n", &tg, &nt, &wp, &patterns::subpattern_flags);
|
||||||
patterns::whichPattern = wp;
|
patterns::whichPattern = wp;
|
||||||
if(tg != geometry) { targetgeometry = eGeometry(tg); stop_game_and_switch_mode(rg::geometry); }
|
if(tg != geometry) { targetgeometry = eGeometry(tg); stop_game_and_switch_mode(rg::geometry); }
|
||||||
if(nt != nonbitrunc) stop_game_and_switch_mode(rg::bitrunc);
|
if(bool(nt) != nonbitrunc) stop_game_and_switch_mode(rg::bitrunc);
|
||||||
start_game();
|
start_game();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1767,7 +1768,7 @@ namespace mapeditor {
|
||||||
if(gstate == 1) queueline(lpsm, P2, 0x90000080), gstate = 0;
|
if(gstate == 1) queueline(lpsm, P2, 0x90000080), gstate = 0;
|
||||||
if(ti == ew.pointid) {
|
if(ti == ew.pointid) {
|
||||||
queueline(pseudomouse, P2, 0xF0000080);
|
queueline(pseudomouse, P2, 0xF0000080);
|
||||||
if(ew.side == b) queueline(pseudomouse, Plast, 0x90000080);
|
if(ew.side == (b==1)) queueline(pseudomouse, Plast, 0x90000080);
|
||||||
else gstate = 1, lpsm = pseudomouse;
|
else gstate = 1, lpsm = pseudomouse;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -624,7 +624,7 @@ namespace patterns {
|
||||||
int sp = c->spin(0);
|
int sp = c->spin(0);
|
||||||
if(gp::on) {
|
if(gp::on) {
|
||||||
sp = gp::last_dir(c);
|
sp = gp::last_dir(c);
|
||||||
sp ^= ishex2(c);
|
sp ^= int(ishex2(c));
|
||||||
}
|
}
|
||||||
if(geometry == gBolza2 && (!gp::on || gp_threecolor() == 2)) {
|
if(geometry == gBolza2 && (!gp::on || gp_threecolor() == 2)) {
|
||||||
patterninfo si0;
|
patterninfo si0;
|
||||||
|
@ -666,7 +666,7 @@ namespace patterns {
|
||||||
int sp2 = c2->spin(0);
|
int sp2 = c2->spin(0);
|
||||||
if(gp::on) {
|
if(gp::on) {
|
||||||
sp2 = gp::last_dir(c2);
|
sp2 = gp::last_dir(c2);
|
||||||
sp2 ^= ishex2(c2);
|
sp2 ^= int(ishex2(c2));
|
||||||
}
|
}
|
||||||
id2 = 8 * ((c2->master->fiftyval & 1) ^ (sp2 & 1));
|
id2 = 8 * ((c2->master->fiftyval & 1) ^ (sp2 & 1));
|
||||||
}
|
}
|
||||||
|
|
|
@ -3399,6 +3399,7 @@ transmatrix calc_relative_matrix(cell *c2, cell *c1, int direction_hint) {
|
||||||
// always add to last!
|
// always add to last!
|
||||||
//bool hsol = false;
|
//bool hsol = false;
|
||||||
//transmatrix sol;
|
//transmatrix sol;
|
||||||
|
|
||||||
while(h1 != h2) {
|
while(h1 != h2) {
|
||||||
if(quotient & qSMALL) {
|
if(quotient & qSMALL) {
|
||||||
transmatrix T;
|
transmatrix T;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user