mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-04-01 00:07:02 +00:00
preliminary floorshape remapping to syntetic
This commit is contained in:
parent
7064dace81
commit
7fa3de574e
@ -285,7 +285,7 @@ void generate_floorshapes_for(int id, cell *c, int siid, int sidir) {
|
|||||||
for(auto pfsh: all_plain_floorshapes) {
|
for(auto pfsh: all_plain_floorshapes) {
|
||||||
auto& fsh = *pfsh;
|
auto& fsh = *pfsh;
|
||||||
|
|
||||||
if(!gp::on && !irr::on) {
|
if(!gp::on && !irr::on && !syntetic) {
|
||||||
|
|
||||||
// standard and binary
|
// standard and binary
|
||||||
ld hexside = fsh.rad0, heptside = fsh.rad1;
|
ld hexside = fsh.rad0, heptside = fsh.rad1;
|
||||||
@ -400,7 +400,7 @@ void generate_floorshapes_for(int id, cell *c, int siid, int sidir) {
|
|||||||
|
|
||||||
sizeto(fsh.b, id);
|
sizeto(fsh.b, id);
|
||||||
|
|
||||||
if(!gp::on && !irr::on && !binarytiling) {
|
if(!gp::on && !irr::on && !binarytiling && !syntetic) {
|
||||||
generate_matrices_scale(fsh.scale, fsh.noftype);
|
generate_matrices_scale(fsh.scale, fsh.noftype);
|
||||||
if(nonbitrunc && geosupport_graveyard() < 2 && fsh.shapeid2) {
|
if(nonbitrunc && geosupport_graveyard() < 2 && fsh.shapeid2) {
|
||||||
if(id == 0) bshape2(fsh.b[0], fsh.prio, fsh.shapeid2, hept_matrices);
|
if(id == 0) bshape2(fsh.b[0], fsh.prio, fsh.shapeid2, hept_matrices);
|
||||||
@ -474,6 +474,18 @@ void generate_floorshapes() {
|
|||||||
|
|
||||||
else if(gp::on) { /* will be generated on the fly */ }
|
else if(gp::on) { /* will be generated on the fly */ }
|
||||||
|
|
||||||
|
else if(syntetic) {
|
||||||
|
heptagon master;
|
||||||
|
cell model;
|
||||||
|
model.master = &master;
|
||||||
|
synt::parent_index_of(&master) = 0;
|
||||||
|
for(int i=0; i<2*synt::N + (nonbitrunc ? 0 : 2); i++) {
|
||||||
|
synt::id_of(&master) = i;
|
||||||
|
model.type = isize(synt::triangles[i]);
|
||||||
|
generate_floorshapes_for(i, &model, i >= 2*synt::N, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
cell model;
|
cell model;
|
||||||
model.type = S6; generate_floorshapes_for(0, &model, 0, 0);
|
model.type = S6; generate_floorshapes_for(0, &model, 0, 0);
|
||||||
@ -592,6 +604,8 @@ void draw_shapevec(cell *c, const transmatrix& V, const vector<hpcshape> &shv, i
|
|||||||
queuepolyat(V, shv[pseudohept(c)], col, prio);
|
queuepolyat(V, shv[pseudohept(c)], col, prio);
|
||||||
else if(binarytiling)
|
else if(binarytiling)
|
||||||
queuepolyat(V, shv[c->type-6], col, prio);
|
queuepolyat(V, shv[c->type-6], col, prio);
|
||||||
|
else if(syntetic)
|
||||||
|
queuepolyat(V, shv[synt::id_of(c->master)], col, prio);
|
||||||
else
|
else
|
||||||
queuepolyat(V, shv[ctof(c)], col, prio);
|
queuepolyat(V, shv[ctof(c)], col, prio);
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,10 @@ void precalc() {
|
|||||||
int vertexdegree = S6/2;
|
int vertexdegree = S6/2;
|
||||||
ld fmin, fmax;
|
ld fmin, fmax;
|
||||||
|
|
||||||
if(syntetic) return;
|
if(syntetic) {
|
||||||
|
synt::prepare();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(euclid) {
|
if(euclid) {
|
||||||
// dynamicval<eGeometry> g(geometry, gNormal);
|
// dynamicval<eGeometry> g(geometry, gNormal);
|
||||||
|
@ -356,6 +356,10 @@ hyperpoint get_corner_position(cell *c, int cid, ld cf) {
|
|||||||
vertices[6] = get_horopoint(-yy, 0);
|
vertices[6] = get_horopoint(-yy, 0);
|
||||||
return mid_at_actual(vertices[cid], 3/cf);
|
return mid_at_actual(vertices[cid], 3/cf);
|
||||||
}
|
}
|
||||||
|
if(syntetic) {
|
||||||
|
int id = synt::id_of(c->master);
|
||||||
|
return spin(M_PI / c->type * (2*cid+0)) * xpush(synt::circumradius[id/2] * 3 / cf) * C0;
|
||||||
|
}
|
||||||
if(nonbitrunc) {
|
if(nonbitrunc) {
|
||||||
return ddspin(c,cid,S6) * xpush0(hcrossf * 3 / cf);
|
return ddspin(c,cid,S6) * xpush0(hcrossf * 3 / cf);
|
||||||
}
|
}
|
||||||
@ -394,6 +398,7 @@ hyperpoint midcorner(cell *c, int i, ld v) {
|
|||||||
hyperpoint nlfar = rel * vs2.vertices[(spin+2)%cor2];
|
hyperpoint nlfar = rel * vs2.vertices[(spin+2)%cor2];
|
||||||
return mid_at(nfar, nlfar, .49);
|
return mid_at(nfar, nlfar, .49);
|
||||||
}
|
}
|
||||||
|
if(syntetic) return C0;
|
||||||
printf("midcorner not handled\n");
|
printf("midcorner not handled\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
@ -411,6 +416,11 @@ hyperpoint nearcorner(cell *c, int i) {
|
|||||||
hyperpoint nc = vs.jpoints[vs.neid[i]];
|
hyperpoint nc = vs.jpoints[vs.neid[i]];
|
||||||
return mid_at(C0, nc, .94);
|
return mid_at(C0, nc, .94);
|
||||||
}
|
}
|
||||||
|
if(syntetic) {
|
||||||
|
int id = synt::id_of(c->master);
|
||||||
|
auto& t1 = synt::triangles[id][i];
|
||||||
|
return spin(-t1.first) * xpush(t1.second) * C0;
|
||||||
|
}
|
||||||
if(binarytiling) {
|
if(binarytiling) {
|
||||||
ld yx = log(2) / 2;
|
ld yx = log(2) / 2;
|
||||||
ld yy = yx;
|
ld yy = yx;
|
||||||
@ -456,7 +466,7 @@ hyperpoint farcorner(cell *c, int i, int which) {
|
|||||||
if(which == 0) return rel * vs2.vertices[(spin+2)%cor2];
|
if(which == 0) return rel * vs2.vertices[(spin+2)%cor2];
|
||||||
if(which == 1) return rel * vs2.vertices[(spin+cor2-1)%cor2];
|
if(which == 1) return rel * vs2.vertices[(spin+cor2-1)%cor2];
|
||||||
}
|
}
|
||||||
if(binarytiling)
|
if(binarytiling || syntetic)
|
||||||
return nearcorner(c, (i+which) % c->type); // lazy
|
return nearcorner(c, (i+which) % c->type); // lazy
|
||||||
printf("farcorner not handled\n");
|
printf("farcorner not handled\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
@ -3190,7 +3190,7 @@ bool placeSidewall(cell *c, int i, int sidepar, const transmatrix& V, int col) {
|
|||||||
|
|
||||||
transmatrix V2 = V * ddspin(c, i);
|
transmatrix V2 = V * ddspin(c, i);
|
||||||
|
|
||||||
if(gp::on || irr::on || binarytiling) {
|
if(gp::on || irr::on || binarytiling || syntetic) {
|
||||||
draw_shapevec(c, V2, qfi.fshape->gpside[sidepar][i], col, prio);
|
draw_shapevec(c, V2, qfi.fshape->gpside[sidepar][i], col, prio);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -239,8 +239,6 @@ void prepare() {
|
|||||||
|
|
||||||
void initialize(heptagon *h) {
|
void initialize(heptagon *h) {
|
||||||
|
|
||||||
prepare();
|
|
||||||
|
|
||||||
/* initialize the root */
|
/* initialize the root */
|
||||||
|
|
||||||
parent_index_of(h) = 0;
|
parent_index_of(h) = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user