1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-18 06:35:12 +00:00

irregular grids

This commit is contained in:
Zeno Rogue
2018-07-16 20:05:23 +02:00
parent 4320119d02
commit c8c1e3a346
19 changed files with 829 additions and 84 deletions

View File

@@ -486,6 +486,8 @@ ld master_to_c7_angle() {
}
transmatrix actualV(const heptspin& hs, const transmatrix& V) {
if(irr::on)
return V * spin(M_PI + 2 * M_PI / S7 * (hs.spin + irr::periodmap[hs.h].base.spin));
return (hs.spin || nonbitrunc) ? V * spin(hs.spin*2*M_PI/S7 + master_to_c7_angle()) : V;
}
@@ -564,10 +566,22 @@ void drawrec(const heptspin& hs, hstate s, const transmatrix& V) {
transmatrix V10;
const transmatrix& V1 = hs.mirrored ? (V10 = V * Mirror) : V;
bool draw = c->pathdist < PINFD;
if(gp::on) {
gp::drawrec(c, actualV(hs, V1));
}
else if(irr::on) {
auto& hi = irr::periodmap[hs.h];
transmatrix V0 = actualV(hs, V1);
auto& vc = irr::cells_of_heptagon[hi.base.h];
for(int i=0; i<isize(vc); i++)
if(dodrawcell(hi.subcells[i]) && in_qrange(V0 * irr::cells[vc[i]].pusher))
draw = true,
drawcell(hi.subcells[i], V0 * irr::cells[vc[i]].pusher, 0, false);
}
else {
if(dodrawcell(c)) {
transmatrix V2 = actualV(hs, V1);
@@ -585,7 +599,7 @@ void drawrec(const heptspin& hs, hstate s, const transmatrix& V) {
}
}
if(c->pathdist < PINFD && in_qrange(V)) for(int d=0; d<S7; d++) {
if(draw && in_qrange(V)) for(int d=0; d<S7; d++) {
hstate s2 = transition(s, d);
if(s2 == hsError) continue;
heptspin hs2 = hs + d + wstep;