Commit dfc4e3ce authored by Adam P. Goucher's avatar Adam P. Goucher

Cross layer of abstraction

parent fc7d2f90
......@@ -138,18 +138,22 @@ namespace apg {
T* y = sqt->neighbours[i];
if (!y) {
uint64_t x = sqt->coords + udirections[i];
y = &tiles[x];
y->coords = x;
T** pointer_to_pointer = &(tiles.hashtable[x]);
if (*pointer_to_pointer == 0) {
*pointer_to_pointer = tiles.elements.newnode();
(*pointer_to_pointer)->coords = x;
int64_t tx = (x & 0xffffffffu) - 0x80000000u;
int64_t tw = (x >> 32) - 0x80000000u;
int64_t xpy = tx * W - (tw * (H + W/2));
int64_t xmy = tx * W + (tw * (H - W/2));
max_xpy = (xpy > max_xpy) ? xpy : max_xpy;
min_xpy = (xpy < min_xpy) ? xpy : min_xpy;
max_xmy = (xmy > max_xmy) ? xmy : max_xmy;
min_xmy = (xmy < min_xmy) ? xmy : min_xmy;
}
y = *pointer_to_pointer;
y->neighbours[(i + 3) % 6] = sqt;
sqt->neighbours[i] = y;
int64_t tx = (x & 0xffffffffu) - 0x80000000u;
int64_t tw = (x >> 32) - 0x80000000u;
int64_t xpy = tx * W - (tw * (H + W/2));
int64_t xmy = tx * W + (tw * (H - W/2));
max_xpy = (xpy > max_xpy) ? xpy : max_xpy;
min_xpy = (xpy < min_xpy) ? xpy : min_xpy;
max_xmy = (xmy > max_xmy) ? xmy : max_xmy;
min_xmy = (xmy < min_xmy) ? xmy : min_xmy;
}
return y;
}
......
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