From cb6a28f7c146efe4507943b2472fb7ef5aebf78d Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 5 Aug 2021 11:56:12 +0200 Subject: [PATCH] fixed some problems with 2D fake --- fake.cpp | 20 ++++++++++++++++---- system.cpp | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/fake.cpp b/fake.cpp index d439c546..8b2e4991 100644 --- a/fake.cpp +++ b/fake.cpp @@ -80,8 +80,18 @@ EX namespace fake { } heptagon *create_step(heptagon *parent, int d) override { - parent->c.connect(d, parent, d, false); - return parent; + return FPIU(currentmap->create_step(parent, d)); + } + + virtual hyperpoint get_corner(cell *c, int cid, ld cf=3) { + + if(arcm::in()) { + return underlying_map->get_corner(c, cid, cf); + } + + hyperpoint h; + h = FPIU(currentmap->get_corner(c, cid, cf)); + return befake(h); } transmatrix adj(cell *c, int d) override { @@ -361,6 +371,8 @@ EX namespace fake { } transmatrix ray_iadj(cell *c, int i) override { + if(WDIM == 2) + return to_other_side(get_corner(c, i), get_corner(c, i+1)); if(PURE) return iadj(c, i); auto& v = get_cellshape(c).faces_local[i]; hyperpoint h = @@ -390,8 +402,8 @@ EX namespace fake { #endif EX hyperpoint befake(hyperpoint h) { - auto h1 = h / h[WDIM] * scale; - h1[WDIM] = 1; + auto h1 = h / h[LDIM] * scale; + h1[LDIM] = 1; if(material(h1) > 1e-3) h1 = normalize(h1); return h1; diff --git a/system.cpp b/system.cpp index f2007d32..0d573058 100644 --- a/system.cpp +++ b/system.cpp @@ -1553,7 +1553,7 @@ EX void start_game() { check_cgi(); cgi.require_basics(); #if CAP_ARCM - arcm::current.compute_geometry(); + arcm::current_or_fake().compute_geometry(); #endif initcells(); expansion.reset();