Merge lp:~widelands-dev/widelands/fix_name_collision into lp:widelands

Proposed by Tino
Status: Merged
Merged at revision: 8154
Proposed branch: lp:~widelands-dev/widelands/fix_name_collision
Merge into: lp:widelands
Diff against target: 540 lines (+53/-53)
27 files modified
src/economy/flag.h (+1/-1)
src/economy/portdock.cc (+1/-1)
src/economy/portdock.h (+1/-1)
src/economy/road.h (+1/-1)
src/graphic/game_renderer.cc (+9/-9)
src/graphic/game_renderer.h (+3/-3)
src/logic/map_objects/bob.cc (+1/-1)
src/logic/map_objects/bob.h (+1/-1)
src/logic/map_objects/draw_text.h (+3/-3)
src/logic/map_objects/immovable.cc (+2/-2)
src/logic/map_objects/immovable.h (+3/-3)
src/logic/map_objects/map_object.cc (+4/-4)
src/logic/map_objects/map_object.h (+1/-1)
src/logic/map_objects/tribes/building.cc (+3/-3)
src/logic/map_objects/tribes/building.h (+2/-2)
src/logic/map_objects/tribes/constructionsite.cc (+1/-1)
src/logic/map_objects/tribes/constructionsite.h (+1/-1)
src/logic/map_objects/tribes/dismantlesite.cc (+1/-1)
src/logic/map_objects/tribes/dismantlesite.h (+1/-1)
src/logic/map_objects/tribes/ship.cc (+2/-2)
src/logic/map_objects/tribes/ship.h (+1/-1)
src/logic/map_objects/tribes/soldier.cc (+1/-1)
src/logic/map_objects/tribes/soldier.h (+1/-1)
src/logic/map_objects/tribes/worker.cc (+1/-1)
src/logic/map_objects/tribes/worker.h (+1/-1)
src/wui/mapview.cc (+4/-4)
src/wui/transport_draw.cc (+2/-2)
To merge this branch: bzr merge lp:~widelands-dev/widelands/fix_name_collision
Reviewer Review Type Date Requested Status
Tino Needs Resubmitting
Review via email: mp+309320@code.launchpad.net

Description of the change

It was not possible to compile current trunk on windows, because of a name collision with a MSDN function DrawText : https://msdn.microsoft.com/en-us/library/windows/desktop/dd162498(v=vs.85).aspx

I've renamed the function to WLDrawText, but perhaps there is also a better fix by using namespaces?

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

I think namespace Widelands would be appropriate here, since it's located in logic.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Or we could call it TextToDraw?

Revision history for this message
GunChleoc (gunchleoc) wrote :

Third idea: Move it into the MapObject class, because it's an instruction to them.

Revision history for this message
SirVer (sirver) wrote :

I am all for namespaces! Do not move it into the class, because that tightly couples the units (.h/.cc) files. If it is a separate struct, we can more nimbly move the struct around and have less dependencies.

Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 1499. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/170705571.
Appveyor build 1342. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_fix_name_collision-1342.

Revision history for this message
Tino (tino79) wrote :

Sorry, this is the best i can come up with.

Tried declaring the Widelands namespace in draw_text.h, but then always the enum was invalid (duplicate declaration).
Tried using "enum class DrawText"...

review: Needs Resubmitting
Revision history for this message
GunChleoc (gunchleoc) wrote :

Sounds like this was a *headdesk* excercise :(

@bunnybot merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/economy/flag.h'
--- src/economy/flag.h 2016-10-22 11:20:33 +0000
+++ src/economy/flag.h 2016-10-26 19:44:13 +0000
@@ -146,7 +146,7 @@
146 void cleanup(EditorGameBase&) override;146 void cleanup(EditorGameBase&) override;
147147
148 void draw(uint32_t gametime,148 void draw(uint32_t gametime,
149 DrawText draw_text,149 TextToDraw draw_text,
150 const Vector2f& point_on_dst,150 const Vector2f& point_on_dst,
151 float scale,151 float scale,
152 RenderTarget* dst) override;152 RenderTarget* dst) override;
153153
=== modified file 'src/economy/portdock.cc'
--- src/economy/portdock.cc 2016-10-24 14:04:00 +0000
+++ src/economy/portdock.cc 2016-10-26 19:44:13 +0000
@@ -141,7 +141,7 @@
141 expedition_bootstrap_->set_economy(e);141 expedition_bootstrap_->set_economy(e);
142}142}
143143
144void PortDock::draw(uint32_t, const DrawText, const Vector2f&, float, RenderTarget*) {144void PortDock::draw(uint32_t, const TextToDraw, const Vector2f&, float, RenderTarget*) {
145 // do nothing145 // do nothing
146}146}
147147
148148
=== modified file 'src/economy/portdock.h'
--- src/economy/portdock.h 2016-10-22 11:20:33 +0000
+++ src/economy/portdock.h 2016-10-26 19:44:13 +0000
@@ -97,7 +97,7 @@
97 Flag& base_flag() override;97 Flag& base_flag() override;
98 PositionList get_positions(const EditorGameBase&) const override;98 PositionList get_positions(const EditorGameBase&) const override;
99 void draw(uint32_t gametime,99 void draw(uint32_t gametime,
100 DrawText draw_text,100 TextToDraw draw_text,
101 const Vector2f& point_on_dst,101 const Vector2f& point_on_dst,
102 float scale,102 float scale,
103 RenderTarget* dst) override;103 RenderTarget* dst) override;
104104
=== modified file 'src/economy/road.h'
--- src/economy/road.h 2016-10-22 11:20:33 +0000
+++ src/economy/road.h 2016-10-26 19:44:13 +0000
@@ -119,7 +119,7 @@
119 void cleanup(EditorGameBase&) override;119 void cleanup(EditorGameBase&) override;
120120
121 void draw(uint32_t gametime,121 void draw(uint32_t gametime,
122 DrawText draw_text,122 TextToDraw draw_text,
123 const Vector2f& point_on_dst,123 const Vector2f& point_on_dst,
124 float scale,124 float scale,
125 RenderTarget* dst) override;125 RenderTarget* dst) override;
126126
=== modified file 'src/graphic/game_renderer.cc'
--- src/graphic/game_renderer.cc 2016-10-24 20:07:22 +0000
+++ src/graphic/game_renderer.cc 2016-10-26 19:44:13 +0000
@@ -100,29 +100,29 @@
100void draw_objects_for_visible_field(const EditorGameBase& egbase,100void draw_objects_for_visible_field(const EditorGameBase& egbase,
101 const FieldsToDraw::Field& field,101 const FieldsToDraw::Field& field,
102 const float zoom,102 const float zoom,
103 const DrawText draw_text,103 const TextToDraw draw_text,
104 const Player* player,104 const Player* player,
105 RenderTarget* dst) {105 RenderTarget* dst) {
106 BaseImmovable* const imm = field.fcoords.field->get_immovable();106 BaseImmovable* const imm = field.fcoords.field->get_immovable();
107 if (imm != nullptr && imm->get_positions(egbase).front() == field.fcoords) {107 if (imm != nullptr && imm->get_positions(egbase).front() == field.fcoords) {
108 DrawText draw_text_for_this_immovable = draw_text;108 TextToDraw draw_text_for_this_immovable = draw_text;
109 const Player* owner = imm->get_owner();109 const Player* owner = imm->get_owner();
110 if (player != nullptr && owner != nullptr && !player->see_all() &&110 if (player != nullptr && owner != nullptr && !player->see_all() &&
111 player->is_hostile(*owner)) {111 player->is_hostile(*owner)) {
112 draw_text_for_this_immovable =112 draw_text_for_this_immovable =
113 static_cast<DrawText>(draw_text_for_this_immovable & ~DrawText::kStatistics);113 static_cast<TextToDraw>(draw_text_for_this_immovable & ~TextToDraw::kStatistics);
114 }114 }
115115
116 imm->draw(116 imm->draw(
117 egbase.get_gametime(), draw_text_for_this_immovable, field.rendertarget_pixel, zoom, dst);117 egbase.get_gametime(), draw_text_for_this_immovable, field.rendertarget_pixel, zoom, dst);
118 }118 }
119 for (Bob* bob = field.fcoords.field->get_first_bob(); bob; bob = bob->get_next_bob()) {119 for (Bob* bob = field.fcoords.field->get_first_bob(); bob; bob = bob->get_next_bob()) {
120 DrawText draw_text_for_this_bob = draw_text;120 TextToDraw draw_text_for_this_bob = draw_text;
121 const Player* owner = bob->get_owner();121 const Player* owner = bob->get_owner();
122 if (player != nullptr && owner != nullptr && !player->see_all() &&122 if (player != nullptr && owner != nullptr && !player->see_all() &&
123 player->is_hostile(*owner)) {123 player->is_hostile(*owner)) {
124 draw_text_for_this_bob =124 draw_text_for_this_bob =
125 static_cast<DrawText>(draw_text_for_this_bob & ~DrawText::kStatistics);125 static_cast<TextToDraw>(draw_text_for_this_bob & ~TextToDraw::kStatistics);
126 }126 }
127 bob->draw(egbase, draw_text_for_this_bob, field.rendertarget_pixel, zoom, dst);127 bob->draw(egbase, draw_text_for_this_bob, field.rendertarget_pixel, zoom, dst);
128 }128 }
@@ -215,7 +215,7 @@
215 const float zoom,215 const float zoom,
216 const FieldsToDraw& fields_to_draw,216 const FieldsToDraw& fields_to_draw,
217 const Player* player,217 const Player* player,
218 const DrawText draw_text,218 const TextToDraw draw_text,
219 RenderTarget* dst) {219 RenderTarget* dst) {
220 std::vector<FieldOverlayManager::OverlayInfo> overlay_info;220 std::vector<FieldOverlayManager::OverlayInfo> overlay_info;
221 for (size_t current_index = 0; current_index < fields_to_draw.size(); ++current_index) {221 for (size_t current_index = 0; current_index < fields_to_draw.size(); ++current_index) {
@@ -319,7 +319,7 @@
319 const Vector2f& viewpoint,319 const Vector2f& viewpoint,
320 const float zoom,320 const float zoom,
321 const Widelands::Player& player,321 const Widelands::Player& player,
322 const DrawText draw_text,322 const TextToDraw draw_text,
323 RenderTarget* dst) {323 RenderTarget* dst) {
324 draw(egbase, viewpoint, zoom, draw_text, &player, dst);324 draw(egbase, viewpoint, zoom, draw_text, &player, dst);
325}325}
@@ -327,7 +327,7 @@
327void GameRenderer::rendermap(const Widelands::EditorGameBase& egbase,327void GameRenderer::rendermap(const Widelands::EditorGameBase& egbase,
328 const Vector2f& viewpoint,328 const Vector2f& viewpoint,
329 const float zoom,329 const float zoom,
330 const DrawText draw_text,330 const TextToDraw draw_text,
331 RenderTarget* dst) {331 RenderTarget* dst) {
332 draw(egbase, viewpoint, zoom, draw_text, nullptr, dst);332 draw(egbase, viewpoint, zoom, draw_text, nullptr, dst);
333}333}
@@ -335,7 +335,7 @@
335void GameRenderer::draw(const EditorGameBase& egbase,335void GameRenderer::draw(const EditorGameBase& egbase,
336 const Vector2f& viewpoint,336 const Vector2f& viewpoint,
337 const float zoom,337 const float zoom,
338 const DrawText draw_text,338 const TextToDraw draw_text,
339 const Player* player,339 const Player* player,
340 RenderTarget* dst) {340 RenderTarget* dst) {
341 assert(viewpoint.x >= 0); // divisions involving negative numbers are bad341 assert(viewpoint.x >= 0); // divisions involving negative numbers are bad
342342
=== modified file 'src/graphic/game_renderer.h'
--- src/graphic/game_renderer.h 2016-10-22 11:20:33 +0000
+++ src/graphic/game_renderer.h 2016-10-26 19:44:13 +0000
@@ -47,7 +47,7 @@
47 const Vector2f& viewpoint,47 const Vector2f& viewpoint,
48 float scale,48 float scale,
49 const Widelands::Player& player,49 const Widelands::Player& player,
50 DrawText draw_text,50 TextToDraw draw_text,
51 RenderTarget* dst);51 RenderTarget* dst);
5252
53 // Renders the map from an omniscient perspective. This is used53 // Renders the map from an omniscient perspective. This is used
@@ -55,7 +55,7 @@
55 void rendermap(const Widelands::EditorGameBase& egbase,55 void rendermap(const Widelands::EditorGameBase& egbase,
56 const Vector2f& viewpoint,56 const Vector2f& viewpoint,
57 float scale,57 float scale,
58 DrawText draw_text,58 TextToDraw draw_text,
59 RenderTarget* dst);59 RenderTarget* dst);
6060
61private:61private:
@@ -64,7 +64,7 @@
64 void draw(const Widelands::EditorGameBase& egbase,64 void draw(const Widelands::EditorGameBase& egbase,
65 const Vector2f& viewpoint,65 const Vector2f& viewpoint,
66 float scale,66 float scale,
67 DrawText draw_text,67 TextToDraw draw_text,
68 const Widelands::Player* player,68 const Widelands::Player* player,
69 RenderTarget* dst);69 RenderTarget* dst);
7070
7171
=== modified file 'src/logic/map_objects/bob.cc'
--- src/logic/map_objects/bob.cc 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/bob.cc 2016-10-26 19:44:13 +0000
@@ -756,7 +756,7 @@
756/// Note that the current node is actually the node that we are walking to, not756/// Note that the current node is actually the node that we are walking to, not
757/// the the one that we start from.757/// the the one that we start from.
758void Bob::draw(const EditorGameBase& egbase,758void Bob::draw(const EditorGameBase& egbase,
759 const DrawText&,759 const TextToDraw&,
760 const Vector2f& field_on_dst,760 const Vector2f& field_on_dst,
761 const float scale,761 const float scale,
762 RenderTarget* dst) const {762 RenderTarget* dst) const {
763763
=== modified file 'src/logic/map_objects/bob.h'
--- src/logic/map_objects/bob.h 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/bob.h 2016-10-26 19:44:13 +0000
@@ -264,7 +264,7 @@
264 // starting field) in pixel space of 'dst' (including scale). The 'scale' is264 // starting field) in pixel space of 'dst' (including scale). The 'scale' is
265 // required to draw the bob in the right size.265 // required to draw the bob in the right size.
266 virtual void draw(const EditorGameBase&,266 virtual void draw(const EditorGameBase&,
267 const DrawText& draw_text,267 const TextToDraw& draw_text,
268 const Vector2f& field_on_dst,268 const Vector2f& field_on_dst,
269 float scale,269 float scale,
270 RenderTarget* dst) const;270 RenderTarget* dst) const;
271271
=== modified file 'src/logic/map_objects/draw_text.h'
--- src/logic/map_objects/draw_text.h 2016-10-24 20:07:22 +0000
+++ src/logic/map_objects/draw_text.h 2016-10-26 19:44:13 +0000
@@ -20,14 +20,14 @@
20#ifndef WL_LOGIC_MAP_OBJECTS_DRAW_TEXT_H20#ifndef WL_LOGIC_MAP_OBJECTS_DRAW_TEXT_H
21#define WL_LOGIC_MAP_OBJECTS_DRAW_TEXT_H21#define WL_LOGIC_MAP_OBJECTS_DRAW_TEXT_H
2222
23enum DrawText {23enum TextToDraw {
24 kNone = 0,24 kNone = 0,
25 kCensus = 1,25 kCensus = 1,
26 kStatistics = 2,26 kStatistics = 2,
27};27};
2828
29inline DrawText operator|(DrawText a, DrawText b) {29inline TextToDraw operator|(TextToDraw a, TextToDraw b) {
30 return static_cast<DrawText>(static_cast<int>(a) | static_cast<int>(b));30 return static_cast<TextToDraw>(static_cast<int>(a) | static_cast<int>(b));
31}31}
3232
33#endif // end of include guard: WL_LOGIC_MAP_OBJECTS_DRAW_TEXT_H33#endif // end of include guard: WL_LOGIC_MAP_OBJECTS_DRAW_TEXT_H
3434
=== modified file 'src/logic/map_objects/immovable.cc'
--- src/logic/map_objects/immovable.cc 2016-10-25 07:07:14 +0000
+++ src/logic/map_objects/immovable.cc 2016-10-26 19:44:13 +0000
@@ -437,7 +437,7 @@
437}437}
438438
439void Immovable::draw(uint32_t gametime,439void Immovable::draw(uint32_t gametime,
440 const DrawText draw_text,440 const TextToDraw draw_text,
441 const Vector2f& point_on_dst,441 const Vector2f& point_on_dst,
442 float scale,442 float scale,
443 RenderTarget* dst) {443 RenderTarget* dst) {
@@ -452,7 +452,7 @@
452}452}
453453
454void Immovable::draw_construction(const uint32_t gametime,454void Immovable::draw_construction(const uint32_t gametime,
455 const DrawText draw_text,455 const TextToDraw draw_text,
456 const Vector2f& point_on_dst,456 const Vector2f& point_on_dst,
457 const float scale,457 const float scale,
458 RenderTarget* dst) {458 RenderTarget* dst) {
459459
=== modified file 'src/logic/map_objects/immovable.h'
--- src/logic/map_objects/immovable.h 2016-10-24 20:07:22 +0000
+++ src/logic/map_objects/immovable.h 2016-10-26 19:44:13 +0000
@@ -100,7 +100,7 @@
100 // the point for the hotspot of the animation and 'scale' determines how big100 // the point for the hotspot of the animation and 'scale' determines how big
101 // the immovable will be plotted.101 // the immovable will be plotted.
102 virtual void draw(uint32_t gametime,102 virtual void draw(uint32_t gametime,
103 DrawText draw_text,103 TextToDraw draw_text,
104 const Vector2f& point_on_dst,104 const Vector2f& point_on_dst,
105 float scale,105 float scale,
106 RenderTarget* dst) = 0;106 RenderTarget* dst) = 0;
@@ -222,7 +222,7 @@
222 void cleanup(EditorGameBase&) override;222 void cleanup(EditorGameBase&) override;
223 void act(Game&, uint32_t data) override;223 void act(Game&, uint32_t data) override;
224 void draw(uint32_t gametime,224 void draw(uint32_t gametime,
225 DrawText draw_text,225 TextToDraw draw_text,
226 const Vector2f& point_on_dst,226 const Vector2f& point_on_dst,
227 float scale,227 float scale,
228 RenderTarget* dst) override;228 RenderTarget* dst) override;
@@ -301,7 +301,7 @@
301private:301private:
302 void increment_program_pointer();302 void increment_program_pointer();
303 void draw_construction(uint32_t gametime,303 void draw_construction(uint32_t gametime,
304 DrawText draw_text,304 TextToDraw draw_text,
305 const Vector2f& point_on_dst,305 const Vector2f& point_on_dst,
306 float scale,306 float scale,
307 RenderTarget* dst);307 RenderTarget* dst);
308308
=== modified file 'src/logic/map_objects/map_object.cc'
--- src/logic/map_objects/map_object.cc 2016-10-23 12:59:11 +0000
+++ src/logic/map_objects/map_object.cc 2016-10-26 19:44:13 +0000
@@ -445,13 +445,13 @@
445 egbase.objects().remove(*this);445 egbase.objects().remove(*this);
446}446}
447447
448void MapObject::do_draw_info(const DrawText& draw_text,448void MapObject::do_draw_info(const TextToDraw& draw_text,
449 const std::string& census,449 const std::string& census,
450 const std::string& statictics,450 const std::string& statictics,
451 const Vector2f& field_on_dst,451 const Vector2f& field_on_dst,
452 float scale,452 float scale,
453 RenderTarget* dst) const {453 RenderTarget* dst) const {
454 if (draw_text == DrawText::kNone) {454 if (draw_text == TextToDraw::kNone) {
455 return;455 return;
456 }456 }
457457
@@ -468,11 +468,11 @@
468468
469 // Rounding guarantees that text aligns with pixels to avoid subsampling.469 // Rounding guarantees that text aligns with pixels to avoid subsampling.
470 const Vector2f census_pos = round(field_on_dst - Vector2f(0, 48) * scale).cast<float>();470 const Vector2f census_pos = round(field_on_dst - Vector2f(0, 48) * scale).cast<float>();
471 if (draw_text & DrawText::kCensus) {471 if (draw_text & TextToDraw::kCensus) {
472 dst->blit(census_pos, rendered_census_info, BlendMode::UseAlpha, UI::Align::kCenter);472 dst->blit(census_pos, rendered_census_info, BlendMode::UseAlpha, UI::Align::kCenter);
473 }473 }
474474
475 if (draw_text & DrawText::kStatistics && !statictics.empty()) {475 if (draw_text & TextToDraw::kStatistics && !statictics.empty()) {
476 const Vector2f statistics_pos =476 const Vector2f statistics_pos =
477 round(census_pos + Vector2f(0, rendered_census_info->height() / 2.f + 10 * scale))477 round(census_pos + Vector2f(0, rendered_census_info->height() / 2.f + 10 * scale))
478 .cast<float>();478 .cast<float>();
479479
=== modified file 'src/logic/map_objects/map_object.h'
--- src/logic/map_objects/map_object.h 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/map_object.h 2016-10-26 19:44:13 +0000
@@ -406,7 +406,7 @@
406 virtual void cleanup(EditorGameBase&);406 virtual void cleanup(EditorGameBase&);
407407
408 /// Draws census and statistics on screen408 /// Draws census and statistics on screen
409 void do_draw_info(const DrawText& draw_text,409 void do_draw_info(const TextToDraw& draw_text,
410 const std::string& census,410 const std::string& census,
411 const std::string& statictics,411 const std::string& statictics,
412 const Vector2f& field_on_dst,412 const Vector2f& field_on_dst,
413413
=== modified file 'src/logic/map_objects/tribes/building.cc'
--- src/logic/map_objects/tribes/building.cc 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/tribes/building.cc 2016-10-26 19:44:13 +0000
@@ -588,7 +588,7 @@
588588
589589
590void Building::draw(uint32_t gametime,590void Building::draw(uint32_t gametime,
591 const DrawText draw_text,591 const TextToDraw draw_text,
592 const Vector2f& point_on_dst,592 const Vector2f& point_on_dst,
593 const float scale,593 const float scale,
594 RenderTarget* dst) {594 RenderTarget* dst) {
@@ -606,12 +606,12 @@
606Draw overlay help strings when enabled.606Draw overlay help strings when enabled.
607===============607===============
608*/608*/
609void Building::draw_info(const DrawText draw_text,609void Building::draw_info(const TextToDraw draw_text,
610 const Vector2f& point_on_dst,610 const Vector2f& point_on_dst,
611 const float scale,611 const float scale,
612 RenderTarget* dst) {612 RenderTarget* dst) {
613 const std::string statistics_string =613 const std::string statistics_string =
614 (draw_text & DrawText::kStatistics) ? info_string(InfoStringFormat::kStatistics) : "";614 (draw_text & TextToDraw::kStatistics) ? info_string(InfoStringFormat::kStatistics) : "";
615 do_draw_info(draw_text, info_string(InfoStringFormat::kCensus), statistics_string, point_on_dst,615 do_draw_info(draw_text, info_string(InfoStringFormat::kCensus), statistics_string, point_on_dst,
616 scale, dst);616 scale, dst);
617}617}
618618
=== modified file 'src/logic/map_objects/tribes/building.h'
--- src/logic/map_objects/tribes/building.h 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/tribes/building.h 2016-10-26 19:44:13 +0000
@@ -312,11 +312,11 @@
312 void act(Game&, uint32_t data) override;312 void act(Game&, uint32_t data) override;
313313
314 void draw(uint32_t gametime,314 void draw(uint32_t gametime,
315 DrawText draw_text,315 TextToDraw draw_text,
316 const Vector2f& point_on_dst,316 const Vector2f& point_on_dst,
317 float scale,317 float scale,
318 RenderTarget* dst) override;318 RenderTarget* dst) override;
319 void draw_info(DrawText draw_text, const Vector2f& point_on_dst, float scale, RenderTarget* dst);319 void draw_info(TextToDraw draw_text, const Vector2f& point_on_dst, float scale, RenderTarget* dst);
320320
321 virtual void create_options_window(InteractiveGameBase&, UI::Window*& registry) = 0;321 virtual void create_options_window(InteractiveGameBase&, UI::Window*& registry) = 0;
322322
323323
=== modified file 'src/logic/map_objects/tribes/constructionsite.cc'
--- src/logic/map_objects/tribes/constructionsite.cc 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/tribes/constructionsite.cc 2016-10-26 19:44:13 +0000
@@ -298,7 +298,7 @@
298===============298===============
299*/299*/
300void ConstructionSite::draw(uint32_t gametime,300void ConstructionSite::draw(uint32_t gametime,
301 DrawText draw_text,301 TextToDraw draw_text,
302 const Vector2f& point_on_dst,302 const Vector2f& point_on_dst,
303 float scale,303 float scale,
304 RenderTarget* dst) {304 RenderTarget* dst) {
305305
=== modified file 'src/logic/map_objects/tribes/constructionsite.h'
--- src/logic/map_objects/tribes/constructionsite.h 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/tribes/constructionsite.h 2016-10-26 19:44:13 +0000
@@ -115,7 +115,7 @@
115 static void wares_queue_callback(Game&, WaresQueue*, DescriptionIndex, void* data);115 static void wares_queue_callback(Game&, WaresQueue*, DescriptionIndex, void* data);
116116
117 void draw(uint32_t gametime,117 void draw(uint32_t gametime,
118 DrawText draw_text,118 TextToDraw draw_text,
119 const Vector2f& point_on_dst,119 const Vector2f& point_on_dst,
120 float scale,120 float scale,
121 RenderTarget* dst) override;121 RenderTarget* dst) override;
122122
=== modified file 'src/logic/map_objects/tribes/dismantlesite.cc'
--- src/logic/map_objects/tribes/dismantlesite.cc 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/tribes/dismantlesite.cc 2016-10-26 19:44:13 +0000
@@ -213,7 +213,7 @@
213===============213===============
214*/214*/
215void DismantleSite::draw(uint32_t gametime,215void DismantleSite::draw(uint32_t gametime,
216 const DrawText draw_text,216 const TextToDraw draw_text,
217 const Vector2f& point_on_dst,217 const Vector2f& point_on_dst,
218 float scale,218 float scale,
219 RenderTarget* dst) {219 RenderTarget* dst) {
220220
=== modified file 'src/logic/map_objects/tribes/dismantlesite.h'
--- src/logic/map_objects/tribes/dismantlesite.h 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/tribes/dismantlesite.h 2016-10-26 19:44:13 +0000
@@ -90,7 +90,7 @@
90 void create_options_window(InteractiveGameBase&, UI::Window*& registry) override;90 void create_options_window(InteractiveGameBase&, UI::Window*& registry) override;
9191
92 void draw(uint32_t gametime,92 void draw(uint32_t gametime,
93 DrawText draw_text,93 TextToDraw draw_text,
94 const Vector2f& point_on_dst,94 const Vector2f& point_on_dst,
95 float scale,95 float scale,
96 RenderTarget* dst) override;96 RenderTarget* dst) override;
9797
=== modified file 'src/logic/map_objects/tribes/ship.cc'
--- src/logic/map_objects/tribes/ship.cc 2016-10-24 14:04:00 +0000
+++ src/logic/map_objects/tribes/ship.cc 2016-10-26 19:44:13 +0000
@@ -940,7 +940,7 @@
940}940}
941941
942void Ship::draw(const EditorGameBase& egbase,942void Ship::draw(const EditorGameBase& egbase,
943 const DrawText& draw_text,943 const TextToDraw& draw_text,
944 const Vector2f& field_on_dst,944 const Vector2f& field_on_dst,
945 const float scale,945 const float scale,
946 RenderTarget* dst) const {946 RenderTarget* dst) const {
@@ -948,7 +948,7 @@
948948
949 // Show ship name and current activity949 // Show ship name and current activity
950 std::string statistics_string = "";950 std::string statistics_string = "";
951 if (draw_text & DrawText::kStatistics) {951 if (draw_text & TextToDraw::kStatistics) {
952 switch (ship_state_) {952 switch (ship_state_) {
953 case (ShipStates::kTransport):953 case (ShipStates::kTransport):
954 /** TRANSLATORS: This is a ship state */954 /** TRANSLATORS: This is a ship state */
955955
=== modified file 'src/logic/map_objects/tribes/ship.h'
--- src/logic/map_objects/tribes/ship.h 2016-10-24 14:04:00 +0000
+++ src/logic/map_objects/tribes/ship.h 2016-10-26 19:44:13 +0000
@@ -240,7 +240,7 @@
240240
241protected:241protected:
242 void draw(const EditorGameBase&,242 void draw(const EditorGameBase&,
243 const DrawText& draw_text,243 const TextToDraw& draw_text,
244 const Vector2f& field_on_dst,244 const Vector2f& field_on_dst,
245 float scale,245 float scale,
246 RenderTarget* dst) const override;246 RenderTarget* dst) const override;
247247
=== modified file 'src/logic/map_objects/tribes/soldier.cc'
--- src/logic/map_objects/tribes/soldier.cc 2016-10-22 11:24:18 +0000
+++ src/logic/map_objects/tribes/soldier.cc 2016-10-26 19:44:13 +0000
@@ -440,7 +440,7 @@
440 * Draw this soldier. This basically draws him as a worker, but add health points440 * Draw this soldier. This basically draws him as a worker, but add health points
441 */441 */
442void Soldier::draw(const EditorGameBase& game,442void Soldier::draw(const EditorGameBase& game,
443 const DrawText&,443 const TextToDraw&,
444 const Vector2f& field_on_dst,444 const Vector2f& field_on_dst,
445 const float scale,445 const float scale,
446 RenderTarget* dst) const {446 RenderTarget* dst) const {
447447
=== modified file 'src/logic/map_objects/tribes/soldier.h'
--- src/logic/map_objects/tribes/soldier.h 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/tribes/soldier.h 2016-10-26 19:44:13 +0000
@@ -209,7 +209,7 @@
209209
210 /// Draw this soldier210 /// Draw this soldier
211 void draw(const EditorGameBase&,211 void draw(const EditorGameBase&,
212 const DrawText& draw_text,212 const TextToDraw& draw_text,
213 const Vector2f& point_on_dst,213 const Vector2f& point_on_dst,
214 float scale,214 float scale,
215 RenderTarget* dst) const override;215 RenderTarget* dst) const override;
216216
=== modified file 'src/logic/map_objects/tribes/worker.cc'
--- src/logic/map_objects/tribes/worker.cc 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/tribes/worker.cc 2016-10-26 19:44:13 +0000
@@ -2535,7 +2535,7 @@
2535 * Draw the worker, taking the carried ware into account.2535 * Draw the worker, taking the carried ware into account.
2536 */2536 */
2537void Worker::draw(const EditorGameBase& egbase,2537void Worker::draw(const EditorGameBase& egbase,
2538 const DrawText&,2538 const TextToDraw&,
2539 const Vector2f& field_on_dst,2539 const Vector2f& field_on_dst,
2540 const float scale,2540 const float scale,
2541 RenderTarget* dst) const {2541 RenderTarget* dst) const {
25422542
=== modified file 'src/logic/map_objects/tribes/worker.h'
--- src/logic/map_objects/tribes/worker.h 2016-10-22 11:20:33 +0000
+++ src/logic/map_objects/tribes/worker.h 2016-10-26 19:44:13 +0000
@@ -181,7 +181,7 @@
181 const float scale,181 const float scale,
182 RenderTarget* dst) const;182 RenderTarget* dst) const;
183 void draw(const EditorGameBase&,183 void draw(const EditorGameBase&,
184 const DrawText& draw_text,184 const TextToDraw& draw_text,
185 const Vector2f& field_on_dst,185 const Vector2f& field_on_dst,
186 float scale,186 float scale,
187 RenderTarget* dst) const override;187 RenderTarget* dst) const override;
188188
=== modified file 'src/wui/mapview.cc'
--- src/wui/mapview.cc 2016-10-24 20:56:32 +0000
+++ src/wui/mapview.cc 2016-10-26 19:44:13 +0000
@@ -131,20 +131,20 @@
131 return;131 return;
132 }132 }
133133
134 DrawText draw_text = DrawText::kNone;134 TextToDraw draw_text = TextToDraw::kNone;
135 auto display_flags = intbase().get_display_flags();135 auto display_flags = intbase().get_display_flags();
136 if (display_flags & InteractiveBase::dfShowCensus) {136 if (display_flags & InteractiveBase::dfShowCensus) {
137 draw_text = draw_text | DrawText::kCensus;137 draw_text = draw_text | TextToDraw::kCensus;
138 }138 }
139 if (display_flags & InteractiveBase::dfShowStatistics) {139 if (display_flags & InteractiveBase::dfShowStatistics) {
140 draw_text = draw_text | DrawText::kStatistics;140 draw_text = draw_text | TextToDraw::kStatistics;
141 }141 }
142142
143 if (upcast(InteractivePlayer const, interactive_player, &intbase())) {143 if (upcast(InteractivePlayer const, interactive_player, &intbase())) {
144 renderer_->rendermap(144 renderer_->rendermap(
145 egbase, viewpoint_, zoom_, interactive_player->player(), draw_text, &dst);145 egbase, viewpoint_, zoom_, interactive_player->player(), draw_text, &dst);
146 } else {146 } else {
147 renderer_->rendermap(egbase, viewpoint_, zoom_, static_cast<DrawText>(draw_text), &dst);147 renderer_->rendermap(egbase, viewpoint_, zoom_, static_cast<TextToDraw>(draw_text), &dst);
148 }148 }
149}149}
150150
151151
=== modified file 'src/wui/transport_draw.cc'
--- src/wui/transport_draw.cc 2016-10-24 14:07:28 +0000
+++ src/wui/transport_draw.cc 2016-10-26 19:44:13 +0000
@@ -27,7 +27,7 @@
27namespace Widelands {27namespace Widelands {
2828
29void Flag::draw(uint32_t gametime,29void Flag::draw(uint32_t gametime,
30 const DrawText,30 const TextToDraw,
31 const Vector2f& point_on_dst,31 const Vector2f& point_on_dst,
32 float scale,32 float scale,
33 RenderTarget* dst) {33 RenderTarget* dst) {
@@ -54,6 +54,6 @@
54}54}
5555
56/** The road is drawn by the terrain renderer via marked fields. */56/** The road is drawn by the terrain renderer via marked fields. */
57void Road::draw(uint32_t, const DrawText, const Vector2f&, float, RenderTarget*) {57void Road::draw(uint32_t, const TextToDraw, const Vector2f&, float, RenderTarget*) {
58}58}
59}59}

Subscribers

People subscribed via source and target branches

to status/vote changes: