fixed the warnings about comparing int and bool

This commit is contained in:
Zeno Rogue 2018-07-07 11:05:48 +02:00
parent 8b35bf6d4b
commit 98ea11de86
5 changed files with 11 additions and 9 deletions

View File

@ -3461,7 +3461,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
// 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;
if(dist0 < geom3::highdetail) detaillevel = 2;

View File

@ -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 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 fix42(int a) { return (a+MODFIXER)% S42; }
@ -325,7 +325,7 @@ struct heptagon {
// we are spin[i]-th neighbor of move[i]
uint32_t spintable;
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); }
// neighbors; move[0] always goes towards origin,
// and then we go clockwise
@ -373,7 +373,7 @@ struct cell : gcell {
uint32_t spintable;
int spin(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;
cell *mov[MAX_EDGE]; // meaning very similar to heptagon::move

View File

@ -1318,11 +1318,12 @@ namespace mapeditor {
printf("vernum = %x\n", vernum);
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);
patterns::whichPattern = wp;
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();
}
@ -1767,7 +1768,7 @@ namespace mapeditor {
if(gstate == 1) queueline(lpsm, P2, 0x90000080), gstate = 0;
if(ti == ew.pointid) {
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;
}
}

View File

@ -624,7 +624,7 @@ namespace patterns {
int sp = c->spin(0);
if(gp::on) {
sp = gp::last_dir(c);
sp ^= ishex2(c);
sp ^= int(ishex2(c));
}
if(geometry == gBolza2 && (!gp::on || gp_threecolor() == 2)) {
patterninfo si0;
@ -666,7 +666,7 @@ namespace patterns {
int sp2 = c2->spin(0);
if(gp::on) {
sp2 = gp::last_dir(c2);
sp2 ^= ishex2(c2);
sp2 ^= int(ishex2(c2));
}
id2 = 8 * ((c2->master->fiftyval & 1) ^ (sp2 & 1));
}

View File

@ -3399,6 +3399,7 @@ transmatrix calc_relative_matrix(cell *c2, cell *c1, int direction_hint) {
// always add to last!
//bool hsol = false;
//transmatrix sol;
while(h1 != h2) {
if(quotient & qSMALL) {
transmatrix T;