mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-30 21:42:59 +00:00 
			
		
		
		
	extended 'linewidth' setting: illustration mode, hint about Alt, disable shadows, bright mode, colorblind simulation
This commit is contained in:
		| @@ -567,8 +567,23 @@ void celldrawer::setcolors() { | ||||
|   if(!wmspatial && snakelevel(c) && !realred(c->wall)) fcol = wcol; | ||||
|    | ||||
|   if(c->wall == waGlass && !wmspatial) fcol = wcol;   | ||||
|    | ||||
|   if(neon_mode == 4) { | ||||
|     fcol = highwall(c) ? w_monochromatize(fcol, 0) : w_monochromatize(fcol, 1); | ||||
|     wcol = w_monochromatize(wcol, 0); | ||||
|     if(c->land == laWarpCoast && !pseudohept(c) && c->wall == waNone) fcol = 0x707070; | ||||
|     } | ||||
|   } | ||||
|  | ||||
| EX color_t w_monochromatize(color_t x, int d) { | ||||
|   int c = part(x,2) + part(x,1) + part(x, 0) + 1; | ||||
|   c /= 3; | ||||
|   if(d == 0) c = c; | ||||
|   else c = (c + 2 * 255) / 3; | ||||
|   return c * 0x10101; | ||||
|   } | ||||
|  | ||||
|  | ||||
| void celldrawer::tune_colors() { | ||||
|   if(inmirror(c)) { | ||||
|     // for debugging | ||||
| @@ -708,7 +723,7 @@ void celldrawer::draw_wall() { | ||||
|         } | ||||
|       else { | ||||
|         forCellIdEx(c2, i, c)  | ||||
|           if(!highwall(c2) || conegraph(c2)) { | ||||
|           if(!highwall(c2) || conegraph(c2) || neon_mode == 4) { | ||||
|           if(placeSidewall(c, i, SIDE_WALL, V, darkena(wcol2, fd, alpha))) break; | ||||
|           } | ||||
|         } | ||||
| @@ -2451,6 +2466,7 @@ void celldrawer::draw() { | ||||
|     ct6 = ctof(c); | ||||
|     #endif | ||||
|     fd = getfd(c); | ||||
|     if(neon_mode == 4) fd = 0; | ||||
|     error = false; | ||||
|      | ||||
|     setcolors(); | ||||
|   | ||||
							
								
								
									
										11
									
								
								config.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								config.cpp
									
									
									
									
									
								
							| @@ -641,6 +641,9 @@ EX void initConfig() { | ||||
|   addsaver(nilv::nilperiod[2], "nilperiod_z"); | ||||
|    | ||||
|   addsaver(neon_mode, "neon_mode"); | ||||
|   addsaver(noshadow, "noshadow"); | ||||
|   addsaver(bright, "bright"); | ||||
|   addsaver(cblind, "cblind"); | ||||
|  | ||||
|   callhooks(hooks_configfile); | ||||
|  | ||||
| @@ -1144,6 +1147,14 @@ EX void showGraphConfig() { | ||||
|         dialog::add_action([] { neon_mode = 2; }); | ||||
|         dialog::addBoolItem("neon mode II", neon_mode == 3, 'D'); | ||||
|         dialog::add_action([] { neon_mode = 3; }); | ||||
|         dialog::addBoolItem("illustration mode", neon_mode == 4, 'E'); | ||||
|         dialog::add_action([] { neon_mode = 4; }); | ||||
|         dialog::addBreak(100); | ||||
|         dialog::addInfo(XLAT("hint: press Alt while testing modes")); | ||||
|         dialog::addBreak(100); | ||||
|         dialog::addBoolItem_action("disable shadows", noshadow, 'F'); | ||||
|         dialog::addBoolItem_action("bright mode", bright, 'G'); | ||||
|         dialog::addBoolItem_action("colorblind simulation", cblind, 'H'); | ||||
|         }; | ||||
|       } | ||||
|      | ||||
|   | ||||
							
								
								
									
										32
									
								
								drawing.cpp
									
									
									
									
									
								
							
							
						
						
									
										32
									
								
								drawing.cpp
									
									
									
									
									
								
							| @@ -2028,6 +2028,25 @@ EX void apply_neon(color_t& col, int& r) { | ||||
|  | ||||
| #if CAP_SHAPES | ||||
|  | ||||
| EX color_t magentize(color_t x) { | ||||
|   if(neon_mode != 4) return x; | ||||
|   int green = part(x,2); | ||||
|   int magenta = (part(x, 1) + part(x, 3)) / 2; | ||||
|   int nm = max(magenta, green); | ||||
|   int gm = (magenta + green)/2; | ||||
|   nm = (nm + 255) / 2; | ||||
|   gm = gm / 2; | ||||
|    | ||||
|   return (nm * 0x1000100) | (gm * 0x10000) | (part(x, 0)); | ||||
|   } | ||||
|  | ||||
| EX color_t monochromatize(color_t x) { | ||||
|   int c = part(x,2) + part(x,1) + part(x, 3); | ||||
|   c ++; | ||||
|   c /= 3; | ||||
|   return c * 0x1010100 | (part(x, 0)); | ||||
|   } | ||||
|  | ||||
| EX dqi_poly& queuepolyat(const transmatrix& V, const hpcshape& h, color_t col, PPR prio) { | ||||
|   if(prio == PPR::DEFAULT) prio = h.prio; | ||||
|  | ||||
| @@ -2072,6 +2091,19 @@ EX dqi_poly& queuepolyat(const transmatrix& V, const hpcshape& h, color_t col, P | ||||
|       if(col == 0xFF) ptd.outline = 0xFFFFFFFF; | ||||
|       if(poly_outline != 0xFF) ptd.outline = poly_outline; | ||||
|       break; | ||||
|     case 4: { | ||||
|       if(poly_outline > 0xFF) { | ||||
|         ptd.color = magentize(col); | ||||
|         ptd.outline = 0xFF; | ||||
|         } | ||||
|       else { | ||||
|         ptd.outline = poly_outline; | ||||
|         ptd.color = monochromatize(col); | ||||
|         } | ||||
|       if(ptd.color & 0xFF) ptd.color |= 0xFF; | ||||
|       if(ptd.outline & 0xFF) ptd.outline |= 0xFF; | ||||
|       break; | ||||
|       } | ||||
|     } | ||||
|   ptd.linewidth = vid.linewidth; | ||||
|   ptd.flags = h.flags; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue