From 282b3d79a29ca67ece3d46e8ed591590cdab5e2d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 5 May 2019 17:34:46 +0200 Subject: [PATCH] fixed binary tiling --- archimedean.cpp | 2 +- heptagon.cpp | 5 ++--- hyper.h | 7 +++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/archimedean.cpp b/archimedean.cpp index d4e3732b..fc055114 100644 --- a/archimedean.cpp +++ b/archimedean.cpp @@ -583,7 +583,7 @@ hrmap *new_map() { return new hrmap_archimedean; } heptagon *build_child(heptspin p, pair adj) { indenter ind; - auto h = buildHeptagon1(tailored_alloc (isize(current.adjacent[adj.first])), p.at, p.spin, hstate(1), 0, adj.first); + auto h = buildHeptagon1(tailored_alloc (isize(current.adjacent[adj.first])), p.at, p.spin, hstate(1), 0); SDEBUG( printf("NEW %p.%d ~ %p.0\n", p.at, p.spin, h); ) id_of(h) = adj.first; parent_index_of(h) = adj.second; diff --git a/heptagon.cpp b/heptagon.cpp index 5d982a01..b82243fe 100644 --- a/heptagon.cpp +++ b/heptagon.cpp @@ -62,17 +62,16 @@ hstate transition(hstate s, int dir) { #define COMPUTE -1000000 // create a new heptagon -heptagon *buildHeptagon1(heptagon *h, heptagon *parent, int d, hstate s, int pard = 0, int zv = 0) { +heptagon *buildHeptagon1(heptagon *h, heptagon *parent, int d, hstate s, int pard = 0) { h->alt = NULL; h->s = s; - h->zebraval = zv; 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(tailored_alloc (S7), parent, d, s, pard, fixdistance); + heptagon *h = buildHeptagon1(tailored_alloc (S7), parent, d, s, pard); if(binarytiling || archimedean) return h; if(parent->c7) { #if CAP_IRR diff --git a/hyper.h b/hyper.h index ae89befb..48216c43 100644 --- a/hyper.h +++ b/hyper.h @@ -469,6 +469,7 @@ template T* tailored_alloc(int degree) { #else result = new T; #endif + result->type = degree; for(int i=0; ic.move_table[i] = NULL; return result; } @@ -573,7 +574,9 @@ struct heptagon { // zebra generator (1B actually) short zebraval; // field id - int fieldval; + int fieldval : 24; + // degree + unsigned char type : 8; // data for fractal landscapes short rval0, rval1; // for alternate structures, cdata contains the pointer to the original @@ -592,7 +595,7 @@ struct heptagon { ~heptagon () { heptacount--; } heptagon *cmove(int d) { return createStep(this, d); } heptagon *cmodmove(int d) { return createStep(this, c.fix(d)); } - inline int degree(); + inline int degree() { return type; } // prevent accidental copying heptagon(const heptagon&) = delete;