Commit 022e1d1a authored by Adam P. Goucher's avatar Adam P. Goucher

Allow glider detection to be turned off

parent 208c357d
Pipeline #46146945 passed with stages
in 7 minutes and 27 seconds
......@@ -122,6 +122,10 @@ namespace apg {
}
int is_extremal(uint64_t x) {
#ifdef DISABLE_GLIDERS
(void) x;
return 0;
#else
int ext = 0;
int64_t tx = (x & 0xffffffffu) - 0x80000000u;
int64_t tw = (x >> 32) - 0x80000000u;
......@@ -132,6 +136,7 @@ namespace apg {
ext |= ((xmy >= max_xmy) ? 4 : 0);
ext |= ((xmy <= min_xmy) ? 8 : 0);
return (ext & extremal_mask);
#endif
}
T* getNeighbour(T* sqt, int i) {
......@@ -142,6 +147,7 @@ namespace apg {
if (*pointer_to_pointer == 0) {
*pointer_to_pointer = tiles.elements.newnode();
(*pointer_to_pointer)->coords = x;
#ifndef DISABLE_GLIDERS
int64_t tx = (x & 0xffffffffu) - 0x80000000u;
int64_t tw = (x >> 32) - 0x80000000u;
int64_t xpy = tx * W - (tw * (H + W/2));
......@@ -150,6 +156,7 @@ namespace apg {
min_xpy = (xpy < min_xpy) ? xpy : min_xpy;
max_xmy = (xmy > max_xmy) ? xmy : max_xmy;
min_xmy = (xmy < min_xmy) ? xmy : min_xmy;
#endif
}
y = *pointer_to_pointer;
y->neighbours[(i + 3) % 6] = sqt;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment