Merge lp:~ab-tools/widelands/minimap into lp:widelands

Proposed by Andreas Breitschopp
Status: Merged
Merged at revision: 5584
Proposed branch: lp:~ab-tools/widelands/minimap
Merge into: lp:widelands
Diff against target: 82 lines (+13/-7)
2 files modified
ChangeLog (+1/-0)
src/graphic/render/gameview.cc (+12/-7)
To merge this branch: bzr merge lp:~ab-tools/widelands/minimap
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+38618@code.launchpad.net

Description of the change

I've did a small improvement regarding the frame border again:
before that the frame border was always one pixel different when clicking arround (due to the mod 2 calculation), this is fixed now. Nothing important, but it just looks better now. ;-)

Additionally I've added a note in the change log. Because it's a visible change for a user, I think it's worth to be mentioned.

Please merge that again into trunk.

To post a comment you must log in.
Revision history for this message
SirVer (sirver) wrote :

merged. Thanks Andreas!

Revision history for this message
Andreas Breitschopp (ab-tools) wrote :

Great, thanks for fast merging, Holger!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2010-10-04 09:10:35 +0000
3+++ ChangeLog 2010-10-16 10:22:47 +0000
4@@ -2,6 +2,7 @@
5 - Changed the way compressed files are generated (maps, savegames) and read.
6 Now it is possible to rename maps and savegames but it is not possible
7 to load maps from version after this change with versions before this change
8+- Added a dotted frame border to the mini map.
9 - Improved and added a lot new animations for workers!
10 - Implemented teamview for allied players
11 - Implemented shared kingdom mode, where two or more players play the same
12
13=== modified file 'src/graphic/render/gameview.cc'
14--- src/graphic/render/gameview.cc 2010-10-09 13:43:47 +0000
15+++ src/graphic/render/gameview.cc 2010-10-16 10:22:47 +0000
16@@ -1096,31 +1096,33 @@
17 Point const ptopleft,
18 Point const pbottomright,
19 uint32_t const mapwidth,
20- uint32_t const mapheight)
21+ uint32_t const mapheight,
22+ uint32_t const modx,
23+ uint32_t const mody)
24 {
25 bool isframepixel = false;
26
27 if (ptopleft.x <= pbottomright.x) {
28 if (f.x >= ptopleft.x && f.x <= pbottomright.x
29 && (f.y == ptopleft.y || f.y == pbottomright.y)
30- && f.x % 2 == 0)
31+ && f.x % 2 == modx)
32 isframepixel = true;
33 } else {
34 if ((f.x >= ptopleft.x && f.x <= mapwidth || f.x >= 0 && f.x <= pbottomright.x)
35 && (f.y == ptopleft.y || f.y == pbottomright.y)
36- && f.x % 2 == 0)
37+ && f.x % 2 == modx)
38 isframepixel = true;
39 }
40
41 if (ptopleft.y <= pbottomright.y) {
42 if (f.y >= ptopleft.y && f.y <= pbottomright.y
43 && (f.x == ptopleft.x || f.x == pbottomright.x)
44- && f.y % 2 == 0)
45+ && f.y % 2 == mody)
46 isframepixel = true;
47 } else {
48 if ((f.y >= ptopleft.y && f.y <= mapheight || f.y >= 0 && f.y <= pbottomright.y)
49 && (f.x == ptopleft.x || f.x == pbottomright.x)
50- && f.y % 2 == 0)
51+ && f.y % 2 == mody)
52 isframepixel = true;
53 }
54
55@@ -1164,6 +1166,9 @@
56 pbottomright.y = viewpoint.y + mapheight / 2 + ysize;
57 if (pbottomright.y >= mapheight) pbottomright.y -= mapheight;
58
59+ uint32_t modx = pbottomright.x % 2;
60+ uint32_t mody = pbottomright.y % 2;
61+
62 if (not player or player->see_all()) for (uint32_t y = 0; y < rc.h; ++y) {
63 Uint8 * pix = pixels + (rc.y + y) * pitch + rc.x * sizeof(T);
64 Widelands::FCoords f
65@@ -1177,7 +1182,7 @@
66 move_r(mapwidth, f, i);
67
68 if (draw_minimap_frameborder<T>
69- (f, ptopleft, pbottomright, mapwidth, mapheight)) {
70+ (f, ptopleft, pbottomright, mapwidth, mapheight, modx, mody)) {
71 *reinterpret_cast<T *>(pix) = static_cast<T>
72 (SDL_MapRGB(&const_cast<SDL_PixelFormat &>(format), 255, 0, 0));
73 } else {
74@@ -1201,7 +1206,7 @@
75 move_r(mapwidth, f, i);
76
77 if (draw_minimap_frameborder<T>
78- (f, ptopleft, pbottomright, mapwidth, mapheight)) {
79+ (f, ptopleft, pbottomright, mapwidth, mapheight, modx, mody)) {
80 *reinterpret_cast<T *>(pix) = static_cast<T>
81 (SDL_MapRGB(&const_cast<SDL_PixelFormat &>(format), 255, 0, 0));
82 } else {

Subscribers

People subscribed via source and target branches

to status/vote changes: