mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	global_boundary_ratio option
This commit is contained in:
		| @@ -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 " |     "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 " |     "the original IDs in case if extra tile types were added to " | ||||||
|     "separate mirror images or different football types.", 'd'); |     "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(vid.gp_autoscale_heights, "3D Goldberg autoscaling", true);   | ||||||
|   addsaver(scorefile, "savefile"); |   addsaver(scorefile, "savefile"); | ||||||
|   param_b(savefile_selection, "savefile_selection") |   param_b(savefile_selection, "savefile_selection") | ||||||
|   | |||||||
| @@ -29,6 +29,8 @@ EX struct renderbuffer *floor_textures; | |||||||
| /* 0: generate no floorshapes; 1: generate only plain floorshapes; 2: generate all */ | /* 0: generate no floorshapes; 1: generate only plain floorshapes; 2: generate all */ | ||||||
| EX int floorshapes_level = 2; | EX int floorshapes_level = 2; | ||||||
|  |  | ||||||
|  | EX ld global_boundary_ratio = 1; | ||||||
|  |  | ||||||
| void geometry_information::init_floorshapes() { | void geometry_information::init_floorshapes() { | ||||||
|   if(floorshapes_level == 0) return; |   if(floorshapes_level == 0) return; | ||||||
|   all_escher_floorshapes.clear(); |   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(&fsh == &shTriheptaFloor) { | ||||||
|       if(!siid) { |       if(!siid) { | ||||||
|         for(int i=0; i<cor; i++) |         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 { |       else { | ||||||
|         for(int i=0; i<cor; i++) { |         for(int i=0; i<cor; i++) { | ||||||
|           int ri = i; |           int ri = i; | ||||||
|           if((i&1) == ((sidir+siid)&1)) ri--; |           if((i&1) == ((sidir+siid)&1)) ri--; | ||||||
|           ri = c->c.fix(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) { |     else if(&fsh == &shBigTriangle) { | ||||||
|  |       ld val = 1 - 0.06 * global_boundary_ratio; | ||||||
|       if(!siid) { |       if(!siid) { | ||||||
|         for(int i=0; i<cor; i++) cornerlist.push_back(hpxy(0,0)); |         for(int i=0; i<cor; i++) cornerlist.push_back(hpxy(0,0)); | ||||||
|         } |         } | ||||||
|       else if(geosupport_chessboard()) { |       else if(geosupport_chessboard()) { | ||||||
|         for(int i=0; i<cor; i++) { |         for(int i=0; i<cor; i++) { | ||||||
|           hyperpoint nc = nearcorner(c, 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 { |       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--; |           if((i&1) != ((sidir+siid)&1)) ri--; | ||||||
|           ri = c->c.fix(ri); |           ri = c->c.fix(ri); | ||||||
|           hyperpoint nc = nearcorner(c, 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) { |     else if(&fsh == &shBigHepta) { | ||||||
|  |       ld val = 1 - 0.06 * global_boundary_ratio; | ||||||
|       if(!siid) { |       if(!siid) { | ||||||
|         for(int i=0; i<cor; i++) { |         for(int i=0; i<cor; i++) { | ||||||
|           hyperpoint nc = nearcorner(c, 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 { |       else { | ||||||
|   | |||||||
| @@ -785,8 +785,8 @@ void geometry_information::prepare_basics() { | |||||||
|   if(scale_used()) zhexf *= vid.creature_scale; |   if(scale_used()) zhexf *= vid.creature_scale; | ||||||
|   if(WDIM == 2 && GDIM == 3) zhexf *= 1.5, orbsize *= 1.2; |   if(WDIM == 2 && GDIM == 3) zhexf *= 1.5, orbsize *= 1.2; | ||||||
|  |  | ||||||
|   floorrad0 = hexvdist* (GDIM == 3 ? 1 : 0.92); |   floorrad0 = hexvdist* (GDIM == 3 ? 1 : 1 - 0.08 * global_boundary_ratio); | ||||||
|   floorrad1 = rhexf * (GDIM == 3 ? 1 : 0.94); |   floorrad1 = rhexf * (GDIM == 3 ? 1 : 1 - 0.06 * global_boundary_ratio); | ||||||
|    |    | ||||||
|   if(euc::in(2,4)) { |   if(euc::in(2,4)) { | ||||||
|     if(!BITRUNCATED) |     if(!BITRUNCATED) | ||||||
| @@ -1186,6 +1186,8 @@ EX string cgi_string() { | |||||||
|  |  | ||||||
|   if(arb::in()) V("F", its(arb::extended_football)); |   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(cryst) V("CRYSTAL", its(ginf[gCrystal].sides) + its(ginf[gCrystal].vertex)); | ||||||
|    |    | ||||||
|   if(bt::in() || GDIM == 3) V("WQ", its(vid.texture_step)); |   if(bt::in() || GDIM == 3) V("WQ", its(vid.texture_step)); | ||||||
|   | |||||||
| @@ -2078,6 +2078,7 @@ EX namespace patterns { | |||||||
|       } |       } | ||||||
|  |  | ||||||
|     dialog::addBoolItem(XLAT("display full floors"), (whichShape == '9'), '9'); |     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::addSelItem(XLAT("floor type"), XLATN(winf[canvas_default_wall].name), 'i'); | ||||||
|  |  | ||||||
|     dialog::addItem(XLAT("line patterns"), 'L'); |     dialog::addItem(XLAT("line patterns"), 'L'); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue