mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-22 23:17:04 +00:00
product:: using in_h2xe() and in_s2xe() more consistently
This commit is contained in:
parent
d63b14da5c
commit
5add972bdd
@ -185,7 +185,7 @@ void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) {
|
||||
EX heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special IS(0)) {
|
||||
|
||||
if(hybri) {
|
||||
if(hybrid::over_sphere()) return NULL;
|
||||
if(hybrid::under_class() == gcSphere) return NULL;
|
||||
c = hybrid::get_where(c).first;
|
||||
return PIU ( createAlternateMap(c, rad, firststate, special) );
|
||||
}
|
||||
|
2
game.cpp
2
game.cpp
@ -7505,7 +7505,7 @@ EX bool in_full_game() {
|
||||
if(euclid && isCrossroads(specialland)) return true;
|
||||
if(weirdhyperbolic && specialland == laCrossroads4) return true;
|
||||
if(cryst && isCrossroads(specialland)) return true;
|
||||
if((in_s2xe() || nonisotropic || (hybri && !hybrid::over_sphere())) && isCrossroads(specialland)) return true;
|
||||
if((in_s2xe() || nonisotropic || (hybri && hybrid::under_class() != gcSphere)) && isCrossroads(specialland)) return true;
|
||||
if(geometry == gNormal && !NONSTDVAR) return true;
|
||||
return false;
|
||||
}
|
||||
|
@ -296,7 +296,7 @@ EX void giantLandSwitch(cell *c, int d, cell *from) {
|
||||
c->wall = waPalace;
|
||||
}
|
||||
|
||||
if(d == 8 && (sphere || (hybri && hybrid::over_sphere()))) {
|
||||
if(d == 8 && (sphere || in_s2xe())) {
|
||||
int gs = getHemisphere(c,0);
|
||||
if(NONSTDVAR) {
|
||||
int v = 1;
|
||||
@ -2715,7 +2715,7 @@ EX void setdist(cell *c, int d, cell *from) {
|
||||
buildEquidistant(c);
|
||||
}
|
||||
|
||||
if(d <= 7 && (c->land == laGraveyard || c->land == laHauntedBorder) && !(hybri && hybrid::over_sphere())) {
|
||||
if(d <= 7 && (c->land == laGraveyard || c->land == laHauntedBorder) && !in_s2xe()) {
|
||||
c->land = (c->landparam >= 1 && c->landparam <= HAUNTED_RADIUS) ? laHauntedBorder : laGraveyard;
|
||||
}
|
||||
|
||||
|
@ -973,15 +973,16 @@ EX void show_niltorus3() {
|
||||
|
||||
EX }
|
||||
|
||||
EX bool in_s2xe() { return prod && hybrid::over_sphere(); }
|
||||
EX bool in_h2xe() { return prod && !hybrid::over_sphere(); }
|
||||
EX bool in_s2xe() { return prod && hybrid::under_class() == gcSphere; }
|
||||
EX bool in_h2xe() { return prod && hybrid::under_class() == gcHyperbolic; }
|
||||
EX bool in_e2xe() { return prod && hybrid::under_class() == gcEuclid; }
|
||||
|
||||
EX namespace hybrid {
|
||||
|
||||
EX eGeometry underlying;
|
||||
EX geometry_information *underlying_cgip;
|
||||
|
||||
EX bool over_sphere() { return ginf[hybrid::underlying].cclass == gcSphere; }
|
||||
EX eGeometryClass under_class() { return ginf[hybrid::underlying].cclass; }
|
||||
|
||||
EX void configure(eGeometry g) {
|
||||
if(WDIM == 3) return;
|
||||
|
@ -197,7 +197,7 @@ shared_ptr<glhr::GLprogram> write_shader(flagtype shader_flags) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if(geometry == gProduct && !hybrid::over_sphere() && pmodel == mdPerspective) {
|
||||
else if(in_h2xe() && pmodel == mdPerspective) {
|
||||
shader_flags |= SF_PERS3 | SF_DIRECT;
|
||||
coordinator +=
|
||||
"float z = log(t[2] * t[2] - t[0] * t[0] - t[1] * t[1]) / 2.;\n"
|
||||
@ -209,7 +209,7 @@ shared_ptr<glhr::GLprogram> write_shader(flagtype shader_flags) {
|
||||
distfun = "sqrt(z*z+d*d)";
|
||||
treset = true;
|
||||
}
|
||||
else if(geometry == gProduct && hybrid::over_sphere() && pmodel == mdPerspective) {
|
||||
else if(in_s2xe() && pmodel == mdPerspective) {
|
||||
shader_flags |= SF_PERS3 | SF_DIRECT;
|
||||
distfun = "length(t.xyz)", treset = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user