mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 05:52:59 +00:00 
			
		
		
		
	when switching dimension in arb/fake, the correct geometry is used for fixmatrix
This commit is contained in:
		| @@ -526,6 +526,13 @@ EX bool use_gmatrix = true; | |||||||
|  |  | ||||||
| EX geometry_information *alt_cgip; | EX geometry_information *alt_cgip; | ||||||
|  |  | ||||||
|  | EX geometry_information *find_alt_cgip() { | ||||||
|  |   if(alt_cgip) return alt_cgip; | ||||||
|  |   check_cgi(); | ||||||
|  |   cgi.require_basics(); | ||||||
|  |   return alt_cgip = cgip; | ||||||
|  |   } | ||||||
|  |  | ||||||
| struct hrmap_archimedean : hrmap { | struct hrmap_archimedean : hrmap { | ||||||
|   map<gp::loc, struct cdata> eucdata; |   map<gp::loc, struct cdata> eucdata; | ||||||
|   heptagon *origin; |   heptagon *origin; | ||||||
| @@ -547,16 +554,11 @@ struct hrmap_archimedean : hrmap { | |||||||
|     if(hyperbolic) { |     if(hyperbolic) { | ||||||
|       dynamicval<eGeometry> g(geometry, gNormal); |       dynamicval<eGeometry> g(geometry, gNormal); | ||||||
|       dynamicval<eVariation> gv(variation, eVariation::pure); |       dynamicval<eVariation> gv(variation, eVariation::pure); | ||||||
|       if(1) { |       dynamicval<geometry_information*> gi(cgip, find_alt_cgip()); | ||||||
|         dynamicval<geometry_information*> gi(cgip, cgip); |       alt = init_heptagon(S7); | ||||||
|         check_cgi(); |       alt->s = hsOrigin; | ||||||
|         cgi.require_basics(); |       alt->alt = alt; | ||||||
|         alt_cgip = cgip; |       current_altmap = newAltMap(alt); | ||||||
|         alt = init_heptagon(S7); |  | ||||||
|         alt->s = hsOrigin; |  | ||||||
|         alt->alt = alt; |  | ||||||
|         current_altmap = newAltMap(alt); |  | ||||||
|         } |  | ||||||
|       } |       } | ||||||
|  |  | ||||||
|     transmatrix T = xpush(.01241) * spin(1.4117) * xpush(0.1241) * Id; |     transmatrix T = xpush(.01241) * spin(1.4117) * xpush(0.1241) * Id; | ||||||
| @@ -601,7 +603,7 @@ struct hrmap_archimedean : hrmap { | |||||||
|     if(current_altmap) { |     if(current_altmap) { | ||||||
|       dynamicval<eGeometry> g(geometry, gNormal);        |       dynamicval<eGeometry> g(geometry, gNormal);        | ||||||
|       dynamicval<eVariation> gv(variation, eVariation::pure); |       dynamicval<eVariation> gv(variation, eVariation::pure); | ||||||
|       dynamicval<geometry_information*> gi(cgip, alt_cgip); |       dynamicval<geometry_information*> gi(cgip, find_alt_cgip()); | ||||||
|       delete current_altmap; |       delete current_altmap; | ||||||
|       current_altmap = NULL; |       current_altmap = NULL; | ||||||
|       } |       } | ||||||
| @@ -632,7 +634,7 @@ struct hrmap_archimedean : hrmap { | |||||||
|     if(hyperbolic) { |     if(hyperbolic) { | ||||||
|       dynamicval<eGeometry> g(geometry, gNormal); |       dynamicval<eGeometry> g(geometry, gNormal); | ||||||
|       dynamicval<eVariation> gv(variation, eVariation::pure); |       dynamicval<eVariation> gv(variation, eVariation::pure); | ||||||
|       dynamicval<geometry_information*> gi(cgip, alt_cgip); |       dynamicval<geometry_information*> gi(cgip, find_alt_cgip()); | ||||||
|       dynamicval<hrmap*> cm(currentmap, current_altmap); |       dynamicval<hrmap*> cm(currentmap, current_altmap); | ||||||
|       U = T; |       U = T; | ||||||
|       current_altmap->virtualRebase(alt, T); |       current_altmap->virtualRebase(alt, T); | ||||||
| @@ -1040,8 +1042,15 @@ auto hook = | |||||||
|  |  | ||||||
| #if MAXMDIM >= 4 | #if MAXMDIM >= 4 | ||||||
| auto hooksw = addHook(hooks_swapdim, 100, [] { | auto hooksw = addHook(hooks_swapdim, 100, [] { | ||||||
|  |  | ||||||
|  |   dynamicval<eGeometry> g(geometry, gNormal); | ||||||
|  |   dynamicval<eVariation> gv(variation, eVariation::pure); | ||||||
|  |   dynamicval<geometry_information*> gi(cgip, find_alt_cgip()); | ||||||
|  |  | ||||||
|   for(auto& p: altmap) for(auto& pp: p.second) swapmatrix(pp.second); |   for(auto& p: altmap) for(auto& pp: p.second) swapmatrix(pp.second); | ||||||
|   for(auto& p: archimedean_gmatrix) swapmatrix(p.second.second); |   for(auto& p: archimedean_gmatrix) swapmatrix(p.second.second); | ||||||
|  |  | ||||||
|  |   alt_cgip = nullptr; | ||||||
|   }); |   }); | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue