mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-05-28 20:14:06 +00:00
arb:: two new parameters, boundary_ratio and floor_scale
This commit is contained in:
parent
d0e7541b45
commit
253c5ee531
@ -80,6 +80,8 @@ struct arbi_tiling {
|
|||||||
|
|
||||||
ld cscale;
|
ld cscale;
|
||||||
int range;
|
int range;
|
||||||
|
ld floor_scale;
|
||||||
|
ld boundary_ratio;
|
||||||
string filename;
|
string filename;
|
||||||
|
|
||||||
geometryinfo1& get_geometry();
|
geometryinfo1& get_geometry();
|
||||||
@ -381,6 +383,8 @@ EX void load(const string& fname, bool after_sliding IS(false)) {
|
|||||||
c.filename = fname;
|
c.filename = fname;
|
||||||
c.cscale = 1;
|
c.cscale = 1;
|
||||||
c.range = 0;
|
c.range = 0;
|
||||||
|
c.boundary_ratio = 1;
|
||||||
|
c.floor_scale = .5;
|
||||||
exp_parser ep;
|
exp_parser ep;
|
||||||
ep.s = s;
|
ep.s = s;
|
||||||
ld angleunit = 1, distunit = 1, angleofs = 0;
|
ld angleunit = 1, distunit = 1, angleofs = 0;
|
||||||
@ -496,6 +500,14 @@ EX void load(const string& fname, bool after_sliding IS(false)) {
|
|||||||
c.range = ep.iparse();
|
c.range = ep.iparse();
|
||||||
ep.force_eat(")");
|
ep.force_eat(")");
|
||||||
}
|
}
|
||||||
|
else if(ep.eat("floor_scale(")) {
|
||||||
|
c.floor_scale = ep.rparse();
|
||||||
|
ep.force_eat(")");
|
||||||
|
}
|
||||||
|
else if(ep.eat("boundary_ratio(")) {
|
||||||
|
c.boundary_ratio = ep.rparse();
|
||||||
|
ep.force_eat(")");
|
||||||
|
}
|
||||||
else if(ep.eat("conway(\"")) {
|
else if(ep.eat("conway(\"")) {
|
||||||
string s = "";
|
string s = "";
|
||||||
while(true) {
|
while(true) {
|
||||||
@ -1147,6 +1159,8 @@ EX void convert() {
|
|||||||
ac.order++;
|
ac.order++;
|
||||||
ac.comment = ac.filename = "converted from: " + full_geometry_name();
|
ac.comment = ac.filename = "converted from: " + full_geometry_name();
|
||||||
ac.cscale = cgi.scalefactor;
|
ac.cscale = cgi.scalefactor;
|
||||||
|
ac.boundary_ratio = 1;
|
||||||
|
ac.floor_scale = cgi.hexvdist / cgi.scalefactor;
|
||||||
ac.range = cgi.base_distlimit;
|
ac.range = cgi.base_distlimit;
|
||||||
int N = isize(old_shvids);
|
int N = isize(old_shvids);
|
||||||
ac.shapes.resize(N);
|
ac.shapes.resize(N);
|
||||||
|
@ -441,7 +441,7 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
|
|||||||
min_dist = dist;
|
min_dist = dist;
|
||||||
}
|
}
|
||||||
|
|
||||||
ld dist = min_dist * (1 - 3 / sca);
|
ld dist = min_dist * (1 - 3 / sca) * arb::current_or_slided().boundary_ratio;
|
||||||
|
|
||||||
ld area = 0;
|
ld area = 0;
|
||||||
for(int j=0; j<cor; j++) {
|
for(int j=0; j<cor; j++) {
|
||||||
|
@ -731,7 +731,7 @@ void geometry_information::prepare_basics() {
|
|||||||
auto csc = arb::current_or_slided().cscale;
|
auto csc = arb::current_or_slided().cscale;
|
||||||
scalefactor = csc;
|
scalefactor = csc;
|
||||||
hcrossf = crossf = orbsize = hcrossf7 * csc;
|
hcrossf = crossf = orbsize = hcrossf7 * csc;
|
||||||
hexf = rhexf = hexvdist = csc * .5;
|
hexf = rhexf = hexvdist = csc * arb::current_or_slided().floor_scale;
|
||||||
base_distlimit = arb::current.range;
|
base_distlimit = arb::current.range;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user