From 6ebd8ab9da4f0f4255af90d01ef0b9a7e9fda297 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 18 Aug 2018 17:43:54 +0200 Subject: [PATCH] split buildHeptagon to buildHeptagon1 and rest --- binary-tiling.cpp | 2 +- heptagon.cpp | 8 ++++++-- syntetic.cpp | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/binary-tiling.cpp b/binary-tiling.cpp index c32334a0..112fde6d 100644 --- a/binary-tiling.cpp +++ b/binary-tiling.cpp @@ -77,7 +77,7 @@ namespace binary { } heptagon *build(heptagon *parent, int d, int d1, int t, int side, int delta) { - auto h = buildHeptagon(parent, d, hsOrigin, d1); + auto h = buildHeptagon1(new heptagon, parent, d, hsOrigin, d1); h->distance = parent->distance + delta; h->c7 = newCell(t, h); h->cdata = NULL; diff --git a/heptagon.cpp b/heptagon.cpp index 1d6b1860..c9eb3dd7 100644 --- a/heptagon.cpp +++ b/heptagon.cpp @@ -66,13 +66,17 @@ template auto iprintf(T... t) { for(int i=0; ialt = NULL; h->s = s; h->c.clear(); h->c.connect(pard, parent, d, false); h->cdata = NULL; + return h; + } + +heptagon *buildHeptagon(heptagon *parent, int d, hstate s, int pard = 0, int fixdistance = COMPUTE) { + heptagon *h = buildHeptagon1(new heptagon, parent, d, s, pard, fixdistance); if(binarytiling || syntetic) return h; if(parent->c7) { if(irr::on) diff --git a/syntetic.cpp b/syntetic.cpp index e0b71077..92c41eda 100644 --- a/syntetic.cpp +++ b/syntetic.cpp @@ -289,7 +289,7 @@ void debug(heptagon *h) { heptagon *build_child(heptagon *parent, int d, int id, int pindex) { indenter ind; - auto h = buildHeptagon(parent, d, hstate(1), 0); + auto h = buildHeptagon1(new heptagon, parent, d, hstate(1), 0); id_of(h) = id; parent_index_of(h) = pindex; int nei = neighbors_of(h);