From 8aaf06969c7373700d9a052d82b59bc31035662a Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 6 Oct 2022 12:26:17 +0200 Subject: [PATCH] global_boundary_ratio option --- config.cpp | 3 +++ floorshapes.cpp | 15 ++++++++++----- geometry.cpp | 6 ++++-- pattern2.cpp | 1 + 4 files changed, 18 insertions(+), 7 deletions(-) diff --git a/config.cpp b/config.cpp index 5f4f2663..2ae5d857 100644 --- a/config.cpp +++ b/config.cpp @@ -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") diff --git a/floorshapes.cpp b/floorshapes.cpp index de3c1b9c..e2b5e847 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -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; ic.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; ic.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