gp::pshid is now in gpdata

This commit is contained in:
Zeno Rogue 2020-07-12 20:43:58 +02:00
parent 78dbf6824d
commit 4013d55c27
4 changed files with 7 additions and 9 deletions

View File

@ -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;
}

View File

@ -439,6 +439,8 @@ hpcshape
transmatrix corners;
ld alpha;
int area;
int pshid[3][8][32][32][8];
int nextid;
};
shared_ptr<gpdata_t> gpdata = nullptr;
#endif

View File

@ -613,6 +613,7 @@ EX namespace gp {
center_locs.clear();
if(GOLDBERG) {
if(!cgi.gpdata) cgi.gpdata = make_shared<geometry_information::gpdata_t>();
gp::clear_plainshapes();
int x = param.first;
int y = param.second;
if(S3 == 3)

View File

@ -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) {