diff --git a/cell.cpp b/cell.cpp index 3fde1a37..2df610a0 100644 --- a/cell.cpp +++ b/cell.cpp @@ -5,9 +5,6 @@ namespace hr { -int fix6(int a) { return (a+MODFIXER)%S6; } -int fix7(int a) { return (a+MODFIXER)%S7; } - int dirdiff(int dd, int t) { dd %= t; if(dd<0) dd += t; diff --git a/floorshapes.cpp b/floorshapes.cpp index 29c340ae..4228a093 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -712,7 +712,7 @@ namespace gp { siid = 0; sidir = 0; } - auto& id = pshid[siid][sidir][draw_li.relative.first&31][draw_li.relative.second&31][fix6(draw_li.total_dir)]; + auto& id = pshid[siid][sidir][draw_li.relative.first&31][draw_li.relative.second&31][gmod(draw_li.total_dir, S6)]; if(id == -1 && sphere && isize(cgi.shFloor.b) > 0) { forCellEx(c1, c) if(!gmatrix0.count(c1)) return 0; } diff --git a/geometry2.cpp b/geometry2.cpp index 578e1d9d..9aec1546 100644 --- a/geometry2.cpp +++ b/geometry2.cpp @@ -184,7 +184,7 @@ transmatrix calc_relative_matrix_help(cell *c, heptagon *h1) { #if CAP_GP else if(GOLDBERG && c != c->master->c7) { auto li = gp::get_local_info(c); - where = cgi.gpdata->Tf[li.last_dir][li.relative.first&31][li.relative.second&31][fix6(li.total_dir)]; + where = cgi.gpdata->Tf[li.last_dir][li.relative.first&31][li.relative.second&31][gmod(li.total_dir, S6)]; } #endif else if(BITRUNCATED) for(int d=0; dc7->move(d) == c) diff --git a/goldberg.cpp b/goldberg.cpp index be3bf5d4..8ce370b7 100644 --- a/goldberg.cpp +++ b/goldberg.cpp @@ -763,7 +763,7 @@ namespace hr { namespace gp { goto again; } if(sp>SG3) sp -= SG6; - li.last_dir = fix7(li.last_dir - sp); + li.last_dir = gmod(li.last_dir - sp, S7); } // from some point X, (0,0) is in distance dmain, param is in distance d0, and param*z is in distance d1 @@ -874,7 +874,7 @@ namespace hr { namespace gp { be_in_triangle(li); auto cm = c->master; int i = li.last_dir; - return make_array(cm, createStep(cm, i), createStep(cm, fix7(i+1))); + return make_array(cm, cm->cmove(i), cm->cmodmove(i+1)); } #endif #if CAP_IRR diff --git a/hyper.h b/hyper.h index 4142884b..e6e7102e 100644 --- a/hyper.h +++ b/hyper.h @@ -4133,8 +4133,6 @@ struct hpcshape { extern vector shPlainWall3D, shWireframe3D, shWall3D, shMiniWall3D; #endif -int fix6(int a); -int fix7(int a); int fixdir(int a, cell *c); cell *newCell(int type, heptagon *master); extern color_t qpixel_pixel_outside; diff --git a/hypgraph.cpp b/hypgraph.cpp index 2b608d00..b5cc1443 100644 --- a/hypgraph.cpp +++ b/hypgraph.cpp @@ -978,7 +978,7 @@ void drawrec(cell *c, const transmatrix& V) { transmatrix V1 = V * cgi.gpdata->Tf[draw_li.last_dir][at.first&31][at.second&31][fixg6(dir)]; if(do_draw(c, V1)) { /* auto li = get_local_info(c); - if(fix6(dir) != fix6(li.total_dir)) printf("totaldir %d/%d\n", dir, li.total_dir); + if((dir - li.total_dir) % S6) printf("totaldir %d/%d\n", dir, li.total_dir); if(at != li.relative) printf("at %s/%s\n", disp(at), disp(li.relative)); if(maindir != li.last_dir) printf("ld %d/%d\n", maindir, li.last_dir); */ draw_li.relative = at; @@ -1163,7 +1163,7 @@ transmatrix eumovedir(int d) { } } else { - d = fix6(d); + d = gmod(d, S6); switch(d) { case 0: return eumove(1,0); case 1: return eumove(0,1); diff --git a/pattern2.cpp b/pattern2.cpp index 9b81b119..9bee2a68 100644 --- a/pattern2.cpp +++ b/pattern2.cpp @@ -876,7 +876,7 @@ namespace patterns { } } - if(GOLDBERG && has_nice_dual() && !ishept(c) && ishex1(c)) si.dir = fix6(si.dir+3); + if(GOLDBERG && has_nice_dual() && !ishept(c) && ishex1(c)) si.dir = gmod(si.dir+3, S6); } ePattern whichPattern = PAT_NONE; @@ -1194,9 +1194,9 @@ int pattern_threecolor(cell *c) { if(rel == 0) return pattern_threecolor(c->master->c7); else if(rel == par) - return pattern_threecolor(createStep(c->master, li.last_dir)->c7); + return pattern_threecolor(c->master->cmove(li.last_dir)->c7); else - return pattern_threecolor(createStep(c->master, fix7(li.last_dir+1))->c7); + return pattern_threecolor(c->master->cmodmove(li.last_dir+1)->c7); } #endif if(a38) { diff --git a/rogueviz-kohonen.cpp b/rogueviz-kohonen.cpp index 88c310b4..3a5649fa 100644 --- a/rogueviz-kohonen.cpp +++ b/rogueviz-kohonen.cpp @@ -423,7 +423,7 @@ pair get_cellcrawler_id(cell *c) { #if CAP_GP if(GOLDBERG) { gp::local_info li = gp::get_local_info(c); - id = (li.relative.first & 15) + (li.relative.second & 15) * 16 + fix6(li.total_dir) * 256; + id = (li.relative.first & 15) + (li.relative.second & 15) * 16 + gmod(li.total_dir, S6) * 256; // ld = li.last_dir; } #else