diff --git a/graph.cpp b/graph.cpp index e01f5dc7..bcf4e9b3 100644 --- a/graph.cpp +++ b/graph.cpp @@ -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; diff --git a/hyper.h b/hyper.h index 208d95c8..8ef3612f 100644 --- a/hyper.h +++ b/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 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 diff --git a/mapeditor.cpp b/mapeditor.cpp index b406c15d..c5642248 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -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; } } diff --git a/pattern2.cpp b/pattern2.cpp index 59d18ce2..7a6b273a 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -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)); } diff --git a/shmup.cpp b/shmup.cpp index fa49d5ab..f5049c2e 100644 --- a/shmup.cpp +++ b/shmup.cpp @@ -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;