fixed binary tiling

This commit is contained in:
Zeno Rogue 2019-05-05 17:34:46 +02:00
parent 0386f4179c
commit 282b3d79a2
3 changed files with 8 additions and 6 deletions

View File

@ -583,7 +583,7 @@ hrmap *new_map() { return new hrmap_archimedean; }
heptagon *build_child(heptspin p, pair<int, int> adj) {
indenter ind;
auto h = buildHeptagon1(tailored_alloc<heptagon> (isize(current.adjacent[adj.first])), p.at, p.spin, hstate(1), 0, adj.first);
auto h = buildHeptagon1(tailored_alloc<heptagon> (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;

View File

@ -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<heptagon> (S7), parent, d, s, pard, fixdistance);
heptagon *h = buildHeptagon1(tailored_alloc<heptagon> (S7), parent, d, s, pard);
if(binarytiling || archimedean) return h;
if(parent->c7) {
#if CAP_IRR

View File

@ -469,6 +469,7 @@ template<class T> T* tailored_alloc(int degree) {
#else
result = new T;
#endif
result->type = degree;
for(int i=0; i<degree; i++) result->c.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;