global_boundary_ratio option

This commit is contained in:
Zeno Rogue 2022-10-06 12:26:17 +02:00
parent f4cf3440ff
commit 8aaf06969c
4 changed files with 18 additions and 7 deletions

View File

@ -2504,6 +2504,9 @@ EX int config3 = addHook(hooks_configfile, 100, [] {
"Setting 1 uses the internal shape IDs, while setting 2 in tes files uses "
"the original IDs in case if extra tile types were added to "
"separate mirror images or different football types.", 'd');
param_f(global_boundary_ratio, "global_boundary_ratio")
->editable(0, 5, 0.1, "Width of cell boundaries",
"How wide should the cell boundaries be.", 'b');
addsaver(vid.gp_autoscale_heights, "3D Goldberg autoscaling", true);
addsaver(scorefile, "savefile");
param_b(savefile_selection, "savefile_selection")

View File

@ -29,6 +29,8 @@ EX struct renderbuffer *floor_textures;
/* 0: generate no floorshapes; 1: generate only plain floorshapes; 2: generate all */
EX int floorshapes_level = 2;
EX ld global_boundary_ratio = 1;
void geometry_information::init_floorshapes() {
if(floorshapes_level == 0) return;
all_escher_floorshapes.clear();
@ -421,26 +423,28 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
if(&fsh == &shTriheptaFloor) {
if(!siid) {
for(int i=0; i<cor; i++)
cornerlist.push_back(midcorner(c, i, .49));
cornerlist.push_back(midcorner(c, i, .5 - .01 * global_boundary_ratio));
}
else {
for(int i=0; i<cor; i++) {
int ri = i;
if((i&1) == ((sidir+siid)&1)) ri--;
ri = c->c.fix(ri);
cornerlist.push_back(mid(get_corner_position(c, ri, 3.1), get_corner_position(c, c->c.fix(ri+1), 3.1)));
ld val = 3 + 0.1 * global_boundary_ratio;
cornerlist.push_back(mid(get_corner_position(c, ri, val), get_corner_position(c, c->c.fix(ri+1), val)));
}
}
}
else if(&fsh == &shBigTriangle) {
ld val = 1 - 0.06 * global_boundary_ratio;
if(!siid) {
for(int i=0; i<cor; i++) cornerlist.push_back(hpxy(0,0));
}
else if(geosupport_chessboard()) {
for(int i=0; i<cor; i++) {
hyperpoint nc = nearcorner(c, i);
cornerlist.push_back(mid_at(hpxy(0,0), nc, .94));
cornerlist.push_back(mid_at(hpxy(0,0), nc, val));
}
}
else {
@ -449,16 +453,17 @@ void geometry_information::generate_floorshapes_for(int id, cell *c, int siid, i
if((i&1) != ((sidir+siid)&1)) ri--;
ri = c->c.fix(ri);
hyperpoint nc = nearcorner(c, ri);
cornerlist.push_back(mid_at(hpxy(0,0), nc, .94));
cornerlist.push_back(mid_at(hpxy(0,0), nc, val));
}
}
}
else if(&fsh == &shBigHepta) {
ld val = 1 - 0.06 * global_boundary_ratio;
if(!siid) {
for(int i=0; i<cor; i++) {
hyperpoint nc = nearcorner(c, i);
cornerlist.push_back(mid_at(hpxy(0,0), nc, .94));
cornerlist.push_back(mid_at(hpxy(0,0), nc, val));
}
}
else {

View File

@ -785,8 +785,8 @@ void geometry_information::prepare_basics() {
if(scale_used()) zhexf *= vid.creature_scale;
if(WDIM == 2 && GDIM == 3) zhexf *= 1.5, orbsize *= 1.2;
floorrad0 = hexvdist* (GDIM == 3 ? 1 : 0.92);
floorrad1 = rhexf * (GDIM == 3 ? 1 : 0.94);
floorrad0 = hexvdist* (GDIM == 3 ? 1 : 1 - 0.08 * global_boundary_ratio);
floorrad1 = rhexf * (GDIM == 3 ? 1 : 1 - 0.06 * global_boundary_ratio);
if(euc::in(2,4)) {
if(!BITRUNCATED)
@ -1186,6 +1186,8 @@ EX string cgi_string() {
if(arb::in()) V("F", its(arb::extended_football));
V("BR", fts(global_boundary_ratio));
if(cryst) V("CRYSTAL", its(ginf[gCrystal].sides) + its(ginf[gCrystal].vertex));
if(bt::in() || GDIM == 3) V("WQ", its(vid.texture_step));

View File

@ -2078,6 +2078,7 @@ EX namespace patterns {
}
dialog::addBoolItem(XLAT("display full floors"), (whichShape == '9'), '9');
add_edit(global_boundary_ratio);
dialog::addSelItem(XLAT("floor type"), XLATN(winf[canvas_default_wall].name), 'i');
dialog::addItem(XLAT("line patterns"), 'L');