mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-01 03:39:16 +00:00
fixed binary tiling
This commit is contained in:
parent
0386f4179c
commit
282b3d79a2
@ -583,7 +583,7 @@ hrmap *new_map() { return new hrmap_archimedean; }
|
|||||||
|
|
||||||
heptagon *build_child(heptspin p, pair<int, int> adj) {
|
heptagon *build_child(heptspin p, pair<int, int> adj) {
|
||||||
indenter ind;
|
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); )
|
SDEBUG( printf("NEW %p.%d ~ %p.0\n", p.at, p.spin, h); )
|
||||||
id_of(h) = adj.first;
|
id_of(h) = adj.first;
|
||||||
parent_index_of(h) = adj.second;
|
parent_index_of(h) = adj.second;
|
||||||
|
@ -62,17 +62,16 @@ hstate transition(hstate s, int dir) {
|
|||||||
#define COMPUTE -1000000
|
#define COMPUTE -1000000
|
||||||
|
|
||||||
// create a new heptagon
|
// 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->alt = NULL;
|
||||||
h->s = s;
|
h->s = s;
|
||||||
h->zebraval = zv;
|
|
||||||
h->c.connect(pard, parent, d, false);
|
h->c.connect(pard, parent, d, false);
|
||||||
h->cdata = NULL;
|
h->cdata = NULL;
|
||||||
return h;
|
return h;
|
||||||
}
|
}
|
||||||
|
|
||||||
heptagon *buildHeptagon(heptagon *parent, int d, hstate s, int pard = 0, int fixdistance = COMPUTE) {
|
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(binarytiling || archimedean) return h;
|
||||||
if(parent->c7) {
|
if(parent->c7) {
|
||||||
#if CAP_IRR
|
#if CAP_IRR
|
||||||
|
7
hyper.h
7
hyper.h
@ -469,6 +469,7 @@ template<class T> T* tailored_alloc(int degree) {
|
|||||||
#else
|
#else
|
||||||
result = new T;
|
result = new T;
|
||||||
#endif
|
#endif
|
||||||
|
result->type = degree;
|
||||||
for(int i=0; i<degree; i++) result->c.move_table[i] = NULL;
|
for(int i=0; i<degree; i++) result->c.move_table[i] = NULL;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@ -573,7 +574,9 @@ struct heptagon {
|
|||||||
// zebra generator (1B actually)
|
// zebra generator (1B actually)
|
||||||
short zebraval;
|
short zebraval;
|
||||||
// field id
|
// field id
|
||||||
int fieldval;
|
int fieldval : 24;
|
||||||
|
// degree
|
||||||
|
unsigned char type : 8;
|
||||||
// data for fractal landscapes
|
// data for fractal landscapes
|
||||||
short rval0, rval1;
|
short rval0, rval1;
|
||||||
// for alternate structures, cdata contains the pointer to the original
|
// for alternate structures, cdata contains the pointer to the original
|
||||||
@ -592,7 +595,7 @@ struct heptagon {
|
|||||||
~heptagon () { heptacount--; }
|
~heptagon () { heptacount--; }
|
||||||
heptagon *cmove(int d) { return createStep(this, d); }
|
heptagon *cmove(int d) { return createStep(this, d); }
|
||||||
heptagon *cmodmove(int d) { return createStep(this, c.fix(d)); }
|
heptagon *cmodmove(int d) { return createStep(this, c.fix(d)); }
|
||||||
inline int degree();
|
inline int degree() { return type; }
|
||||||
|
|
||||||
// prevent accidental copying
|
// prevent accidental copying
|
||||||
heptagon(const heptagon&) = delete;
|
heptagon(const heptagon&) = delete;
|
||||||
|
Loading…
Reference in New Issue
Block a user