1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-04-26 20:53:13 +00:00

fake::split() = fake::in() or arb::in_slided() is used when both are applicable for a condition

This commit is contained in:
Zeno Rogue 2020-06-03 11:43:35 +02:00
parent ab379435d4
commit 0ae3ab3c9b
4 changed files with 14 additions and 9 deletions

View File

@ -65,6 +65,8 @@ EX bool using_slided;
EX arbi_tiling slided; EX arbi_tiling slided;
EX bool in_slided() { return in() && using_slided; }
EX arbi_tiling& current_or_slided() { EX arbi_tiling& current_or_slided() {
return using_slided ? slided : current; return using_slided ? slided : current;
} }

View File

@ -681,7 +681,7 @@ void celldrawer::draw_wall() {
color_t wcol2 = gradient(0, wcol0, 0, .8, 1); color_t wcol2 = gradient(0, wcol0, 0, .8, 1);
draw_shapevec(c, V, qfi.fshape->levels[SIDE_WALL], darkena(wcol, 0, 0xFF), PPR::WALL); draw_shapevec(c, V, qfi.fshape->levels[SIDE_WALL], darkena(wcol, 0, 0xFF), PPR::WALL);
forCellIdEx(c2, i, c) forCellIdEx(c2, i, c)
if(!highwall(c2) || conegraph(c2) || c2->wall == waClosedGate) if(!highwall(c2) || conegraph(c2) || c2->wall == waClosedGate || fake::split())
placeSidewall(c, i, SIDE_WALL, V, darkena(wcol2, fd, 255)); placeSidewall(c, i, SIDE_WALL, V, darkena(wcol2, fd, 255));
dynamicval<color_t> p(poly_outline, OUTLINE_TRANS); dynamicval<color_t> p(poly_outline, OUTLINE_TRANS);
@ -843,7 +843,7 @@ void celldrawer::draw_grid() {
if(!bt::in() && c->move(t) < c) continue; if(!bt::in() && c->move(t) < c) continue;
dynamicval<color_t> g(poly_outline, gridcolor(c, c->move(t))); dynamicval<color_t> g(poly_outline, gridcolor(c, c->move(t)));
if(fat_edges && reg3::in()) { if(fat_edges && reg3::in()) {
for(int i=0; i<S7; i++) if(c < c->move(i) || fake::in()) { for(int i=0; i<S7; i++) if(c < c->move(i) || fake::split()) {
for(int j=0; j<cgi.face; j++) { for(int j=0; j<cgi.face; j++) {
int jj = j == cgi.face-1 ? 0 : j+1; int jj = j == cgi.face-1 ? 0 : j+1;
int jjj = jj == cgi.face-1 ? 0 : jj+1; int jjj = jj == cgi.face-1 ? 0 : jj+1;
@ -897,7 +897,7 @@ void celldrawer::draw_grid() {
} }
else { else {
for(int t=0; t<c->type; t++) for(int t=0; t<c->type; t++)
if(c->move(t) && (c->move(t) < c || isWarped(c->move(t)) || fake::in())) if(c->move(t) && (c->move(t) < c || isWarped(c->move(t)) || fake::split()))
gridline(V, get_corner_position(c, t%c->type), get_corner_position(c, (t+1)%c->type), gridcolor(c, c->move(t)), prec); gridline(V, get_corner_position(c, t%c->type), get_corner_position(c, (t+1)%c->type), gridcolor(c, c->move(t)), prec);
} }
} }
@ -1617,7 +1617,7 @@ void celldrawer::draw_features_and_walls_3d() {
for(int a=0; a<c->type; a++) { for(int a=0; a<c->type; a++) {
bool b = true; bool b = true;
if(c->move(a) && (among(pmodel, mdPerspective, mdGeodesic) || gmatrix0.count(c->move(a)))) if(c->move(a) && (among(pmodel, mdPerspective, mdGeodesic) || gmatrix0.count(c->move(a))))
b = (patterns::innerwalls && (tC0(V)[2] < tC0(V * currentmap->adj(c, a))[2])) || fake::in() || !isWall3(c->move(a), dummy); b = (patterns::innerwalls && (tC0(V)[2] < tC0(V * currentmap->adj(c, a))[2])) || fake::split() || !isWall3(c->move(a), dummy);
if(b) { if(b) {
#if CAP_WRL #if CAP_WRL
/* always render */ /* always render */
@ -1835,7 +1835,7 @@ void celldrawer::bookkeeping() {
else { else {
playerV = V * ddspin(c, cwt.spin, 0); playerV = V * ddspin(c, cwt.spin, 0);
if(cwt.mirrored) playerV = playerV * Mirror; if(cwt.mirrored) playerV = playerV * Mirror;
if((!confusingGeometry() && !fake::in() && !inmirrorcount) || eqmatrix(V, current_display->which_copy, 1e-2)) if((!confusingGeometry() && !fake::split() && !inmirrorcount) || eqmatrix(V, current_display->which_copy, 1e-2))
current_display->which_copy = V; current_display->which_copy = V;
if(orig) cwtV = playerV; if(orig) cwtV = playerV;
} }

View File

@ -21,6 +21,9 @@ EX namespace fake {
EX bool in() { return geometry == gFake; } EX bool in() { return geometry == gFake; }
/** like in() but takes slided arb into account */
EX bool split() { return in() || arb::in_slided(); }
EX bool available() { EX bool available() {
if(in()) return true; if(in()) return true;
if(GDIM == 2 && standard_tiling() && (PURE || BITRUNCATED)) return true; if(GDIM == 2 && standard_tiling() && (PURE || BITRUNCATED)) return true;

View File

@ -114,7 +114,7 @@ vector<monster*> active, nonvirtual, additional;
cell *findbaseAround(hyperpoint p, cell *around, int maxsteps) { cell *findbaseAround(hyperpoint p, cell *around, int maxsteps) {
if(fake::in() || arb::in_slided()) { if(fake::split()) {
auto p0 = inverse(ggmatrix(around)) * p; auto p0 = inverse(ggmatrix(around)) * p;
virtualRebase(around, p0); virtualRebase(around, p0);
return around; return around;
@ -187,13 +187,13 @@ void monster::rebasePat(const transmatrix& new_pat, cell *c2) {
current_display->which_copy = ggmatrix(base); current_display->which_copy = ggmatrix(base);
return; return;
} }
if(quotient || fake::in() || arb::in_slided()) { if(quotient || fake::split()) {
at = inverse(gmatrix[base]) * new_pat; at = inverse(gmatrix[base]) * new_pat;
transmatrix old_at = at; transmatrix old_at = at;
virtualRebase(this); virtualRebase(this);
fix_to_2(at); fix_to_2(at);
if(base != c2) { if(base != c2) {
if(fake::in() || arb::in_slided()) println(hlog, "fake error"); if(fake::split()) println(hlog, "fake error");
else { else {
auto T = calc_relative_matrix(c2, base, tC0(at)); auto T = calc_relative_matrix(c2, base, tC0(at));
base = c2; base = c2;
@ -1637,7 +1637,7 @@ void moveBullet(monster *m, int delta) {
} }
else else
nat = parallel_transport(nat, m->ori, fronttangent(delta * SCALE * m->vel / speedfactor())); nat = parallel_transport(nat, m->ori, fronttangent(delta * SCALE * m->vel / speedfactor()));
cell *c2 = m->findbase(nat, fake::in() ? 10 : 1); cell *c2 = m->findbase(nat, fake::split() ? 10 : 1);
if(m->parent && isPlayer(m->parent) && markOrb(itOrbLava) && c2 != m->base && !isPlayerOn(m->base)) if(m->parent && isPlayer(m->parent) && markOrb(itOrbLava) && c2 != m->base && !isPlayerOn(m->base))
makeflame(m->base, 5, false); makeflame(m->base, 5, false);