Merge lp:~widelands-dev/widelands/bug-1344350 into lp:widelands

Proposed by GunChleoc
Status: Merged
Merged at revision: 7140
Proposed branch: lp:~widelands-dev/widelands/bug-1344350
Merge into: lp:widelands
Diff against target: 95 lines (+21/-7)
6 files modified
src/economy/test/test_routing.cc (+1/-1)
src/logic/building.cc (+1/-1)
src/logic/building.h (+4/-0)
src/logic/partially_finished_building.cc (+11/-0)
src/logic/partially_finished_building.h (+3/-4)
src/wui/buildingwindow.cc (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands/bug-1344350
Reviewer Review Type Date Requested Status
SirVer Approve
Review via email: mp+228379@code.launchpad.net

Description of the change

Fixed image for partially constructed building

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/economy/test/test_routing.cc'
2--- src/economy/test/test_routing.cc 2014-07-25 22:17:48 +0000
3+++ src/economy/test/test_routing.cc 2014-07-26 10:57:57 +0000
4@@ -56,7 +56,7 @@
5 return _neighbours[idx];
6 }
7
8- virtual Flag & base_flag() override {return _flag;}
9+ Flag & base_flag() override {return _flag;}
10 void set_waitcost(int32_t const wc) {_waitcost = wc;}
11 int32_t get_waitcost() const {return _waitcost;}
12 const Coords & get_position() const override {return _position;}
13
14=== modified file 'src/logic/building.cc'
15--- src/logic/building.cc 2014-07-26 09:48:21 +0000
16+++ src/logic/building.cc 2014-07-26 10:57:57 +0000
17@@ -907,7 +907,7 @@
18 // animations of buildings so that the messages can still be displayed, even
19 // after reload.
20 const std::string& img = g_gr->animations().get_animation
21- (descr().get_ui_anim()).representative_image_from_disk().hash();
22+ (get_ui_anim()).representative_image_from_disk().hash();
23 std::string rt_description;
24 rt_description.reserve
25 (strlen("<rt image=") + img.size() + 1 +
26
27=== modified file 'src/logic/building.h'
28--- src/logic/building.h 2014-07-26 10:43:23 +0000
29+++ src/logic/building.h 2014-07-26 10:57:57 +0000
30@@ -184,6 +184,10 @@
31 int32_t get_size () const override;
32 bool get_passable() const override;
33
34+ //Return the animation ID that is used for the building in UI items
35+ //(the building UI, messages, etc..)
36+ virtual uint32_t get_ui_anim() const {return descr().get_ui_anim();}
37+
38 Flag & base_flag() override;
39 virtual uint32_t get_playercaps() const;
40
41
42=== modified file 'src/logic/partially_finished_building.cc'
43--- src/logic/partially_finished_building.cc 2014-07-24 20:39:56 +0000
44+++ src/logic/partially_finished_building.cc 2014-07-26 10:57:57 +0000
45@@ -141,6 +141,17 @@
46 return caps;
47 }
48
49+/*
50+===============
51+Return the animation for the building that is in construction, as this
52+should be more useful to the player.
53+===============
54+*/
55+uint32_t Partially_Finished_Building::get_ui_anim() const
56+{
57+ return m_building->get_animation("idle");
58+}
59+
60
61 /*
62 ===============
63
64=== modified file 'src/logic/partially_finished_building.h'
65--- src/logic/partially_finished_building.h 2014-07-26 10:43:23 +0000
66+++ src/logic/partially_finished_building.h 2014-07-26 10:57:57 +0000
67@@ -43,12 +43,11 @@
68
69 virtual void set_building (const Building_Descr &);
70
71- void init (Editor_Game_Base &) override;
72- void cleanup(Editor_Game_Base &) override;
73-
74 int32_t get_size() const override;
75 uint32_t get_playercaps() const override;
76-
77+ uint32_t get_ui_anim() const override;
78+ void cleanup(Editor_Game_Base &) override;
79+ void init (Editor_Game_Base &) override;
80 void set_economy(Economy *) override;
81
82 uint32_t get_nrwaresqueues() {return m_wares.size();}
83
84=== modified file 'src/wui/buildingwindow.cc'
85--- src/wui/buildingwindow.cc 2014-07-25 13:45:18 +0000
86+++ src/wui/buildingwindow.cc 2014-07-26 10:57:57 +0000
87@@ -115,7 +115,7 @@
88 {
89 UI::Window::draw(dst);
90
91- const Animation& anim = g_gr->animations().get_animation(building().descr().get_ui_anim());
92+ const Animation& anim = g_gr->animations().get_animation(building().get_ui_anim());
93
94 const Image* dark_frame = ImageTransformations::change_luminosity
95 (&anim.representative_image(building().owner().get_playercolor()), 1.22, true);

Subscribers

People subscribed via source and target branches

to status/vote changes: