From 4013d55c27ddc22e911f92a0bb8c884176c63a0a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sun, 12 Jul 2020 20:43:58 +0200 Subject: [PATCH] gp::pshid is now in gpdata --- floorshapes.cpp | 10 ++++------ geometry.cpp | 2 ++ goldberg.cpp | 1 + polygons.cpp | 3 --- 4 files changed, 7 insertions(+), 9 deletions(-) diff --git a/floorshapes.cpp b/floorshapes.cpp index 5c820171..18f34d50 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -773,8 +773,6 @@ void geometry_information::generate_floorshapes() { #if CAP_GP EX namespace gp { - int pshid[3][8][32][32][8]; - int nextid; EX void clear_plainshapes() { for(int m=0; m<3; m++) @@ -782,12 +780,12 @@ EX namespace gp { for(int i=0; i<32; i++) for(int j=0; j<32; j++) for(int k=0; k<8; k++) - pshid[m][sd][i][j][k] = -1; - nextid = 0; + cgi.gpdata->pshid[m][sd][i][j][k] = -1; + cgi.gpdata->nextid = 0; } void build_plainshape(int& id, gp::local_info& li, cell *c0, int siid, int sidir) { - id = nextid++; + id = cgi.gpdata->nextid++; bool master = !(li.relative.first||li.relative.second); int cor = master ? S7 : SG6; @@ -818,7 +816,7 @@ EX namespace gp { siid = 0; sidir = 0; } - auto& id = pshid[siid][sidir][draw_li.relative.first&31][draw_li.relative.second&31][gmod(draw_li.total_dir, S6)]; + auto& id = cgi.gpdata->pshid[siid][sidir][draw_li.relative.first&31][draw_li.relative.second&31][gmod(draw_li.total_dir, S6)]; if(id == -1 && sphere && isize(cgi.shFloor.b) > 0) { forCellEx(c1, c) if(!gmatrix0.count(c1)) return 0; } diff --git a/geometry.cpp b/geometry.cpp index cbf48565..4b912e04 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -439,6 +439,8 @@ hpcshape transmatrix corners; ld alpha; int area; + int pshid[3][8][32][32][8]; + int nextid; }; shared_ptr gpdata = nullptr; #endif diff --git a/goldberg.cpp b/goldberg.cpp index dd3843b1..a9dfa288 100644 --- a/goldberg.cpp +++ b/goldberg.cpp @@ -613,6 +613,7 @@ EX namespace gp { center_locs.clear(); if(GOLDBERG) { if(!cgi.gpdata) cgi.gpdata = make_shared(); + gp::clear_plainshapes(); int x = param.first; int y = param.second; if(S3 == 3) diff --git a/polygons.cpp b/polygons.cpp index c225110a..20ed5023 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -1149,9 +1149,6 @@ void geometry_information::prepare_shapes() { symmetriesAt.clear(); allshapes.clear(); - #if CAP_GP - gp::clear_plainshapes(); - #endif DEBBI(DF_POLY, ("buildpolys")); if(WDIM == 3 && !hybri) {