1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-09-10 14:26:01 +00:00

removed the MAX_EDGE limit

This commit is contained in:
Zeno Rogue
2020-01-18 16:03:32 +01:00
parent a6da5ded75
commit 2271a67506
24 changed files with 238 additions and 190 deletions

View File

@@ -57,15 +57,15 @@ EX namespace netgen {
vec center[MAXCELLS];
double rot[MAXCELLS];
int glued[MAXCELLS];
int nei[MAXCELLS][MAX_EDGE];
vector<int> nei[MAXCELLS];
// auxiliary data
double raylen[MAXCELLS];
double edgist[MAXCELLS];
char patek[MAXCELLS][MAX_EDGE];
vector<char> patek[MAXCELLS];
// data generated by HyperRogue
hyperpoint hcenter[MAXCELLS][MAX_EDGE+1];
vector<hyperpoint> hcenter[MAXCELLS];
// Functions handling the data.
//==============================
@@ -79,7 +79,8 @@ EX namespace netgen {
if(mode == 1)
for(int ii=0; ii<CELLS; ii++) if(dcal[ii] == c) {
hcenter[ii][MAX_EDGE] = V * C0;
hcenter[ii].resize(c->type+1);
hcenter[ii][c->type] = V * C0;
if(c->type == S7) {
for(int i=0; i<c->type; i++) {
@@ -110,11 +111,12 @@ EX namespace netgen {
for(int i=0; i<CELLS; i++) {
ct[i] = dcal[i]->type;
for(int k=0; k<8; k++)
for(int k=0; k<=ct[i]; k++)
vx[i][2*k] = hcenter[i][k][0],
vx[i][2*k+1] = hcenter[i][k][1];
for(int k=0; k<ct[i]; k++) nei[i][k] = -1;
nei[i].clear();
nei[i].resize(ct[i], -1);
for(int j=0; j<CELLS; j++) {
cell *c1 = dcal[i];
@@ -148,6 +150,8 @@ EX namespace netgen {
for(int i=0; i<CELLS; i++) scan(f, ct[i]);
for(int i=0; i<CELLS; i++) nei[i].resize(ct[i]);
for(int i=0; i<CELLS; i++) for(int j=0; j<16; j++) scan(f, vx[i][j]);
for(int i=0; i<CELLS; i++)
@@ -343,6 +347,7 @@ EX namespace netgen {
SDL_FillRect(net, NULL, 0xFFFFFF);
int pateks = 0;
for(int i=0; i<CELLS; i++) patek[i].resize(ct[i]);
int zeroi = nei[0][0];
int zeroe = 0;