mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	more care to render Yendor/Compass 'X' inside the viewable screen
This commit is contained in:
		| @@ -134,8 +134,11 @@ EX cell *findcompass(cell *c) { | |||||||
|   int d = compassDist(c); |   int d = compassDist(c); | ||||||
|   if(among(d, NOCOMPASS, ALTDIST_BOUNDARY, ALTDIST_UNKNOWN, ALTDIST_ERROR)) return NULL; |   if(among(d, NOCOMPASS, ALTDIST_BOUNDARY, ALTDIST_UNKNOWN, ALTDIST_ERROR)) return NULL; | ||||||
|   auto w = whichCompass(c); |   auto w = whichCompass(c); | ||||||
|  |  | ||||||
|  |   auto gc = c; | ||||||
|    |    | ||||||
|   while(inscreenrange(c)) { |   while(inscreenrange(c)) { | ||||||
|  |     gc = c; | ||||||
|     if(!eubinary && !sphere && !quotient) |     if(!eubinary && !sphere && !quotient) | ||||||
|       currentmap->extend_altmap(c->master); |       currentmap->extend_altmap(c->master); | ||||||
|     forCellEx(c2, c) if(w == whichCompass(c2) && compassDist(c2) < d) { |     forCellEx(c2, c) if(w == whichCompass(c2) && compassDist(c2) < d) { | ||||||
| @@ -152,7 +155,7 @@ EX cell *findcompass(cell *c) { | |||||||
|     nextk: ; |     nextk: ; | ||||||
|     } |     } | ||||||
|    |    | ||||||
|   return c; |   return gc; | ||||||
|   } |   } | ||||||
|  |  | ||||||
| EX bool grailWasFound(cell *c) { | EX bool grailWasFound(cell *c) { | ||||||
|   | |||||||
							
								
								
									
										21
									
								
								graph.cpp
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								graph.cpp
									
									
									
									
									
								
							| @@ -6315,12 +6315,27 @@ EX void drawBug(const cellwalker& cw, color_t col) { | |||||||
| #endif | #endif | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | EX bool inscreenrange_actual(cell *c) { | ||||||
|  |   if(GDIM == 3) return true; | ||||||
|  |   hyperpoint h1; applymodel(ggmatrix(c) * tile_center(), h1); | ||||||
|  |   if(invalid_point(h1)) return false; | ||||||
|  |   auto hscr = toscrcoord(h1); | ||||||
|  |   auto& x = hscr[0], y = hscr[1]; | ||||||
|  |   if(x > current_display->xtop + current_display->xsize) return false; | ||||||
|  |   if(x < current_display->xtop) return false; | ||||||
|  |   if(y > current_display->ytop + current_display->ysize) return false; | ||||||
|  |   if(y < current_display->ytop) return false; | ||||||
|  |   return true; | ||||||
|  |   } | ||||||
|  |  | ||||||
| EX bool inscreenrange(cell *c) { | EX bool inscreenrange(cell *c) { | ||||||
|   if(sphere) return true; |   if(sphere) return true; | ||||||
|   if(euclid) return celldistance(centerover, c) <= get_sightrange_ambush(); |   if(euclid) return celldistance(centerover, c) <= get_sightrange_ambush() && inscreenrange_actual(c); | ||||||
|   if(nonisotropic) return gmatrix.count(c); |   if(nonisotropic) return gmatrix.count(c); | ||||||
|   if(geometry == gCrystal344) return gmatrix.count(c); |   if(geometry == gCrystal344) return gmatrix.count(c) && inscreenrange_actual(c); | ||||||
|   return heptdistance(centerover, c) <= 8; |   auto hd = heptdistance(centerover, c); | ||||||
|  |   if(hd <= 1) return true; | ||||||
|  |   return hd <= 8 && inscreenrange_actual(c); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| #if MAXMDIM >= 4 | #if MAXMDIM >= 4 | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue