1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-06-16 10:19:58 +00:00

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 #if CAP_GP
EX namespace gp { EX namespace gp {
int pshid[3][8][32][32][8];
int nextid;
EX void clear_plainshapes() { EX void clear_plainshapes() {
for(int m=0; m<3; m++) for(int m=0; m<3; m++)
@ -782,12 +780,12 @@ EX namespace gp {
for(int i=0; i<32; i++) for(int i=0; i<32; i++)
for(int j=0; j<32; j++) for(int j=0; j<32; j++)
for(int k=0; k<8; k++) for(int k=0; k<8; k++)
pshid[m][sd][i][j][k] = -1; cgi.gpdata->pshid[m][sd][i][j][k] = -1;
nextid = 0; cgi.gpdata->nextid = 0;
} }
void build_plainshape(int& id, gp::local_info& li, cell *c0, int siid, int sidir) { 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); bool master = !(li.relative.first||li.relative.second);
int cor = master ? S7 : SG6; int cor = master ? S7 : SG6;
@ -818,7 +816,7 @@ EX namespace gp {
siid = 0; siid = 0;
sidir = 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) { if(id == -1 && sphere && isize(cgi.shFloor.b) > 0) {
forCellEx(c1, c) if(!gmatrix0.count(c1)) return 0; forCellEx(c1, c) if(!gmatrix0.count(c1)) return 0;
} }

View File

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

View File

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

View File

@ -1149,9 +1149,6 @@ void geometry_information::prepare_shapes() {
symmetriesAt.clear(); symmetriesAt.clear();
allshapes.clear(); allshapes.clear();
#if CAP_GP
gp::clear_plainshapes();
#endif
DEBBI(DF_POLY, ("buildpolys")); DEBBI(DF_POLY, ("buildpolys"));
if(WDIM == 3 && !hybri) { if(WDIM == 3 && !hybri) {