mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	fixed switching to 2d field quotient after 3d field quotient, and refactored
This commit is contained in:
		| @@ -1366,10 +1366,13 @@ EX void enableFieldChange() { | |||||||
|   fieldpattern::quotient_field_changed = true; |   fieldpattern::quotient_field_changed = true; | ||||||
|   nextPrimes(gxcur); |   nextPrimes(gxcur); | ||||||
|   dynamicval<eGeometry> g(geometry, gFieldQuotient); |   dynamicval<eGeometry> g(geometry, gFieldQuotient); | ||||||
|  |   ginf[geometry].g = ginf[gxcur.base].g; | ||||||
|   ginf[geometry].sides = ginf[gxcur.base].sides; |   ginf[geometry].sides = ginf[gxcur.base].sides; | ||||||
|   ginf[geometry].vertex = ginf[gxcur.base].vertex; |   ginf[geometry].vertex = ginf[gxcur.base].vertex; | ||||||
|   ginf[geometry].distlimit = ginf[gxcur.base].distlimit; |   ginf[geometry].distlimit = ginf[gxcur.base].distlimit; | ||||||
|   ginf[geometry].tiling_name = ginf[gxcur.base].tiling_name; |   ginf[geometry].tiling_name = ginf[gxcur.base].tiling_name; | ||||||
|  |   ginf[geometry].default_variation = ginf[gxcur.base].default_variation; | ||||||
|  |   ginf[geometry].flags = qFIELD | qANYQ | qBOUNDED; | ||||||
|   fieldpattern::current_quotient_field.init(gxcur.primes[gxcur.current_prime_id].p); |   fieldpattern::current_quotient_field.init(gxcur.primes[gxcur.current_prime_id].p); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
							
								
								
									
										24
									
								
								geom-exp.cpp
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								geom-exp.cpp
									
									
									
									
									
								
							| @@ -1138,6 +1138,20 @@ EX void field_quotient_3d(int p, unsigned hash) { | |||||||
|   println(hlog, "set prime = ", currfp.Prime); |   println(hlog, "set prime = ", currfp.Prime); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | EX void field_quotient_2d(int group, int id, int triplet) { | ||||||
|  |   using namespace fieldpattern; | ||||||
|  |   current_extra = group; | ||||||
|  |  | ||||||
|  |   auto& gxcur = fgeomextras[current_extra]; | ||||||
|  |   while(id >= isize(gxcur.primes)) nextPrime(gxcur); | ||||||
|  |  | ||||||
|  |   fgeomextras[current_extra].current_prime_id = id; | ||||||
|  |   if(triplet != -1) | ||||||
|  |     triplet_id = triplet; | ||||||
|  |   enableFieldChange(); | ||||||
|  |   set_geometry(gFieldQuotient); | ||||||
|  |   } | ||||||
|  |  | ||||||
| int read_geom_args() { | int read_geom_args() { | ||||||
|   using namespace arg; |   using namespace arg; | ||||||
|   if(0) ; |   if(0) ; | ||||||
| @@ -1154,15 +1168,7 @@ int read_geom_args() { | |||||||
|     stop_game_and_switch_mode(rg::nothing); |     stop_game_and_switch_mode(rg::nothing); | ||||||
|     int a, b; |     int a, b; | ||||||
|     shift(); sscanf(argcs(), "%d,%d", &a, &b); |     shift(); sscanf(argcs(), "%d,%d", &a, &b); | ||||||
|     using namespace fieldpattern; |     field_quotient_2d(a, b, -1); | ||||||
|     current_extra = a; |  | ||||||
|  |  | ||||||
|     auto& gxcur = fgeomextras[current_extra]; |  | ||||||
|     while(b >= isize(gxcur.primes)) nextPrime(gxcur); |  | ||||||
|  |  | ||||||
|     fgeomextras[current_extra].current_prime_id = b; |  | ||||||
|     enableFieldChange(); |  | ||||||
|     set_geometry(gFieldQuotient); |  | ||||||
|     } |     } | ||||||
|   else if(argis("-triplet")) { |   else if(argis("-triplet")) { | ||||||
|     stop_game(); |     stop_game(); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue