diff --git a/cell.cpp b/cell.cpp index 5854c9a0..91b067d0 100644 --- a/cell.cpp +++ b/cell.cpp @@ -12,8 +12,6 @@ int dirdiff(int dd, int t) { return dd; } -int fixdir(int a, cell *c) { a %= c->type; if(a<0) a += c->type; return a; } - int cellcount = 0; void initcell(cell *c); // from game.cpp diff --git a/control.cpp b/control.cpp index 994d5061..7fb26315 100644 --- a/control.cpp +++ b/control.cpp @@ -142,13 +142,13 @@ void calcMousedest() { for(int i=0; itype; i++) if(dists[i] < mousedist) { mousedist = dists[i]; - mousedest.d = fixdir(i - cwt.spin, cwt.at); + mousedest.d = cwt.at->c.fix(i - cwt.spin); mousedest.subdir = - dists[(i+1)%cwt.at->type] < dists[(i+cwt.at->type-1)%cwt.at->type] ? 1 : -1; + dists[cwt.at->c.fix(i+1)] < dists[cwt.at->c.fix(i-1)] ? 1 : -1; if(cwt.mirrored) - mousedest.d = fixdir(-mousedest.d, cwt.at), + mousedest.d = cwt.at->c.fix(-mousedest.d), mousedest.subdir = -mousedest.subdir; } diff --git a/floorshapes.cpp b/floorshapes.cpp index 4228a093..6a97e593 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -346,8 +346,8 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i for(int i=0; itype, 3.1))); + ri = c->c.fix(ri); + cornerlist.push_back(mid(get_corner_position(c, ri, 3.1), get_corner_position(c, c->c.fix(ri+1), 3.1))); } } } @@ -360,7 +360,7 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i for(int i=0; ic.fix(ri); hyperpoint nc = nearcorner(c, ri); cornerlist.push_back(mid_at(hpxy(0,0), nc, .94)); } @@ -701,8 +701,8 @@ namespace gp { siid = si.id>>2; // if(siid == 2) si.dir++; // if(siid != pattern_threecolor(c)) printf("threecolor mismatch\n"); - // if(pattern_threecolor(createMov(c, fixdir(si.dir, c))) != (siid+1)%3) printf("threecolor mismatch direction\n"); - sidir = fixdir(si.dir, c); + // if(pattern_threecolor(createMov(c, c->fixd(si.dir))) != (siid+1)%3) printf("threecolor mismatch direction\n"); + sidir = c->c.fix(si.dir); } else if(geosupport_football() == 2) { siid = !pseudohept(c); diff --git a/goldberg.cpp b/goldberg.cpp index 8ce370b7..e0680684 100644 --- a/goldberg.cpp +++ b/goldberg.cpp @@ -232,8 +232,8 @@ namespace hr { namespace gp { } // c move 0 equals c' move spin(0) extend_map(c, d); - extend_map(c, fixdir(d-1, c)); - extend_map(c, fixdir(d+1, c)); + extend_map(c, c->c.fix(d-1)); + extend_map(c, c->c.fix(d+1)); if(S3 == 4 && !c->move(d)) for(int i=0; imaster, i)->c7); - auto d1 = master_function(createStep(cm->master, fixdir(i+1, cm))->c7); + auto d1 = master_function(createStep(cm->master, cm->c.fix(i+1))->c7); if(S3 == 4) { heptspin hs(cm->master, i); diff --git a/hyper.h b/hyper.h index 2519e450..8a73d9fb 100644 --- a/hyper.h +++ b/hyper.h @@ -4131,7 +4131,6 @@ struct hpcshape { extern vector shPlainWall3D, shWireframe3D, shWall3D, shMiniWall3D; #endif -int fixdir(int a, cell *c); cell *newCell(int type, heptagon *master); extern color_t qpixel_pixel_outside; diff --git a/mapeditor.cpp b/mapeditor.cpp index bd65bc8a..74e239eb 100644 --- a/mapeditor.cpp +++ b/mapeditor.cpp @@ -895,7 +895,7 @@ namespace mapeditor { for(cell* c2: cl.lst) { auto si2 = patterns::getpatterninfo0(c2); if(si2.id == si.id) { - editAt(cellwalker(c2, cdir>=0 ? fixdir(cdir + si2.dir, c2) : -1), cl); + editAt(cellwalker(c2, cdir>=0 ? cdir + si2.dir : -1), cl); modelcell[si2.id] = c2; } } diff --git a/pattern2.cpp b/pattern2.cpp index 9bee2a68..120ed287 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -921,8 +921,8 @@ namespace patterns { #endif #if CAP_GP else if(GOLDBERG) { - if(c == c->master->c7) si.id += (fixdir(si.dir, c) << 8); - else si.id += (get_code(gp::get_local_info(c)) << 16) | (fixdir(si.dir, c) << 8); + if(c == c->master->c7) si.id += (c->c.fix(si.dir) << 8); + else si.id += (get_code(gp::get_local_info(c)) << 16) | (c->c.fix(si.dir) << 8); } #endif return si;