mirror of
				https://github.com/zenorogue/hyperrogue.git
				synced 2025-10-31 14:02:59 +00:00 
			
		
		
		
	flip_dark
This commit is contained in:
		| @@ -252,7 +252,7 @@ void celldrawer::setcolors() { | |||||||
|       break;     |       break;     | ||||||
|     case laMountain: |     case laMountain: | ||||||
|       if(eubinary || sphere || c->master->alt) |       if(eubinary || sphere || c->master->alt) | ||||||
|         fcol = celldistAlt(c) & 1 ? 0x604020 : 0x302010; |         fcol = 0x181008 * flip_dark(celldistAlt(c), 2, 4); | ||||||
|       else fcol = 0; |       else fcol = 0; | ||||||
|       if(c->wall == waPlatform) wcol = 0xF0F0A0; |       if(c->wall == waPlatform) wcol = 0xF0F0A0; | ||||||
|       break; |       break; | ||||||
| @@ -321,11 +321,11 @@ void celldrawer::setcolors() { | |||||||
|       break; |       break; | ||||||
|    |    | ||||||
|     case laIvoryTower: |     case laIvoryTower: | ||||||
|       fcol = 0x10101 * (32 + (c->landparam&1) * 32) - 0x000010; |       fcol = 0x10101 * flip_dark(c->landparam, 32, 64) - 0x000010; | ||||||
|       break; |       break; | ||||||
|      |      | ||||||
|     case laWestWall: |     case laWestWall: | ||||||
|       fcol = 0x10101 * ((c->landparam&1) * 32) + floorcolors[c->land]; |       fcol = 0x10101 * flip_dark(c->landparam, 0, 32) + floorcolors[c->land]; | ||||||
|       break; |       break; | ||||||
|      |      | ||||||
|     case laDungeon: { |     case laDungeon: { | ||||||
| @@ -345,7 +345,7 @@ void celldrawer::setcolors() { | |||||||
|     case laEndorian: { |     case laEndorian: { | ||||||
|       int clev = pd_from->land == laEndorian ? edgeDepth(pd_from) : 0; |       int clev = pd_from->land == laEndorian ? edgeDepth(pd_from) : 0; | ||||||
|         // xcol = (c->landparam&1) ? 0xD00000 : 0x00D000; |         // xcol = (c->landparam&1) ? 0xD00000 : 0x00D000; | ||||||
|       fcol = 0x10101 * (32 + (c->landparam&1) * 32) - 0x000010; |       fcol = 0x10101 * flip_dark(c->landparam, 32, 64) - 0x000010; | ||||||
|       int ed = edgeDepth(c); |       int ed = edgeDepth(c); | ||||||
|       int sr = get_sightrange_ambush(); |       int sr = get_sightrange_ambush(); | ||||||
|        |        | ||||||
| @@ -360,7 +360,8 @@ void celldrawer::setcolors() { | |||||||
|    |    | ||||||
|       if(c->wall == waCanopy || c->wall == waSolidBranch || c->wall == waWeakBranch) { |       if(c->wall == waCanopy || c->wall == waSolidBranch || c->wall == waWeakBranch) { | ||||||
|         fcol = winf[waCanopy].color; |         fcol = winf[waCanopy].color; | ||||||
|         if(c->landparam & 1) fcol = gradient(0, fcol, 0, .75, 1); |         int f = flip_dark(c->landparam, 0, 2); | ||||||
|  |         if(f) fcol = gradient(0, fcol, 8, f, 0); | ||||||
|         } |         } | ||||||
|       break; |       break; | ||||||
|       } |       } | ||||||
| @@ -368,7 +369,7 @@ void celldrawer::setcolors() { | |||||||
|     #if CAP_FIELD |     #if CAP_FIELD | ||||||
|     case laPrairie: |     case laPrairie: | ||||||
|       if(prairie::isriver(c)) { |       if(prairie::isriver(c)) { | ||||||
|         fcol = ((c->LHU.fi.rval & 1) ? 0x402000: 0x503000); |         fcol = flip_dark(c->LHU.fi.rval, 0x402000, 0x503000); | ||||||
|         } |         } | ||||||
|       else { |       else { | ||||||
|         fcol = 0x004000 + 0x001000 * c->LHU.fi.walldist; |         fcol = 0x004000 + 0x001000 * c->LHU.fi.walldist; | ||||||
| @@ -383,7 +384,7 @@ void celldrawer::setcolors() { | |||||||
|   #if CAP_TOUR |   #if CAP_TOUR | ||||||
|       if(!tour::on) camelotcheat = false; |       if(!tour::on) camelotcheat = false; | ||||||
|       if(camelotcheat)  |       if(camelotcheat)  | ||||||
|           fcol = (d&1) ? 0xC0C0C0 : 0x606060; |           fcol = 0x10101 * flip_dark(d, 0x60, 0xC0); | ||||||
|       else  |       else  | ||||||
|   #endif |   #endif | ||||||
|       if(d < 0) { |       if(d < 0) { | ||||||
|   | |||||||
							
								
								
									
										11
									
								
								graph.cpp
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								graph.cpp
									
									
									
									
									
								
							| @@ -158,6 +158,17 @@ EX int weakfirecolor(int phase) { | |||||||
|   return gradient(0xFF8000, 0xFF0000, -1, sintick(500, phase/1000./M_PI), 1); |   return gradient(0xFF8000, 0xFF0000, -1, sintick(500, phase/1000./M_PI), 1); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  | /** @brief used to alternate colors depending on distance to something. In chessboard-patterned geometries, also use a third step */ | ||||||
|  |  | ||||||
|  | EX int flip_dark(int f, int a0, int a1) { | ||||||
|  |   if(geosupport_chessboard()) { | ||||||
|  |     f = gmod(f, 3); | ||||||
|  |     return a0 + (a1-a0) * f / 2; | ||||||
|  |     } | ||||||
|  |   else | ||||||
|  |     return (f&1) ? a1 : a0; | ||||||
|  |   } | ||||||
|  |  | ||||||
| color_t fc(int ph, color_t col, int z) { | color_t fc(int ph, color_t col, int z) { | ||||||
|   if(items[itOrbFire]) col = darkena(firecolor(ph), 0, 0xFF); |   if(items[itOrbFire]) col = darkena(firecolor(ph), 0, 0xFF); | ||||||
|   if(items[itOrbAether]) col = (col &~0XFF) | (col&0xFF) / 2; |   if(items[itOrbAether]) col = (col &~0XFF) | (col&0xFF) / 2; | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Zeno Rogue
					Zeno Rogue