mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-30 21:42:59 +00:00 
			
		
		
		
	arg:: used the new add::arg in some contexts
This commit is contained in:
		| @@ -866,16 +866,7 @@ EX namespace bt { | |||||||
|     return point3(log(2) + log(-h[0]), h[1] / co, h[2] / co); |     return point3(log(2) + log(-h[0]), h[1] / co, h[2] / co); | ||||||
|     } |     } | ||||||
|    |    | ||||||
| #if CAP_COMMANDLINE | auto bt_config = arg::add2("-btwidth", [] {arg::shift_arg_formula(vid.binary_width); }); | ||||||
| auto bt_config = addHook(hooks_args, 0, [] () { |  | ||||||
|   using namespace arg; |  | ||||||
|   if(argis("-btwidth")) { |  | ||||||
|     shift_arg_formula(vid.binary_width); |  | ||||||
|     return 0; |  | ||||||
|     } |  | ||||||
|   return 1; |  | ||||||
|   }); |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| EX bool pseudohept(cell *c) { | EX bool pseudohept(cell *c) { | ||||||
|   if(WDIM == 2) |   if(WDIM == 2) | ||||||
|   | |||||||
| @@ -398,6 +398,7 @@ EX namespace arg { | |||||||
|     return 1; |     return 1; | ||||||
|     } |     } | ||||||
|  |  | ||||||
|  |   EX int add1(const string& s, const reaction_t& r) { return add_at(s, 1, r); } | ||||||
|   EX int add2(const string& s, const reaction_t& r) { return add_at(s, 2, r); } |   EX int add2(const string& s, const reaction_t& r) { return add_at(s, 2, r); } | ||||||
|   EX int add3(const string& s, const reaction_t& r) { return add_at(s, 3, r); } |   EX int add3(const string& s, const reaction_t& r) { return add_at(s, 3, r); } | ||||||
|  |  | ||||||
| @@ -419,4 +420,11 @@ EX namespace arg { | |||||||
| EX } | EX } | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | #if !CAP_COMMANDLINE | ||||||
|  | EX namespace arg { | ||||||
|  |   EX int add1(const string& s, const reaction_t& r) { } | ||||||
|  |   EX int add2(const string& s, const reaction_t& r) { } | ||||||
|  |   EX int add3(const string& s, const reaction_t& r) { } | ||||||
|  | EX } | ||||||
|  | #endif | ||||||
| } | } | ||||||
|   | |||||||
| @@ -1077,14 +1077,7 @@ EX void viewmat() { | |||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
| #if CAP_COMMANDLINE | auto floor_hook = arg::add1("-floordebug", [] { floorshape_debug = true; }); | ||||||
| auto floor_hook =  |  | ||||||
|   addHook(hooks_args, 100, [] () { |  | ||||||
|     using namespace arg;              |  | ||||||
|     if(argis("-floordebug")) { floorshape_debug = true; return 0; } |  | ||||||
|     else return 1; |  | ||||||
|     }); |  | ||||||
| #endif |  | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
| #if MAXMDIM < 4 || !CAP_GL | #if MAXMDIM < 4 || !CAP_GL | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								history.cpp
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								history.cpp
									
									
									
									
									
								
							| @@ -702,20 +702,7 @@ EX namespace history { | |||||||
| #endif | #endif | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   #if CAP_COMMANDLINE |   auto hookArg = arg::add3("-playerpath", history::create_playerpath); | ||||||
|   int readArgs() { |  | ||||||
|     using namespace arg; |  | ||||||
|               |  | ||||||
|     if(0) ; |  | ||||||
|     else if(argis("-playerpath")) { |  | ||||||
|       history::create_playerpath(); |  | ||||||
|       } |  | ||||||
|     else return 1; |  | ||||||
|     return 0; |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|   auto hookArg = addHook(hooks_args, 100, readArgs); |  | ||||||
|   #endif   |  | ||||||
|  |  | ||||||
|   auto hooks = addHook(hooks_clearmemory, 0, [] () { |   auto hooks = addHook(hooks_clearmemory, 0, [] () { | ||||||
|     history::renderAutoband(); |     history::renderAutoband(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue