1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-04-07 03:07:01 +00:00

removed functions fix6 and fix7

This commit is contained in:
Zeno Rogue 2019-08-09 14:12:33 +02:00
parent 0e57fd1cc0
commit ef89c7ed9d
8 changed files with 10 additions and 15 deletions

View File

@ -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;

View File

@ -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;
}

View File

@ -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; d<S7; d++) if(h2->c7->move(d) == c)

View File

@ -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

View File

@ -4133,8 +4133,6 @@ struct hpcshape {
extern vector<hpcshape> 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;

View File

@ -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);

View File

@ -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) {

View File

@ -423,7 +423,7 @@ pair<int, int> 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