1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-20 15:40:26 +00:00

arb:: two new parameters, boundary_ratio and floor_scale

This commit is contained in:
Zeno Rogue 2021-07-30 12:12:25 +02:00
parent d0e7541b45
commit 253c5ee531
3 changed files with 16 additions and 2 deletions

View File

@ -80,6 +80,8 @@ struct arbi_tiling {
ld cscale;
int range;
ld floor_scale;
ld boundary_ratio;
string filename;
geometryinfo1& get_geometry();
@ -381,6 +383,8 @@ EX void load(const string& fname, bool after_sliding IS(false)) {
c.filename = fname;
c.cscale = 1;
c.range = 0;
c.boundary_ratio = 1;
c.floor_scale = .5;
exp_parser ep;
ep.s = s;
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();
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(\"")) {
string s = "";
while(true) {
@ -1147,6 +1159,8 @@ EX void convert() {
ac.order++;
ac.comment = ac.filename = "converted from: " + full_geometry_name();
ac.cscale = cgi.scalefactor;
ac.boundary_ratio = 1;
ac.floor_scale = cgi.hexvdist / cgi.scalefactor;
ac.range = cgi.base_distlimit;
int N = isize(old_shvids);
ac.shapes.resize(N);

View File

@ -441,7 +441,7 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
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;
for(int j=0; j<cor; j++) {

View File

@ -731,7 +731,7 @@ void geometry_information::prepare_basics() {
auto csc = arb::current_or_slided().cscale;
scalefactor = 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;
}