From 4f0d16f9ed319d50ef345828029d8cd58d20a319 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Fri, 16 Dec 2022 01:05:18 +0100 Subject: [PATCH] faster bt grid rendering, and also works correctly in embedded_plane --- celldrawer.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/celldrawer.cpp b/celldrawer.cpp index 1a76b74c..34467094 100644 --- a/celldrawer.cpp +++ b/celldrawer.cpp @@ -907,6 +907,7 @@ void celldrawer::draw_grid() { #if CAP_BT else if(bt::in() && WDIM == 2) { for(int t=0; ttype; t++) { + if(!c->move(t)|| c->move(t) < c) continue; auto h0 = bt::get_corner_horo_coordinates(c, t); auto h1 = bt::get_corner_horo_coordinates(c, t+1); int steps = 12 * abs(h0[1] - h1[1]); @@ -917,8 +918,13 @@ void celldrawer::draw_grid() { if(vid.linequality > 0) steps <<= vid.linequality; if(vid.linequality < 0) steps >>= -vid.linequality; auto step = (h1 - h0) / steps; - for(int i=0; i<=steps; i++) curvepoint(bt::get_horopoint(h0 + i * step)); - queuecurve(V, gridcolor(c, c->move(t)), 0, PPR::LINE); + 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)); + queuecurve(V, gridcolor(c, c->move(t)), 0, PPR::LINE); + } } } }