← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~alocritani/widelands/minimap_colors into lp:widelands

 

Angelo Locritani has proposed merging lp:~alocritani/widelands/minimap_colors into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #927110 in widelands: "font color not adapted to map color"
  https://bugs.launchpad.net/widelands/+bug/927110

For more details, see:
https://code.launchpad.net/~alocritani/widelands/minimap_colors/+merge/93682

change the color of points indicating buildings, flags and roads in winterland maps.
New color (orange) is used only when the ownership layer is off. That's because ownership layer creates enough contrast when it's on, but if this layer is off, it's really difficult to distinguish white points over the winterland terrains.
screenshot on https://bugs.launchpad.net/widelands/+bug/927110/+attachment/2737680/+files/minimap.png
-- 
https://code.launchpad.net/~alocritani/widelands/minimap_colors/+merge/93682
Your team Widelands Developers is requested to review the proposed merge of lp:~alocritani/widelands/minimap_colors into lp:widelands.
=== modified file 'src/graphic/render/gameview.cc'
--- src/graphic/render/gameview.cc	2011-11-30 21:38:37 +0000
+++ src/graphic/render/gameview.cc	2012-02-18 08:56:20 +0000
@@ -1112,18 +1112,36 @@
 	}
 
 	if (see_details)
+		// if ownership layer is displayed, it creates enoungh contrast
+		// to visualize objects using white color.
+		// Otherwise, a more contrasting color may be needed:
+		// * winterland -> orange
+
 		if (upcast(PlayerImmovable const, immovable, f.field->get_immovable())) {
 			if (flags & MiniMap::Roads and dynamic_cast<Road const *>(immovable))
-				pixelcolor = blend_color(format, pixelcolor, 255, 255, 255);
+			{
+				if (!(flags & MiniMap::Owner) && !strcmp(egbase.map().get_world_name(), "winterland"))
+						pixelcolor = blend_color(format, pixelcolor, 255, 127, 0);
+				else //ownership layer displayed or greenland
+						pixelcolor = blend_color(format, pixelcolor, 255, 255, 255);
+			}
+
 			if
 				((flags & MiniMap::Flags and dynamic_cast<Flag const *>(immovable))
 				 or
 				 (flags & MiniMap::Bldns
 				  and
 				  dynamic_cast<Widelands::Building const *>(immovable)))
-				pixelcolor =
-					SDL_MapRGB
-						(&const_cast<SDL_PixelFormat &>(format), 255, 255, 255);
+			{
+				if (!(flags & MiniMap::Owner) && !strcmp(egbase.map().get_world_name(), "winterland"))
+					pixelcolor =
+						SDL_MapRGB
+							(&const_cast<SDL_PixelFormat &>(format), 255, 127, 0);
+				else //ownership layer displayed or greenland
+					pixelcolor =
+						SDL_MapRGB
+							(&const_cast<SDL_PixelFormat &>(format), 255, 255, 255);
+			}
 		}
 
 	return pixelcolor;


Follow ups