From 27bedb19edc57569682a8651ba9a404470297822 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Tue, 15 Aug 2023 15:19:50 +0200 Subject: [PATCH] fixed a bug which caused the screen to disappear on switch-to-fpp --- hyperpoint.cpp | 9 ++++++--- nonisotropic.cpp | 4 ++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/hyperpoint.cpp b/hyperpoint.cpp index 6e9530d9..7dd382d2 100644 --- a/hyperpoint.cpp +++ b/hyperpoint.cpp @@ -1361,14 +1361,17 @@ EX shiftmatrix orthogonal_move(const shiftmatrix& t, double level) { return shiftless(orthogonal_move(t.T, level), t.shift); } -/** fix a 3x3 matrix into a 4x4 matrix */ -EX transmatrix fix4(transmatrix t) { +/** fix a 3x3 matrix into a 4x4 matrix, in place */ +EX void fix4(transmatrix& t) { #if MAXMDIM > 3 + if(ldebug) println(hlog, "fix4 performed"); for(int i=0; i<4; i++) t[3][i] = t[i][3] = i == 3; #endif - return t; } +/** fix a 3x3 matrix into a 4x4 matrix, as a function */ +EX transmatrix fix4_f(transmatrix t) { fix4(t); return t; } + EX transmatrix xyscale(const transmatrix& t, double fac) { transmatrix res; for(int i=0; ifull_shvid(c1) ); } - virtual transmatrix spin_to(cell *c, int d, ld bonus) override { if(d >= c->type-2) return Id; c = get_where(c).first; return fix4( in_underlying([&] { return currentmap->spin_to(c, d, bonus); }) ); } - virtual transmatrix spin_from(cell *c, int d, ld bonus) override { if(d >= c->type-2) return Id; c = get_where(c).first; return fix4( in_underlying([&] { return currentmap->spin_from(c, d, bonus); }) ); } + virtual transmatrix spin_to(cell *c, int d, ld bonus) override { if(d >= c->type-2) return Id; c = get_where(c).first; return fix4_f( in_underlying([&] { return currentmap->spin_to(c, d, bonus); }) ); } + virtual transmatrix spin_from(cell *c, int d, ld bonus) override { if(d >= c->type-2) return Id; c = get_where(c).first; return fix4_f( in_underlying([&] { return currentmap->spin_from(c, d, bonus); }) ); } subcellshape& get_cellshape(cell *c) override { int id = full_shvid(c);