1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-25 01:20:37 +00:00

fixed some references to fp43; preradom patterns no longer crash in Torus

This commit is contained in:
Zeno Rogue 2017-11-06 23:29:10 +01:00
parent 44ea56baf2
commit 35b192405d
2 changed files with 15 additions and 15 deletions

View File

@ -2735,15 +2735,15 @@ namespace prairie {
} }
} }
pair<int,bool> fv = fieldpattern::fieldval(c); pair<int,bool> fv = fieldpattern::fieldval(c);
fv = currfp.gmul(fv, fp43.inverses[c->fval-1]); fv = currfp.gmul(fv, currfp.inverses[c->fval-1]);
rd = currfp.getdist(fv, fp43.distriver); rd = currfp.getdist(fv, currfp.distriver);
int rl = currfp.getdist(fv, fp43.distriverleft); int rl = currfp.getdist(fv, currfp.distriverleft);
int rr = currfp.getdist(fv, fp43.distriverright); int rr = currfp.getdist(fv, currfp.distriverright);
c->LHU.fi.flowerdist = currfp.getdist(fv, fp43.distflower); c->LHU.fi.flowerdist = currfp.getdist(fv, currfp.distflower);
c->LHU.fi.walldist = currfp.getdist(fv, fp43.distwall); c->LHU.fi.walldist = currfp.getdist(fv, currfp.distwall);
c->LHU.fi.walldist2 = currfp.getdist(fv, fp43.distwall2); c->LHU.fi.walldist2 = currfp.getdist(fv, currfp.distwall2);
c->LHU.fi.rval = 0; c->LHU.fi.rval = 0;
if(rd <= 7 && rl < rr) if(rd <= 7 && rl < rr)

View File

@ -1784,29 +1784,29 @@ namespace mapeditor {
int canvasback = linf[laCanvas].color >> 2; int canvasback = linf[laCanvas].color >> 2;
int generateCanvas(cell *c) { int generateCanvas(cell *c) {
if(whichCanvas == 'C') { if(whichCanvas == 'C' && !torus) {
using namespace fieldpattern; using namespace fieldpattern;
int z = currfp.getdist(fieldval(c), make_pair(0,false)); int z = currfp.getdist(fieldval(c), make_pair(0,false));
if(z < currfp.circrad) return 0x00C000; if(z < currfp.circrad) return 0x00C000;
int z2 = currfp.getdist(fieldval(c), make_pair(fp43.otherpole,false)); int z2 = currfp.getdist(fieldval(c), make_pair(currfp.otherpole,false));
if(z2 < currfp.disthep[fp43.otherpole] - fp43.circrad) if(z2 < currfp.disthep[currfp.otherpole] - currfp.circrad)
return 0x3000; return 0x3000;
return 0x6000; return 0x6000;
} }
if(whichCanvas == 'D') { if(whichCanvas == 'D' && !torus) {
using namespace fieldpattern; using namespace fieldpattern;
int z = currfp.getdist(fieldval(c), make_pair(0,false)); int z = currfp.getdist(fieldval(c), make_pair(0,false));
return 255 * (currfp.maxdist+1-z) / fp43.maxdist; return 255 * (currfp.maxdist+1-z) / currfp.maxdist;
} }
if(whichCanvas == 'N') { if(whichCanvas == 'N' && !torus) {
using namespace fieldpattern; using namespace fieldpattern;
int z = currfp.getdist(fieldval(c), make_pair(0,false)); int z = currfp.getdist(fieldval(c), make_pair(0,false));
int z2 = currfp.getdist(fieldval(c), make_pair(fp43.otherpole,false)); int z2 = currfp.getdist(fieldval(c), make_pair(currfp.otherpole,false));
if(z < z2) return 0x00C000; if(z < z2) return 0x00C000;
if(z > z2) return 0xC00000; if(z > z2) return 0xC00000;
return 0xCCCC00; return 0xCCCC00;
} }
if(whichCanvas == 'S') { if(whichCanvas == 'S' && !torus) {
return 0x3F1F0F * fieldpattern::subval(c).second + 0x000080; return 0x3F1F0F * fieldpattern::subval(c).second + 0x000080;
} }
if(whichCanvas == 'g') if(whichCanvas == 'g')