From 9319c3b0fa0c362e24ff63c90a111782335f129b Mon Sep 17 00:00:00 2001 From: ? Date: Wed, 27 Feb 2019 15:50:26 +0100 Subject: [PATCH] 3d:: celldistances --- cell.cpp | 5 ++++- euclid.cpp | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/cell.cpp b/cell.cpp index 6d36f6cd..b2f76380 100644 --- a/cell.cpp +++ b/cell.cpp @@ -402,7 +402,7 @@ int celldist(cell *c) { return torusconfig::cyldist(decodeId(c->master), 0); if(masterless) return eudist(decodeId(c->master)); - if(sphere || binarytiling || geometry == gCrystal) return celldistance(c, currentmap->gamestart()); + if(sphere || binarytiling || DIM == 3 || geometry == gCrystal) return celldistance(c, currentmap->gamestart()); #if CAP_IRR if(IRREGULAR) return irr::celldist(c, false); #endif @@ -439,6 +439,9 @@ int celldistAlt(cell *c) { if(sphere || quotient) { return celldist(c) - 3; } + #if MAXDIM == 4 + if(euclid && DIM == 3) return euclid3::dist_alt(c); + #endif if(!c->master->alt) return 0; #if CAP_IRR if(IRREGULAR) return irr::celldist(c, true); diff --git a/euclid.cpp b/euclid.cpp index 6d5c5354..1de96c61 100644 --- a/euclid.cpp +++ b/euclid.cpp @@ -534,6 +534,11 @@ namespace euclid3 { return true; } + bool dist_alt(cell *c) { + coord co = cubemap()->ispacemap[c->master]; + return getcoord(co, 2); + } + void draw() { dq::visited.clear(); dq::enqueue(viewctr.at, cview());