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

Proposed by Angelo Locritani
Status: Merged
Merged at revision: 6230
Proposed branch: lp:~alocritani/widelands/minimap_colors
Merge into: lp:widelands
Diff against target: 44 lines (+22/-4)
1 file modified
src/graphic/render/gameview.cc (+22/-4)
To merge this branch: bzr merge lp:~alocritani/widelands/minimap_colors
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+93682@code.launchpad.net

Description of the change

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

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/graphic/render/gameview.cc'
2--- src/graphic/render/gameview.cc 2011-11-30 21:38:37 +0000
3+++ src/graphic/render/gameview.cc 2012-02-18 08:56:20 +0000
4@@ -1112,18 +1112,36 @@
5 }
6
7 if (see_details)
8+ // if ownership layer is displayed, it creates enoungh contrast
9+ // to visualize objects using white color.
10+ // Otherwise, a more contrasting color may be needed:
11+ // * winterland -> orange
12+
13 if (upcast(PlayerImmovable const, immovable, f.field->get_immovable())) {
14 if (flags & MiniMap::Roads and dynamic_cast<Road const *>(immovable))
15- pixelcolor = blend_color(format, pixelcolor, 255, 255, 255);
16+ {
17+ if (!(flags & MiniMap::Owner) && !strcmp(egbase.map().get_world_name(), "winterland"))
18+ pixelcolor = blend_color(format, pixelcolor, 255, 127, 0);
19+ else //ownership layer displayed or greenland
20+ pixelcolor = blend_color(format, pixelcolor, 255, 255, 255);
21+ }
22+
23 if
24 ((flags & MiniMap::Flags and dynamic_cast<Flag const *>(immovable))
25 or
26 (flags & MiniMap::Bldns
27 and
28 dynamic_cast<Widelands::Building const *>(immovable)))
29- pixelcolor =
30- SDL_MapRGB
31- (&const_cast<SDL_PixelFormat &>(format), 255, 255, 255);
32+ {
33+ if (!(flags & MiniMap::Owner) && !strcmp(egbase.map().get_world_name(), "winterland"))
34+ pixelcolor =
35+ SDL_MapRGB
36+ (&const_cast<SDL_PixelFormat &>(format), 255, 127, 0);
37+ else //ownership layer displayed or greenland
38+ pixelcolor =
39+ SDL_MapRGB
40+ (&const_cast<SDL_PixelFormat &>(format), 255, 255, 255);
41+ }
42 }
43
44 return pixelcolor;

Subscribers

People subscribed via source and target branches

to status/vote changes: