mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	intra:: improved be-square
This commit is contained in:
		
							
								
								
									
										25
									
								
								intra.cpp
									
									
									
									
									
								
							
							
						
						
									
										25
									
								
								intra.cpp
									
									
									
									
									
								
							| @@ -663,18 +663,31 @@ EX void load_saved_portals() { | |||||||
|   for(const auto& p: portals_to_save) connect_portal(p.cw1, p.cw2, p.spin); |   for(const auto& p: portals_to_save) connect_portal(p.cw1, p.cw2, p.spin); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | EX void be_ratio(ld v IS(1)) { | ||||||
|  |   check_cgi(); | ||||||
|  |   cgi.require_basics(); | ||||||
|  |   PIU( vid.plevel_factor = v * cgi.edgelen / cgi.scalefactor ); | ||||||
|  |   check_cgi(); | ||||||
|  |   cgi.require_basics(); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  | EX void be_ratio_edge(int i, ld v IS(1)) { | ||||||
|  |   start_game(); | ||||||
|  |   ld len = hdist(currentmap->get_corner(cwt.at, i), currentmap->get_corner(cwt.at, (i+1)%cwt.at->type)); | ||||||
|  |   PIU( vid.plevel_factor = v * len / cgi.scalefactor ); | ||||||
|  |   check_cgi(); | ||||||
|  |   cgi.require_basics(); | ||||||
|  |   } | ||||||
|  |  | ||||||
| auto hooks1 = | auto hooks1 = | ||||||
|   addHook(hooks_o_key, 90, [] (o_funcs& v) { |   addHook(hooks_o_key, 90, [] (o_funcs& v) { | ||||||
|     if(intra::in) v.push_back(named_dialog(XLAT("manage portals"), show_portals)); |     if(intra::in) v.push_back(named_dialog(XLAT("manage portals"), show_portals)); | ||||||
|     }) |     }) | ||||||
|   + arg::add3("-intra-add", [] { start_game(); become(); }) |   + arg::add3("-intra-add", [] { start_game(); become(); }) | ||||||
|   + arg::add3("-intra-start", [] { start_game(); become(); start(0); }) |   + arg::add3("-intra-start", [] { start_game(); become(); start(0); }) | ||||||
|   + arg::add3("-be-square", [] {  |   + arg::add3("-be-square", [] { be_ratio(); }) | ||||||
|       check_cgi(); |   + arg::add3("-be-square-edge", [] { | ||||||
|       cgi.require_basics(); |       arg::shift(); int i = arg::argi(); be_ratio_edge(i); | ||||||
|       PIU( vid.plevel_factor = cgi.edgelen / cgi.scalefactor ); |  | ||||||
|       check_cgi(); |  | ||||||
|       cgi.require_basics(); |  | ||||||
|       }) |       }) | ||||||
|   + arg::add3("-debug-portal", [] { arg::shift(); debug_portal = arg::argi(); }); |   + arg::add3("-debug-portal", [] { arg::shift(); debug_portal = arg::argi(); }); | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue