1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-16 10:19:58 +00:00

support for portal spaces

This commit is contained in:
Zeno Rogue 2021-02-18 15:53:21 +01:00
parent a634412dcb
commit d96f92c0f8
6 changed files with 20 additions and 2 deletions

View File

@ -953,6 +953,7 @@ EX cdata *arcmCdata(cell *c) {
EX int getCdata(cell *c, int j) { EX int getCdata(cell *c, int j) {
if(fake::in()) return FPIU(getCdata(c, 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)); } if(hybri) { c = hybrid::get_where(c).first; return PIU(getBits(c)); }
else if(INVERSE) { else if(INVERSE) {
cell *c1 = gp::get_mapped(c); cell *c1 = gp::get_mapped(c);
@ -978,6 +979,7 @@ EX int getCdata(cell *c, int j) {
EX int getBits(cell *c) { EX int getBits(cell *c) {
if(fake::in()) return FPIU(getBits(c)); if(fake::in()) return FPIU(getBits(c));
if(experimental) return 0;
if(hybri) { c = hybrid::get_where(c).first; return PIU(getBits(c)); } if(hybri) { c = hybrid::get_where(c).first; return PIU(getBits(c)); }
else if(INVERSE) { else if(INVERSE) {
cell *c1 = gp::get_mapped(c); cell *c1 = gp::get_mapped(c);

View File

@ -803,6 +803,8 @@ static const flagtype qAFFINE = Flag(24);
static const flagtype qULTRA = Flag(25); static const flagtype qULTRA = Flag(25);
static const flagtype qPORTALSPACE = Flag(26);
// note: dnext assumes that x&7 equals 7 // note: dnext assumes that x&7 equals 7
static const int SEE_ALL = 50; static const int SEE_ALL = 50;
static const int OINF = 100; static const int OINF = 100;

View File

@ -3578,6 +3578,7 @@ EX namespace windmap {
} }
EX void create() { EX void create() {
if(cgflags & qPORTALSPACE) return;
samples.clear(); samples.clear();
neighbors.clear(); neighbors.clear();
getid.clear(); getid.clear();

View File

@ -39,7 +39,12 @@ EX namespace euc {
static const coord D1 = main_axes[1]; static const coord D1 = main_axes[1];
static const coord D2 = main_axes[2]; static const coord D2 = main_axes[2];
vector<coord> shifttable; vector<coord> shifttable;
switch(geometry) {
/* for portal spaces... */
auto g = geometry;
if(S7 == 6 && WDIM == 3) g = gCubeTiling;
switch(g) {
case gCubeTiling: case gCubeTiling:
shifttable = { +D0, +D1, +D2 }; shifttable = { +D0, +D1, +D2 };
break; break;
@ -340,6 +345,7 @@ EX namespace euc {
} }
EX bool pseudohept(cell *c) { EX bool pseudohept(cell *c) {
if(cgflags & qPORTALSPACE) return false;
coord co = cubemap()->ispacemap[c->master]; coord co = cubemap()->ispacemap[c->master];
if(S7 == 12) { if(S7 == 12) {
for(int i=0; i<3; i++) if((co[i] & 1)) return false; 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) { EX void set_land(cell *c) {
if(cgflags & qPORTALSPACE) return;
setland(c, specialland); setland(c, specialland);
auto m = cubemap(); auto m = cubemap();
auto co = m->ispacemap[c->master]; auto co = m->ispacemap[c->master];

View File

@ -884,7 +884,7 @@ EX void describeMouseover() {
out += ")"; out += ")";
} }
if(cheater && euc::in(3)) { if(cheater && euc::in(3) && !(cgflags & qPORTALSPACE)) {
auto co = euc::get_ispacemap()[c->master]; auto co = euc::get_ispacemap()[c->master];
out += " (" + its(co[0]); out += " (" + its(co[0]);
for(int i=1; i<WDIM; i++) out += "," + its(co[i]); for(int i=1; i<WDIM; i++) out += "," + its(co[i]);

View File

@ -34,6 +34,7 @@ EX int ctof012(cell *c) {
} }
int gp_threecolor() { int gp_threecolor() {
if(cgflags & qPORTALSPACE) return 0;
if(!GOLDBERG) return 0; if(!GOLDBERG) return 0;
#if CAP_GP #if CAP_GP
if(S3 == 3 && (gp::param.first - gp::param.second) % 3 == 0) return 2; if(S3 == 3 && (gp::param.first - gp::param.second) % 3 == 0) return 2;
@ -42,6 +43,7 @@ int gp_threecolor() {
} }
int eupattern(cell *c) { int eupattern(cell *c) {
if(cgflags & qPORTALSPACE) return 0;
auto co = euc2_coordinates(c); auto co = euc2_coordinates(c);
int x = co.first, y = co.second; int x = co.first, y = co.second;
if(a4) if(a4)
@ -57,6 +59,7 @@ int eupattern4(cell *c) {
} }
EX bool ishept(cell *c) { EX bool ishept(cell *c) {
if(cgflags & qPORTALSPACE) return 0;
// EUCLIDEAN // EUCLIDEAN
if(euc::in() && PURE) return eupattern(c) == 0; if(euc::in() && PURE) return eupattern(c) == 0;
else if(hybri) { cell *c1 = hybrid::get_where(c).first; return c1 == c1->master->c7; } else if(hybri) { cell *c1 = hybrid::get_where(c).first; return c1 == c1->master->c7; }
@ -64,6 +67,7 @@ EX bool ishept(cell *c) {
} }
EX bool ishex1(cell *c) { EX bool ishex1(cell *c) {
if(cgflags & qPORTALSPACE) return 0;
// EUCLIDEAN // EUCLIDEAN
if(euc::in() && PURE) return eupattern(c) == 1; if(euc::in() && PURE) return eupattern(c) == 1;
#if CAP_GP #if CAP_GP
@ -73,6 +77,7 @@ EX bool ishex1(cell *c) {
} }
bool ishex2(cell *c) { bool ishex2(cell *c) {
if(cgflags & qPORTALSPACE) return 0;
// EUCLIDEAN // EUCLIDEAN
if(euc::in() && PURE) return eupattern(c) == 1; if(euc::in() && PURE) return eupattern(c) == 1;
#if CAP_GP #if CAP_GP
@ -82,6 +87,7 @@ bool ishex2(cell *c) {
} }
EX int chessvalue(cell *c) { EX int chessvalue(cell *c) {
if(cgflags & qPORTALSPACE) return 0;
#if CAP_ARCM #if CAP_ARCM
if(arcm::in()) if(arcm::in())
return arcm::chessvalue(c); return arcm::chessvalue(c);