diff --git a/floorshapes.cpp b/floorshapes.cpp index 261dd76a..0c16f73a 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -247,10 +247,14 @@ void geometry_information::bshape2(hpcshape& sh, PPR prio, int shapeid, matrixli hpcpush(hpc[last->s]); } +template void sizeto(T& t, int n) { + if(isize(t) <= n) t.resize(n+1); + } + void geometry_information::bshape_regular(floorshape &fsh, int id, int sides, int shift, ld size, cell *c) { - fsh.b.resize(2); - fsh.shadow.resize(2); + sizeto(fsh.b, id); + sizeto(fsh.shadow, id); #if CAP_BT if(binarytiling) { @@ -278,7 +282,7 @@ void geometry_information::bshape_regular(floorshape &fsh, int id, int sides, in for(int k=0; ktype; i++) { - fsh.gpside[k][i].resize(2); + sizeto(fsh.gpside[k][i], id); bshape(fsh.gpside[k][i][id], PPR::LAKEWALL); hyperpoint h0 = binary::get_corner_horo_coordinates(c, i) * size; hyperpoint h1 = binary::get_corner_horo_coordinates(c, i+1) * size; @@ -314,10 +318,6 @@ void geometry_information::bshape_regular(floorshape &fsh, int id, int sides, in namespace irr { void generate_floorshapes(); } #endif -template void sizeto(T& t, int n) { - if(isize(t) <= n) t.resize(n+1); - } - // !siid equals pseudohept(c) void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, int sidir) { @@ -339,8 +339,8 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i int b = 0; if(S3 == 4 && BITRUNCATED) b += S14; - if(id == 1) - bshape_regular(fsh, 1, S7, td, heptside, c); + if(id) + bshape_regular(fsh, id, S7, td, heptside, c); else if(PURE) { if(&fsh == &shTriheptaFloor) @@ -615,6 +615,10 @@ void geometry_information::generate_floorshapes() { cell model; model.master = &modelh; model.type = modelh.type = S7; + + auto mmerge1 = [&] (int i, int j) { model.c.setspin(i, j, false); modelh.c.setspin(i, j, false); }; + auto mmerge = [&] (int i, int j) { mmerge1(i, j); mmerge1(j, i); }; + for(int i=0; i