mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-25 01:20:37 +00:00
netgen:: renamed SCALE to nscale (conflict)
This commit is contained in:
parent
eb5392a434
commit
e96d24e8c2
20
netgen.cpp
20
netgen.cpp
@ -44,7 +44,7 @@ namespace hr { namespace netgen {
|
|||||||
|
|
||||||
bool loaded;
|
bool loaded;
|
||||||
|
|
||||||
int SCALE, PX, PY, BASE, SX, SY, CELLS, fontsize, created;
|
int nscale, PX, PY, BASE, SX, SY, CELLS, fontsize, created;
|
||||||
double el;
|
double el;
|
||||||
#define MAXCELLS 1000
|
#define MAXCELLS 1000
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ namespace hr { namespace netgen {
|
|||||||
fhstream f("papermodeldata.txt", "rt");
|
fhstream f("papermodeldata.txt", "rt");
|
||||||
if(!f.f) return;
|
if(!f.f) return;
|
||||||
|
|
||||||
if(!scan(f, CELLS, SX, SY, PX, PY, SCALE, BASE, el, created)) return;
|
if(!scan(f, CELLS, SX, SY, PX, PY, nscale, BASE, el, created)) return;
|
||||||
|
|
||||||
loaded = true;
|
loaded = true;
|
||||||
|
|
||||||
@ -179,7 +179,7 @@ namespace hr { namespace netgen {
|
|||||||
addMessage("Could not save the paper model data");
|
addMessage("Could not save the paper model data");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
println(f, spaced(CELLS, SX, SY, PX, PY, SCALE, BASE, el, created), "\n");
|
println(f, spaced(CELLS, SX, SY, PX, PY, nscale, BASE, el, created), "\n");
|
||||||
|
|
||||||
// net parameters: cell types
|
// net parameters: cell types
|
||||||
println(f, spaced_of(ct, CELLS));
|
println(f, spaced_of(ct, CELLS));
|
||||||
@ -321,7 +321,7 @@ namespace hr { namespace netgen {
|
|||||||
drawline(hvec(i,e), hvec(i,7), 0x80808080);
|
drawline(hvec(i,e), hvec(i,7), 0x80808080);
|
||||||
} */
|
} */
|
||||||
|
|
||||||
s = net = SDL_CreateRGBSurface(SDL_SWSURFACE,SX*SCALE,SY*SCALE,32,0,0,0,0);
|
s = net = SDL_CreateRGBSurface(SDL_SWSURFACE,SX*nscale,SY*nscale,32,0,0,0,0);
|
||||||
SDL_FillRect(net, NULL, 0xFFFFFF);
|
SDL_FillRect(net, NULL, 0xFFFFFF);
|
||||||
|
|
||||||
int pateks = 0;
|
int pateks = 0;
|
||||||
@ -330,7 +330,7 @@ namespace hr { namespace netgen {
|
|||||||
int zeroe = 0;
|
int zeroe = 0;
|
||||||
for(int e=0; e<6; e++) if(nei[zeroi][e] == 0) zeroe = e;
|
for(int e=0; e<6; e++) if(nei[zeroi][e] == 0) zeroe = e;
|
||||||
|
|
||||||
el *= SCALE;
|
el *= nscale;
|
||||||
setRaylen();
|
setRaylen();
|
||||||
|
|
||||||
for(int faza=0; faza<2; faza++) for(int i=0; i<CELLS; i++) {
|
for(int faza=0; faza<2; faza++) for(int i=0; i<CELLS; i++) {
|
||||||
@ -340,8 +340,8 @@ namespace hr { namespace netgen {
|
|||||||
printf("faza %d cell %d\n", faza, i);
|
printf("faza %d cell %d\n", faza, i);
|
||||||
|
|
||||||
for(int e=0; e<t; e++) {
|
for(int e=0; e<t; e++) {
|
||||||
vec v1 = center[i] * SCALE + raylen[i] * ang(rot[i] + 2*M_PI*e/t);
|
vec v1 = center[i] * nscale + raylen[i] * ang(rot[i] + 2*M_PI*e/t);
|
||||||
vec v2 = center[i] * SCALE + raylen[i] * ang(rot[i] + 2*M_PI*(e+1)/t);
|
vec v2 = center[i] * nscale + raylen[i] * ang(rot[i] + 2*M_PI*(e+1)/t);
|
||||||
vec v3 = (v1+v2)/2;
|
vec v3 = (v1+v2)/2;
|
||||||
|
|
||||||
if(faza == 1) blackline(v1, v2);
|
if(faza == 1) blackline(v1, v2);
|
||||||
@ -357,7 +357,7 @@ namespace hr { namespace netgen {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(faza == 0) copyhypertriangle(
|
if(faza == 0) copyhypertriangle(
|
||||||
center[i] * SCALE, v1, v2,
|
center[i] * nscale, v1, v2,
|
||||||
hvec(i,7), hvec(i, (e+ofs)%t), hvec(i, (e+1+ofs)%t)
|
hvec(i,7), hvec(i, (e+ofs)%t), hvec(i, (e+1+ofs)%t)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -406,8 +406,8 @@ namespace hr { namespace netgen {
|
|||||||
IMAGESAVE(net, "papermodel-all" IMAGEEXT);
|
IMAGESAVE(net, "papermodel-all" IMAGEEXT);
|
||||||
IMAGESAVE(hqsurface, "papermodel-source" IMAGEEXT);
|
IMAGESAVE(hqsurface, "papermodel-source" IMAGEEXT);
|
||||||
|
|
||||||
int qx = SX*SCALE/PX;
|
int qx = SX*nscale/PX;
|
||||||
int qy = SY*SCALE/PY;
|
int qy = SY*nscale/PY;
|
||||||
SDL_Surface *quarter = SDL_CreateRGBSurface(SDL_SWSURFACE,qx,qy,32,0,0,0,0);
|
SDL_Surface *quarter = SDL_CreateRGBSurface(SDL_SWSURFACE,qx,qy,32,0,0,0,0);
|
||||||
for(int iy=0; iy<PY; iy++)
|
for(int iy=0; iy<PY; iy++)
|
||||||
for(int ix=0; ix<PX; ix++) {
|
for(int ix=0; ix<PX; ix++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user