mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	Merge branch 'master' of https://github.com/zenorogue/hyperrogue
This commit is contained in:
		| @@ -116,7 +116,15 @@ void celldrawer::addaura() { | |||||||
| /* Eclectic City's version of Red Rock is of slightly different color, */ | /* Eclectic City's version of Red Rock is of slightly different color, */ | ||||||
| /* to make it different from hot cells */ | /* to make it different from hot cells */ | ||||||
| void eclectic_red(color_t& col) { | void eclectic_red(color_t& col) { | ||||||
|  |   if (!higher_contrast) { | ||||||
|     part(col, 0) = part(col, 2) * 3 / 4; |     part(col, 0) = part(col, 2) * 3 / 4; | ||||||
|  |     } else { | ||||||
|  |     auto v = part(col, 0) + part(col, 1) + part(col, 2); | ||||||
|  |     auto t = part(col, 0); | ||||||
|  |     part(col, 0) = part(col, 1); | ||||||
|  |     part(col, 1) = part(col, 2); | ||||||
|  |     part(col, 2) = t + v/3; | ||||||
|  |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
| constexpr ld spinspeed = .75 / M_PI; | constexpr ld spinspeed = .75 / M_PI; | ||||||
| @@ -718,7 +726,10 @@ int celldrawer::getSnakelevColor(int i, int last) { | |||||||
|     if(c->land == laEclectic) |     if(c->land == laEclectic) | ||||||
|       eclectic_red(col); |       eclectic_red(col); | ||||||
|     } |     } | ||||||
|  |   if (!higher_contrast) | ||||||
|     return darkena(col, fd, 0xFF); |     return darkena(col, fd, 0xFF); | ||||||
|  |   else | ||||||
|  |     return darkena(col, 0, 0xFF); | ||||||
|   } |   } | ||||||
|  |  | ||||||
| void celldrawer::draw_wallshadow() { | void celldrawer::draw_wallshadow() { | ||||||
|   | |||||||
							
								
								
									
										10
									
								
								util.cpp
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								util.cpp
									
									
									
									
									
								
							| @@ -615,17 +615,17 @@ color_t exp_parser::parsecolor(int prio) { | |||||||
|   string token = next_token(); |   string token = next_token(); | ||||||
|   if(params.count(token)) return (color_t) real(params[token]->get_cld()); |   if(params.count(token)) return (color_t) real(params[token]->get_cld()); | ||||||
|  |  | ||||||
|   auto p = find_color_by_name(s); |   auto p = find_color_by_name(token); | ||||||
|   if(p) return (p->second << 8) | 0xFF; |   if(p) return (p->second << 8) | 0xFF; | ||||||
|  |  | ||||||
|   color_t res; |   color_t res; | ||||||
|   if(s.size() == 6) { |   if(token.size() == 6) { | ||||||
|     int qty = sscanf(s.c_str(), "%x", &res); |     int qty = sscanf(token.c_str(), "%x", &res); | ||||||
|     if(qty == 0) throw hr_parse_exception("color parse error"); |     if(qty == 0) throw hr_parse_exception("color parse error"); | ||||||
|     return res * 256 + 0xFF; |     return res * 256 + 0xFF; | ||||||
|     } |     } | ||||||
|   else if(s.size() == 8) { |   else if(token.size() == 8) { | ||||||
|     int qty = sscanf(s.c_str(), "%x", &res); |     int qty = sscanf(token.c_str(), "%x", &res); | ||||||
|     if(qty == 0) throw hr_parse_exception("color parse error"); |     if(qty == 0) throw hr_parse_exception("color parse error"); | ||||||
|     return res; |     return res; | ||||||
|    } |    } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue