Merge lp:~widelands-dev/widelands/cleanup-rendertarget into lp:widelands
- cleanup-rendertarget
- Merge into trunk
Proposed by
GunChleoc
Status: | Merged |
---|---|
Merged at revision: | 9066 |
Proposed branch: | lp:~widelands-dev/widelands/cleanup-rendertarget |
Merge into: | lp:widelands |
Diff against target: |
313 lines (+34/-82) 12 files modified
src/graphic/game_renderer.cc (+2/-2) src/graphic/rendertarget.cc (+5/-32) src/graphic/rendertarget.h (+6/-20) src/logic/map_objects/bob.cc (+2/-6) src/logic/map_objects/immovable.cc (+2/-2) src/logic/map_objects/tribes/building.cc (+1/-1) src/logic/map_objects/tribes/constructionsite.cc (+4/-4) src/logic/map_objects/tribes/dismantlesite.cc (+2/-2) src/logic/map_objects/tribes/worker.cc (+2/-2) src/wui/interactive_player.cc (+5/-8) src/wui/itemwaresdisplay.cc (+1/-1) src/wui/transport_draw.cc (+2/-2) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands/cleanup-rendertarget |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Widelands Developers | Pending | ||
Review via email: mp+365000@code.launchpad.net |
Commit message
Get rid of code duplication in rendertarget.h
Description of the change
This is for Build 21.
Some housekeeping where I squashed 4 functions that do the same into 1.
Prerequisite for https:/
To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote : | # |
Revision history for this message
GunChleoc (gunchleoc) wrote : | # |
This has been tested with the sound handler branch.
@bunnybot merge
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'src/graphic/game_renderer.cc' | |||
2 | --- src/graphic/game_renderer.cc 2019-02-23 11:00:49 +0000 | |||
3 | +++ src/graphic/game_renderer.cc 2019-03-23 13:48:46 +0000 | |||
4 | @@ -44,14 +44,14 @@ | |||
5 | 44 | uint32_t const anim_idx = field.owner->tribe().frontier_animation(); | 44 | uint32_t const anim_idx = field.owner->tribe().frontier_animation(); |
6 | 45 | if (field.vision) { | 45 | if (field.vision) { |
7 | 46 | dst->blit_animation( | 46 | dst->blit_animation( |
9 | 47 | field.rendertarget_pixel, scale, anim_idx, 0, field.owner->get_playercolor()); | 47 | field.rendertarget_pixel, scale, anim_idx, 0, &field.owner->get_playercolor()); |
10 | 48 | } | 48 | } |
11 | 49 | for (const auto& nf : {fields_to_draw.at(field.rn_index), fields_to_draw.at(field.bln_index), | 49 | for (const auto& nf : {fields_to_draw.at(field.rn_index), fields_to_draw.at(field.bln_index), |
12 | 50 | fields_to_draw.at(field.brn_index)}) { | 50 | fields_to_draw.at(field.brn_index)}) { |
13 | 51 | if ((field.vision || nf.vision) && nf.is_border && | 51 | if ((field.vision || nf.vision) && nf.is_border && |
14 | 52 | (field.owner == nf.owner || nf.owner == nullptr)) { | 52 | (field.owner == nf.owner || nf.owner == nullptr)) { |
15 | 53 | dst->blit_animation(middle(field.rendertarget_pixel, nf.rendertarget_pixel), scale, | 53 | dst->blit_animation(middle(field.rendertarget_pixel, nf.rendertarget_pixel), scale, |
17 | 54 | anim_idx, 0, field.owner->get_playercolor()); | 54 | anim_idx, 0, &field.owner->get_playercolor()); |
18 | 55 | } | 55 | } |
19 | 56 | } | 56 | } |
20 | 57 | } | 57 | } |
21 | 58 | 58 | ||
22 | === modified file 'src/graphic/rendertarget.cc' | |||
23 | --- src/graphic/rendertarget.cc 2019-02-23 11:00:49 +0000 | |||
24 | +++ src/graphic/rendertarget.cc 2019-03-23 13:48:46 +0000 | |||
25 | @@ -286,42 +286,15 @@ | |||
26 | 286 | } | 286 | } |
27 | 287 | 287 | ||
28 | 288 | void RenderTarget::blit_animation(const Vector2f& dst, | 288 | void RenderTarget::blit_animation(const Vector2f& dst, |
29 | 289 | const float scale, | ||
30 | 290 | uint32_t animation, | ||
31 | 291 | uint32_t time) { | ||
32 | 292 | // TODO(unknown): Correctly calculate the stereo position for sound effects | ||
33 | 293 | // TODO(unknown): The chosen semantics of animation sound effects is problematic: | ||
34 | 294 | // What if the game runs very slowly or very quickly? | ||
35 | 295 | const Animation& anim = g_gr->animations().get_animation(animation); | ||
36 | 296 | do_blit_animation(dst, scale, anim, time, nullptr); | ||
37 | 297 | } | ||
38 | 298 | |||
39 | 299 | void RenderTarget::blit_animation(const Vector2f& dst, | ||
40 | 300 | const float scale, | ||
41 | 301 | uint32_t animation, | ||
42 | 302 | uint32_t time, | ||
43 | 303 | const RGBColor& player_color) { | ||
44 | 304 | const Animation& anim = g_gr->animations().get_animation(animation); | ||
45 | 305 | do_blit_animation(dst, scale, anim, time, &player_color); | ||
46 | 306 | } | ||
47 | 307 | |||
48 | 308 | void RenderTarget::blit_animation(const Vector2f& dst, | ||
49 | 309 | const float scale, | ||
50 | 310 | uint32_t animation, | ||
51 | 311 | uint32_t time, | ||
52 | 312 | const RGBColor& player_color, | ||
53 | 313 | const int percent_from_bottom) { | ||
54 | 314 | do_blit_animation(dst, scale, g_gr->animations().get_animation(animation), time, &player_color, | ||
55 | 315 | percent_from_bottom); | ||
56 | 316 | } | ||
57 | 317 | |||
58 | 318 | void RenderTarget::do_blit_animation(const Vector2f& dst, | ||
59 | 319 | const float scale, | 289 | const float scale, |
61 | 320 | const Animation& animation, | 290 | uint32_t animation_id, |
62 | 321 | uint32_t time, | 291 | uint32_t time, |
63 | 322 | const RGBColor* player_color, | 292 | const RGBColor* player_color, |
64 | 323 | const int percent_from_bottom) { | 293 | const int percent_from_bottom) { |
66 | 324 | 294 | const Animation& animation = g_gr->animations().get_animation(animation_id); | |
67 | 295 | // TODO(unknown): Correctly calculate the stereo position for sound effects | ||
68 | 296 | // TODO(unknown): The chosen semantics of animation sound effects is problematic: | ||
69 | 297 | // What if the game runs very slowly or very quickly? | ||
70 | 325 | assert(percent_from_bottom <= 100); | 298 | assert(percent_from_bottom <= 100); |
71 | 326 | if (percent_from_bottom > 0) { | 299 | if (percent_from_bottom > 0) { |
72 | 327 | // Scaling for zoom and animation image size, then fit screen edges. | 300 | // Scaling for zoom and animation image size, then fit screen edges. |
73 | 328 | 301 | ||
74 | === modified file 'src/graphic/rendertarget.h' | |||
75 | --- src/graphic/rendertarget.h 2019-02-23 11:00:49 +0000 | |||
76 | +++ src/graphic/rendertarget.h 2019-03-23 13:48:46 +0000 | |||
77 | @@ -105,18 +105,12 @@ | |||
78 | 105 | // Draw the 'animation' as it should appear at 'time' in this target at | 105 | // Draw the 'animation' as it should appear at 'time' in this target at |
79 | 106 | // 'dst'. Optionally, the animation is tinted with 'player_color' and | 106 | // 'dst'. Optionally, the animation is tinted with 'player_color' and |
80 | 107 | // cropped to 'source_rect'. | 107 | // cropped to 'source_rect'. |
93 | 108 | void blit_animation(const Vector2f& dst, float scale, uint32_t animation, uint32_t time); | 108 | void blit_animation(const Vector2f& dst, |
94 | 109 | void blit_animation(const Vector2f& dst, | 109 | const float scale, |
95 | 110 | float scale, | 110 | uint32_t animation_id, |
96 | 111 | uint32_t animation, | 111 | uint32_t time, |
97 | 112 | uint32_t time, | 112 | const RGBColor* player_color = nullptr, |
98 | 113 | const RGBColor& player_color); | 113 | const int percent_from_bottom = 100); |
87 | 114 | void blit_animation(const Vector2f& dst, | ||
88 | 115 | float scale, | ||
89 | 116 | uint32_t animation, | ||
90 | 117 | uint32_t time, | ||
91 | 118 | const RGBColor& player_color, | ||
92 | 119 | const int percent_from_bottom); | ||
99 | 120 | 114 | ||
100 | 121 | void reset(); | 115 | void reset(); |
101 | 122 | 116 | ||
102 | @@ -134,14 +128,6 @@ | |||
103 | 134 | bool clip(Rectf& r) const; | 128 | bool clip(Rectf& r) const; |
104 | 135 | bool to_surface_geometry(Rectf* destination_rect, Rectf* source_rect) const; | 129 | bool to_surface_geometry(Rectf* destination_rect, Rectf* source_rect) const; |
105 | 136 | 130 | ||
106 | 137 | // Does the actual blitting. | ||
107 | 138 | void do_blit_animation(const Vector2f& dst, | ||
108 | 139 | const float scale, | ||
109 | 140 | const Animation& animation, | ||
110 | 141 | uint32_t time, | ||
111 | 142 | const RGBColor* player_color, | ||
112 | 143 | const int percent_from_bottom = 100); | ||
113 | 144 | |||
114 | 145 | /// The target surface | 131 | /// The target surface |
115 | 146 | Surface* const surface_; | 132 | Surface* const surface_; |
116 | 147 | /// The current clip rectangle | 133 | /// The current clip rectangle |
117 | 148 | 134 | ||
118 | === modified file 'src/logic/map_objects/bob.cc' | |||
119 | --- src/logic/map_objects/bob.cc 2019-02-27 17:19:00 +0000 | |||
120 | +++ src/logic/map_objects/bob.cc 2019-03-23 13:48:46 +0000 | |||
121 | @@ -767,12 +767,8 @@ | |||
122 | 767 | 767 | ||
123 | 768 | auto* const bob_owner = get_owner(); | 768 | auto* const bob_owner = get_owner(); |
124 | 769 | const Vector2f point_on_dst = calc_drawpos(egbase, field_on_dst, scale); | 769 | const Vector2f point_on_dst = calc_drawpos(egbase, field_on_dst, scale); |
131 | 770 | if (bob_owner != nullptr) { | 770 | dst->blit_animation(point_on_dst, scale, anim_, egbase.get_gametime() - animstart_, |
132 | 771 | dst->blit_animation(point_on_dst, scale, anim_, egbase.get_gametime() - animstart_, | 771 | (bob_owner == nullptr) ? nullptr : &bob_owner->get_playercolor()); |
127 | 772 | bob_owner->get_playercolor()); | ||
128 | 773 | } else { | ||
129 | 774 | dst->blit_animation(point_on_dst, scale, anim_, egbase.get_gametime() - animstart_); | ||
130 | 775 | } | ||
133 | 776 | } | 772 | } |
134 | 777 | 773 | ||
135 | 778 | /** | 774 | /** |
136 | 779 | 775 | ||
137 | === modified file 'src/logic/map_objects/immovable.cc' | |||
138 | --- src/logic/map_objects/immovable.cc 2019-02-27 17:19:00 +0000 | |||
139 | +++ src/logic/map_objects/immovable.cc 2019-03-23 13:48:46 +0000 | |||
140 | @@ -504,13 +504,13 @@ | |||
141 | 504 | if (current_frame > 0) { | 504 | if (current_frame > 0) { |
142 | 505 | // Not the first pic, so draw the previous one in the back | 505 | // Not the first pic, so draw the previous one in the back |
143 | 506 | dst->blit_animation( | 506 | dst->blit_animation( |
145 | 507 | point_on_dst, scale, anim_, (current_frame - 1) * frametime, player_color); | 507 | point_on_dst, scale, anim_, (current_frame - 1) * frametime, &player_color); |
146 | 508 | } | 508 | } |
147 | 509 | 509 | ||
148 | 510 | const int percent = ((done % units_per_frame) * 100) / units_per_frame; | 510 | const int percent = ((done % units_per_frame) * 100) / units_per_frame; |
149 | 511 | 511 | ||
150 | 512 | dst->blit_animation( | 512 | dst->blit_animation( |
152 | 513 | point_on_dst, scale, anim_, current_frame * frametime, player_color, percent); | 513 | point_on_dst, scale, anim_, current_frame * frametime, &player_color, percent); |
153 | 514 | 514 | ||
154 | 515 | // Additionally, if statistics are enabled, draw a progression string | 515 | // Additionally, if statistics are enabled, draw a progression string |
155 | 516 | do_draw_info(draw_text, descr().descname(), | 516 | do_draw_info(draw_text, descr().descname(), |
156 | 517 | 517 | ||
157 | === modified file 'src/logic/map_objects/tribes/building.cc' | |||
158 | --- src/logic/map_objects/tribes/building.cc 2019-02-28 12:22:36 +0000 | |||
159 | +++ src/logic/map_objects/tribes/building.cc 2019-03-23 13:48:46 +0000 | |||
160 | @@ -611,7 +611,7 @@ | |||
161 | 611 | const float scale, | 611 | const float scale, |
162 | 612 | RenderTarget* dst) { | 612 | RenderTarget* dst) { |
163 | 613 | dst->blit_animation( | 613 | dst->blit_animation( |
165 | 614 | point_on_dst, scale, anim_, gametime - animstart_, get_owner()->get_playercolor()); | 614 | point_on_dst, scale, anim_, gametime - animstart_, &get_owner()->get_playercolor()); |
166 | 615 | 615 | ||
167 | 616 | // door animation? | 616 | // door animation? |
168 | 617 | 617 | ||
169 | 618 | 618 | ||
170 | === modified file 'src/logic/map_objects/tribes/constructionsite.cc' | |||
171 | --- src/logic/map_objects/tribes/constructionsite.cc 2019-02-27 17:19:00 +0000 | |||
172 | +++ src/logic/map_objects/tribes/constructionsite.cc 2019-03-23 13:48:46 +0000 | |||
173 | @@ -55,12 +55,12 @@ | |||
174 | 55 | 55 | ||
175 | 56 | if (cur_frame) { // not the first pic | 56 | if (cur_frame) { // not the first pic |
176 | 57 | // Draw the complete prev pic , so we won't run into trouble if images have different sizes | 57 | // Draw the complete prev pic , so we won't run into trouble if images have different sizes |
178 | 58 | dst->blit_animation(point_on_dst, scale, anim_idx, anim_time - FRAME_LENGTH, player_color); | 58 | dst->blit_animation(point_on_dst, scale, anim_idx, anim_time - FRAME_LENGTH, &player_color); |
179 | 59 | } else if (was) { | 59 | } else if (was) { |
180 | 60 | // Is the first picture but there was another building here before, | 60 | // Is the first picture but there was another building here before, |
181 | 61 | // get its most fitting picture and draw it instead. | 61 | // get its most fitting picture and draw it instead. |
182 | 62 | dst->blit_animation(point_on_dst, scale, was->get_unoccupied_animation(), | 62 | dst->blit_animation(point_on_dst, scale, was->get_unoccupied_animation(), |
184 | 63 | anim_time - FRAME_LENGTH, player_color); | 63 | anim_time - FRAME_LENGTH, &player_color); |
185 | 64 | } | 64 | } |
186 | 65 | // Now blit a segment of the current construction phase from the bottom. | 65 | // Now blit a segment of the current construction phase from the bottom. |
187 | 66 | int percent = 100 * completedtime * nr_frames; | 66 | int percent = 100 * completedtime * nr_frames; |
188 | @@ -68,7 +68,7 @@ | |||
189 | 68 | percent /= totaltime; | 68 | percent /= totaltime; |
190 | 69 | } | 69 | } |
191 | 70 | percent -= 100 * cur_frame; | 70 | percent -= 100 * cur_frame; |
193 | 71 | dst->blit_animation(point_on_dst, scale, anim_idx, anim_time, player_color, percent); | 71 | dst->blit_animation(point_on_dst, scale, anim_idx, anim_time, &player_color, percent); |
194 | 72 | } | 72 | } |
195 | 73 | 73 | ||
196 | 74 | /** | 74 | /** |
197 | @@ -344,7 +344,7 @@ | |||
198 | 344 | uint32_t tanim = gametime - animstart_; | 344 | uint32_t tanim = gametime - animstart_; |
199 | 345 | // Draw the construction site marker | 345 | // Draw the construction site marker |
200 | 346 | const RGBColor& player_color = get_owner()->get_playercolor(); | 346 | const RGBColor& player_color = get_owner()->get_playercolor(); |
202 | 347 | dst->blit_animation(point_on_dst, scale, anim_, tanim, player_color); | 347 | dst->blit_animation(point_on_dst, scale, anim_, tanim, &player_color); |
203 | 348 | 348 | ||
204 | 349 | // Draw the partially finished building | 349 | // Draw the partially finished building |
205 | 350 | 350 | ||
206 | 351 | 351 | ||
207 | === modified file 'src/logic/map_objects/tribes/dismantlesite.cc' | |||
208 | --- src/logic/map_objects/tribes/dismantlesite.cc 2019-02-27 17:19:00 +0000 | |||
209 | +++ src/logic/map_objects/tribes/dismantlesite.cc 2019-03-23 13:48:46 +0000 | |||
210 | @@ -225,11 +225,11 @@ | |||
211 | 225 | const RGBColor& player_color = get_owner()->get_playercolor(); | 225 | const RGBColor& player_color = get_owner()->get_playercolor(); |
212 | 226 | 226 | ||
213 | 227 | // Draw the construction site marker | 227 | // Draw the construction site marker |
215 | 228 | dst->blit_animation(point_on_dst, scale, anim_, tanim, player_color); | 228 | dst->blit_animation(point_on_dst, scale, anim_, tanim, &player_color); |
216 | 229 | 229 | ||
217 | 230 | // Blit bottom part of the animation according to dismantle progress | 230 | // Blit bottom part of the animation according to dismantle progress |
218 | 231 | dst->blit_animation(point_on_dst, scale, building_->get_unoccupied_animation(), tanim, | 231 | dst->blit_animation(point_on_dst, scale, building_->get_unoccupied_animation(), tanim, |
220 | 232 | player_color, 100 - ((get_built_per64k() * 100) >> 16)); | 232 | &player_color, 100 - ((get_built_per64k() * 100) >> 16)); |
221 | 233 | 233 | ||
222 | 234 | // Draw help strings | 234 | // Draw help strings |
223 | 235 | draw_info(draw_text, point_on_dst, scale, dst); | 235 | draw_info(draw_text, point_on_dst, scale, dst); |
224 | 236 | 236 | ||
225 | === modified file 'src/logic/map_objects/tribes/worker.cc' | |||
226 | --- src/logic/map_objects/tribes/worker.cc 2019-03-17 10:30:24 +0000 | |||
227 | +++ src/logic/map_objects/tribes/worker.cc 2019-03-23 13:48:46 +0000 | |||
228 | @@ -2991,14 +2991,14 @@ | |||
229 | 2991 | const RGBColor& player_color = get_owner()->get_playercolor(); | 2991 | const RGBColor& player_color = get_owner()->get_playercolor(); |
230 | 2992 | 2992 | ||
231 | 2993 | dst->blit_animation( | 2993 | dst->blit_animation( |
233 | 2994 | point_on_dst, scale, get_current_anim(), game.get_gametime() - get_animstart(), player_color); | 2994 | point_on_dst, scale, get_current_anim(), game.get_gametime() - get_animstart(), &player_color); |
234 | 2995 | 2995 | ||
235 | 2996 | if (WareInstance const* const carried_ware = get_carried_ware(game)) { | 2996 | if (WareInstance const* const carried_ware = get_carried_ware(game)) { |
236 | 2997 | const Vector2f hotspot = descr().ware_hotspot().cast<float>(); | 2997 | const Vector2f hotspot = descr().ware_hotspot().cast<float>(); |
237 | 2998 | const Vector2f location( | 2998 | const Vector2f location( |
238 | 2999 | point_on_dst.x - hotspot.x * scale, point_on_dst.y - hotspot.y * scale); | 2999 | point_on_dst.x - hotspot.x * scale, point_on_dst.y - hotspot.y * scale); |
239 | 3000 | dst->blit_animation( | 3000 | dst->blit_animation( |
241 | 3001 | location, scale, carried_ware->descr().get_animation("idle"), 0, player_color); | 3001 | location, scale, carried_ware->descr().get_animation("idle"), 0, &player_color); |
242 | 3002 | } | 3002 | } |
243 | 3003 | } | 3003 | } |
244 | 3004 | 3004 | ||
245 | 3005 | 3005 | ||
246 | === modified file 'src/wui/interactive_player.cc' | |||
247 | --- src/wui/interactive_player.cc 2019-03-01 04:29:12 +0000 | |||
248 | +++ src/wui/interactive_player.cc 2019-03-23 13:48:46 +0000 | |||
249 | @@ -130,6 +130,7 @@ | |||
250 | 130 | if (player_field.map_object_descr == nullptr) { | 130 | if (player_field.map_object_descr == nullptr) { |
251 | 131 | return; | 131 | return; |
252 | 132 | } | 132 | } |
253 | 133 | |||
254 | 133 | if (player_field.constructionsite.becomes) { | 134 | if (player_field.constructionsite.becomes) { |
255 | 134 | assert(field.owner != nullptr); | 135 | assert(field.owner != nullptr); |
256 | 135 | player_field.constructionsite.draw( | 136 | player_field.constructionsite.draw( |
257 | @@ -139,18 +140,14 @@ | |||
258 | 139 | assert(field.owner != nullptr); | 140 | assert(field.owner != nullptr); |
259 | 140 | // this is a building therefore we either draw unoccupied or idle animation | 141 | // this is a building therefore we either draw unoccupied or idle animation |
260 | 141 | dst->blit_animation(field.rendertarget_pixel, scale, building->get_unoccupied_animation(), 0, | 142 | dst->blit_animation(field.rendertarget_pixel, scale, building->get_unoccupied_animation(), 0, |
262 | 142 | field.owner->get_playercolor()); | 143 | &field.owner->get_playercolor()); |
263 | 143 | } else if (player_field.map_object_descr->type() == Widelands::MapObjectType::FLAG) { | 144 | } else if (player_field.map_object_descr->type() == Widelands::MapObjectType::FLAG) { |
264 | 144 | assert(field.owner != nullptr); | 145 | assert(field.owner != nullptr); |
265 | 145 | dst->blit_animation(field.rendertarget_pixel, scale, field.owner->tribe().flag_animation(), 0, | 146 | dst->blit_animation(field.rendertarget_pixel, scale, field.owner->tribe().flag_animation(), 0, |
267 | 146 | field.owner->get_playercolor()); | 147 | &field.owner->get_playercolor()); |
268 | 147 | } else if (const uint32_t pic = player_field.map_object_descr->main_animation()) { | 148 | } else if (const uint32_t pic = player_field.map_object_descr->main_animation()) { |
275 | 148 | if (field.owner != nullptr) { | 149 | dst->blit_animation( |
276 | 149 | dst->blit_animation( | 150 | field.rendertarget_pixel, scale, pic, 0, (field.owner == nullptr) ? nullptr : &field.owner->get_playercolor()); |
271 | 150 | field.rendertarget_pixel, scale, pic, 0, field.owner->get_playercolor()); | ||
272 | 151 | } else { | ||
273 | 152 | dst->blit_animation(field.rendertarget_pixel, scale, pic, 0); | ||
274 | 153 | } | ||
277 | 154 | } | 151 | } |
278 | 155 | } | 152 | } |
279 | 156 | 153 | ||
280 | 157 | 154 | ||
281 | === modified file 'src/wui/itemwaresdisplay.cc' | |||
282 | --- src/wui/itemwaresdisplay.cc 2019-02-23 11:00:49 +0000 | |||
283 | +++ src/wui/itemwaresdisplay.cc 2019-03-23 13:48:46 +0000 | |||
284 | @@ -121,7 +121,7 @@ | |||
285 | 121 | constexpr float kZoom = 1.f; | 121 | constexpr float kZoom = 1.f; |
286 | 122 | dst.blit_animation(Vector2f(x + (IWD_ItemWidth / 2.f), y + (IWD_ItemHeight / 2.f)), kZoom, | 122 | dst.blit_animation(Vector2f(x + (IWD_ItemWidth / 2.f), y + (IWD_ItemHeight / 2.f)), kZoom, |
287 | 123 | tribe.get_worker_descr(it.index)->main_animation(), 0, | 123 | tribe.get_worker_descr(it.index)->main_animation(), 0, |
289 | 124 | player().get_playercolor()); | 124 | &player().get_playercolor()); |
290 | 125 | } else { | 125 | } else { |
291 | 126 | y += IWD_WareBaseLine; | 126 | y += IWD_WareBaseLine; |
292 | 127 | if (tribe.get_ware_descr(it.index)->icon()) | 127 | if (tribe.get_ware_descr(it.index)->icon()) |
293 | 128 | 128 | ||
294 | === modified file 'src/wui/transport_draw.cc' | |||
295 | --- src/wui/transport_draw.cc 2019-02-27 17:19:00 +0000 | |||
296 | +++ src/wui/transport_draw.cc 2019-03-23 13:48:46 +0000 | |||
297 | @@ -38,7 +38,7 @@ | |||
298 | 38 | 38 | ||
299 | 39 | const RGBColor& player_color = owner().get_playercolor(); | 39 | const RGBColor& player_color = owner().get_playercolor(); |
300 | 40 | dst->blit_animation( | 40 | dst->blit_animation( |
302 | 41 | point_on_dst, scale, owner().tribe().flag_animation(), gametime - animstart_, player_color); | 41 | point_on_dst, scale, owner().tribe().flag_animation(), gametime - animstart_, &player_color); |
303 | 42 | 42 | ||
304 | 43 | for (int32_t i = 0; i < ware_filled_; ++i) { // draw wares | 43 | for (int32_t i = 0; i < ware_filled_; ++i) { // draw wares |
305 | 44 | Vector2f warepos = point_on_dst; | 44 | Vector2f warepos = point_on_dst; |
306 | @@ -49,7 +49,7 @@ | |||
307 | 49 | warepos.y -= (6.f + (i - 8.f) * 3.f) * scale; | 49 | warepos.y -= (6.f + (i - 8.f) * 3.f) * scale; |
308 | 50 | } | 50 | } |
309 | 51 | dst->blit_animation( | 51 | dst->blit_animation( |
311 | 52 | warepos, scale, wares_[i].ware->descr().get_animation("idle"), 0, player_color); | 52 | warepos, scale, wares_[i].ware->descr().get_animation("idle"), 0, &player_color); |
312 | 53 | } | 53 | } |
313 | 54 | } | 54 | } |
314 | 55 | 55 |
Continuous integration builds have changed state:
Travis build 4625. State: passed. Details: https:/ /travis- ci.org/ widelands/ widelands/ builds/ 510312741. /ci.appveyor. com/project/ widelands- dev/widelands/ build/_ widelands_ dev_widelands_ cleanup_ rendertarget- 4412.
Appveyor build 4412. State: failed. Details: https:/