From d96f92c0f8ded66ca29d7c275ed339ab8285aa9e Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 18 Feb 2021 15:53:21 +0100 Subject: [PATCH] support for portal spaces --- cell.cpp | 2 ++ classes.cpp | 2 ++ complex.cpp | 1 + euclid.cpp | 9 ++++++++- help.cpp | 2 +- pattern2.cpp | 6 ++++++ 6 files changed, 20 insertions(+), 2 deletions(-) diff --git a/cell.cpp b/cell.cpp index 51d9037d..15e90443 100644 --- a/cell.cpp +++ b/cell.cpp @@ -953,6 +953,7 @@ EX cdata *arcmCdata(cell *c) { EX int getCdata(cell *c, int j) { if(fake::in()) return FPIU(getCdata(c, j)); + if(experimental) return 0; if(hybri) { c = hybrid::get_where(c).first; return PIU(getBits(c)); } else if(INVERSE) { cell *c1 = gp::get_mapped(c); @@ -978,6 +979,7 @@ EX int getCdata(cell *c, int j) { EX int getBits(cell *c) { if(fake::in()) return FPIU(getBits(c)); + if(experimental) return 0; if(hybri) { c = hybrid::get_where(c).first; return PIU(getBits(c)); } else if(INVERSE) { cell *c1 = gp::get_mapped(c); diff --git a/classes.cpp b/classes.cpp index fd8a367a..b8d17cd8 100644 --- a/classes.cpp +++ b/classes.cpp @@ -803,6 +803,8 @@ static const flagtype qAFFINE = Flag(24); static const flagtype qULTRA = Flag(25); +static const flagtype qPORTALSPACE = Flag(26); + // note: dnext assumes that x&7 equals 7 static const int SEE_ALL = 50; static const int OINF = 100; diff --git a/complex.cpp b/complex.cpp index 8aae5998..33fdea96 100644 --- a/complex.cpp +++ b/complex.cpp @@ -3578,6 +3578,7 @@ EX namespace windmap { } EX void create() { + if(cgflags & qPORTALSPACE) return; samples.clear(); neighbors.clear(); getid.clear(); diff --git a/euclid.cpp b/euclid.cpp index 4ad76f9d..03fb4c7e 100644 --- a/euclid.cpp +++ b/euclid.cpp @@ -39,7 +39,12 @@ EX namespace euc { static const coord D1 = main_axes[1]; static const coord D2 = main_axes[2]; vector shifttable; - switch(geometry) { + + /* for portal spaces... */ + auto g = geometry; + if(S7 == 6 && WDIM == 3) g = gCubeTiling; + + switch(g) { case gCubeTiling: shifttable = { +D0, +D1, +D2 }; break; @@ -340,6 +345,7 @@ EX namespace euc { } EX bool pseudohept(cell *c) { + if(cgflags & qPORTALSPACE) return false; coord co = cubemap()->ispacemap[c->master]; if(S7 == 12) { for(int i=0; i<3; i++) if((co[i] & 1)) return false; @@ -415,6 +421,7 @@ EX namespace euc { } EX void set_land(cell *c) { + if(cgflags & qPORTALSPACE) return; setland(c, specialland); auto m = cubemap(); auto co = m->ispacemap[c->master]; diff --git a/help.cpp b/help.cpp index bd029124..ef9326f9 100644 --- a/help.cpp +++ b/help.cpp @@ -884,7 +884,7 @@ EX void describeMouseover() { out += ")"; } - if(cheater && euc::in(3)) { + if(cheater && euc::in(3) && !(cgflags & qPORTALSPACE)) { auto co = euc::get_ispacemap()[c->master]; out += " (" + its(co[0]); for(int i=1; imaster->c7; } @@ -64,6 +67,7 @@ EX bool ishept(cell *c) { } EX bool ishex1(cell *c) { + if(cgflags & qPORTALSPACE) return 0; // EUCLIDEAN if(euc::in() && PURE) return eupattern(c) == 1; #if CAP_GP @@ -73,6 +77,7 @@ EX bool ishex1(cell *c) { } bool ishex2(cell *c) { + if(cgflags & qPORTALSPACE) return 0; // EUCLIDEAN if(euc::in() && PURE) return eupattern(c) == 1; #if CAP_GP @@ -82,6 +87,7 @@ bool ishex2(cell *c) { } EX int chessvalue(cell *c) { + if(cgflags & qPORTALSPACE) return 0; #if CAP_ARCM if(arcm::in()) return arcm::chessvalue(c);