1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-29 19:40:35 +00:00

fixed and improved rendering of tree patterns

This commit is contained in:
Zeno Rogue 2021-07-29 14:39:33 +02:00
parent c579db717f
commit c797d376e5

View File

@ -2689,22 +2689,12 @@ EX namespace linepatterns {
linepattern patTree("underlying tree", 0x00d0d000, cheating,
ALLCELLS(
if(currentmap->strict_tree_rules()) {
gridlinef(V, C0, V * currentmap->adj(c, 0), C0, col, 2 + vid.linequality); continue;
return;
}
if(is_master(c)) {
int dir = updir(c->master);
if(dir == -1) continue;
cell *c2 = c->master->cmove(dir)->c7;
if(gmatrix.count(c2)) {
if(S3 >= OINF)
gridlinef(V, C0, V, mid(C0, tC0(currentmap->adj(c, dir))), col, 2 + vid.linequality);
else
gridlinef(V, C0, V * currentmap->master_relative(c, true) * currentmap->adj(c->master, dir), C0, col, 2 + vid.linequality);
}
hyperpoint end = currentmap->master_relative(c, true) * currentmap->adj(c->master, dir) * C0;
hyperpoint start = mid(C0, mid(C0, mid(C0, end)));
gridlinef(V, start, V, end, col, 2 + vid.linequality);
}
)
);
@ -2713,17 +2703,9 @@ EX namespace linepatterns {
if(is_master(c)) {
int dir = updir_alt(c->master);
if(dir == -1) continue;
for(int i=0; i<S7; i++)
if(c->master->move(i) && c->master->move(i)->alt == c->master->alt->move(0)) {
cell *c2 = c->master->move(i)->c7;
if(gmatrix.count(c2)) {
if(S3 >= OINF) {
gridlinef(V, C0, V, mid(C0, tC0(inverse_shift(V, gmatrix[c2]))), col, 2 + vid.linequality);
}
else
gridlinef(V, C0, V*currentmap->master_relative(c, true) * currentmap->adj(c->master,i), C0, col, 2 + vid.linequality);
}
}
hyperpoint end = currentmap->master_relative(c, true) * currentmap->adj(c->master, dir) * C0;
hyperpoint start = mid(C0, mid(C0, mid(C0, end)));
gridlinef(V, start, V, end, col, 2 + vid.linequality);
}
)
);