mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-10-31 19:36:16 +00:00
faster bt grid rendering, and also works correctly in embedded_plane
This commit is contained in:
parent
a525de9759
commit
4f0d16f9ed
@ -907,6 +907,7 @@ void celldrawer::draw_grid() {
|
|||||||
#if CAP_BT
|
#if CAP_BT
|
||||||
else if(bt::in() && WDIM == 2) {
|
else if(bt::in() && WDIM == 2) {
|
||||||
for(int t=0; t<c->type; t++) {
|
for(int t=0; t<c->type; t++) {
|
||||||
|
if(!c->move(t)|| c->move(t) < c) continue;
|
||||||
auto h0 = bt::get_corner_horo_coordinates(c, t);
|
auto h0 = bt::get_corner_horo_coordinates(c, t);
|
||||||
auto h1 = bt::get_corner_horo_coordinates(c, t+1);
|
auto h1 = bt::get_corner_horo_coordinates(c, t+1);
|
||||||
int steps = 12 * abs(h0[1] - h1[1]);
|
int steps = 12 * abs(h0[1] - h1[1]);
|
||||||
@ -917,11 +918,16 @@ void celldrawer::draw_grid() {
|
|||||||
if(vid.linequality > 0) steps <<= vid.linequality;
|
if(vid.linequality > 0) steps <<= vid.linequality;
|
||||||
if(vid.linequality < 0) steps >>= -vid.linequality;
|
if(vid.linequality < 0) steps >>= -vid.linequality;
|
||||||
auto step = (h1 - h0) / steps;
|
auto step = (h1 - h0) / steps;
|
||||||
|
if(GDIM == 3) {
|
||||||
|
for(int i=0; i<=steps; i++) gridline(V, bt::get_horopoint(h0 + i * step), V, bt::get_horopoint(h0 + (i+1) * step), gridcolor(c, c->move(t)), prec-2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
for(int i=0; i<=steps; i++) curvepoint(bt::get_horopoint(h0 + i * step));
|
for(int i=0; i<=steps; i++) curvepoint(bt::get_horopoint(h0 + i * step));
|
||||||
queuecurve(V, gridcolor(c, c->move(t)), 0, PPR::LINE);
|
queuecurve(V, gridcolor(c, c->move(t)), 0, PPR::LINE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
else if(isWarped(c) && has_nice_dual()) {
|
else if(isWarped(c) && has_nice_dual()) {
|
||||||
if(pseudohept(c)) for(int t=0; t<c->type; t++) if(isWarped(c->move(t)))
|
if(pseudohept(c)) for(int t=0; t<c->type; t++) if(isWarped(c->move(t)))
|
||||||
|
Loading…
Reference in New Issue
Block a user