Merge lp:~widelands-dev/widelands/busy_roads_for_buildings into lp:widelands
- busy_roads_for_buildings
- Merge into trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 7391 | ||||||||
Proposed branch: | lp:~widelands-dev/widelands/busy_roads_for_buildings | ||||||||
Merge into: | lp:widelands | ||||||||
Diff against target: |
1276 lines (+341/-140) 34 files modified
src/economy/flag.cc (+4/-2) src/economy/road.cc (+7/-7) src/graphic/game_renderer.cc (+7/-0) src/graphic/gl/fields_to_draw.h (+5/-1) src/graphic/gl/road_program.cc (+39/-51) src/graphic/gl/road_program.h (+6/-15) src/logic/CMakeLists.txt (+2/-0) src/logic/bob.h (+1/-1) src/logic/buildcost.h (+1/-1) src/logic/building.h (+1/-1) src/logic/editor_game_base.cc (+42/-12) src/logic/editor_game_base.h (+5/-3) src/logic/field.h (+2/-2) src/logic/immovable.h (+1/-1) src/logic/player.cc (+6/-6) src/logic/player.h (+4/-4) src/logic/production_program.h (+1/-1) src/logic/road_textures.cc (+38/-0) src/logic/road_textures.h (+45/-0) src/logic/roadtype.h (+8/-8) src/logic/tribe.cc (+50/-0) src/logic/tribe.h (+25/-2) src/logic/ware_descr.h (+1/-1) src/logic/warehouse.h (+1/-1) src/logic/worker_descr.h (+1/-1) src/map_io/map_players_view_packet.cc (+12/-12) src/scripting/lua_game.h (+1/-1) src/scripting/lua_map.cc (+3/-3) src/wui/encyclopedia_window.h (+1/-1) src/wui/interactive_base.cc (+1/-1) src/wui/waresdisplay.h (+1/-1) tribes/atlanteans/conf (+6/-0) tribes/barbarians/conf (+5/-0) tribes/empire/conf (+8/-0) |
||||||||
To merge this branch: | bzr merge lp:~widelands-dev/widelands/busy_roads_for_buildings | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
GunChleoc | Approve | ||
Review via email: mp+249013@code.launchpad.net |
Commit message
Description of the change
- Implement drawing of per-tribe roads and textures. Each tribe can have multiple normal or busy roads and they will be used at random when roads are drawn.
- Small buildings will now use normal roads for the road towards them, all others use busy roads.
SirVer (sirver) wrote : | # |
GunChleoc (gunchleoc) wrote : | # |
LGTM. We had discussed different road textures for different terrains though rather than using them at random. Maybe something for another branch?
SirVer (sirver) wrote : | # |
> LGTM. We had discussed different road textures for different terrains though rather than using them at random. Maybe something for another branch?
thanks for the review! I know that this has been discussed too, but it is distinct from the feature I added here. I hope that with this merge request, the repetition of roads can be reduced a bit to not look too dull.
About the roads per texture suggestion: I think it is viable to look into that, but I'd prefer to see some mocks before jumping at an implementation. I could imagine that it might get too noisy and with the current road system, pretty distinct (i.e. non uniform color) roads can be made that I hope are rather visible on all terrains.
kaputtnik (franku) wrote : | # |
If i add more than one normal road to each tribe, could i use this branch again for upload? Or must i create a new branch from trunk?
kaputtnik (franku) wrote : | # |
Forgotton: I want to store the related gimp-xcf files also somewhere in the project. I think widelands-media is the correct place for that... but its quity messy and i don't know where to put such files.
Chuck Wilder (chuckw20) wrote : | # |
The Widelands media branch is truly the place where the xcf files should be
stored.
If you wish, attach them to a reply here and I will be happy to push them
to the media branch. It is a huge trunk owing to all of the graphics files
and it takes a long time to checkout a branch.
On Tue, Feb 10, 2015 at 9:33 AM, kaputtnik <email address hidden> wrote:
> Forgotton: I want to store the related gimp-xcf files also somewhere in
> the project. I think widelands-media is the correct place for that... but
> its quity messy and i don't know where to put such files.
> --
>
> https:/
> You are subscribed to branch lp:widelands.
>
kaputtnik (franku) wrote : | # |
Thanks chuck,
the zip file contains xcf-files for each tribe plus one with testpatterns. If you find the testpatterns are useless, throw it away.
Because it isn't possible to make an attachment here, i provide a link to it:
http://
Chuck Wilder (chuckw20) wrote : | # |
I've got the zip file. The xcf's will be added to the media trunk with my
next push. Thanks!
On Wed, Feb 11, 2015 at 3:27 AM, kaputtnik <email address hidden> wrote:
> Thanks chuck,
>
> the zip file contains xcf-files for each tribe plus one with testpatterns.
> If you find the testpatterns are useless, throw it away.
>
> Because it isn't possible to make an attachment here, i provide a link to
> it:
>
> http://
> --
>
> https:/
> You are subscribed to branch lp:widelands.
>
SirVer (sirver) wrote : | # |
> If i add more than one normal road to each tribe, could i use this branch again for upload? Or must i create a new branch from trunk?
Making a new branch is usually the cleaner way of action. If that is inconvenient you can also reuse this one.
Preview Diff
1 | === modified file 'src/economy/flag.cc' | |||
2 | --- src/economy/flag.cc 2014-11-30 18:49:38 +0000 | |||
3 | +++ src/economy/flag.cc 2015-02-09 05:57:46 +0000 | |||
4 | @@ -203,7 +203,9 @@ | |||
5 | 203 | 203 | ||
6 | 204 | const Map & map = egbase.map(); | 204 | const Map & map = egbase.map(); |
7 | 205 | egbase.set_road | 205 | egbase.set_road |
9 | 206 | (map.get_fcoords(map.tl_n(m_position)), Road_SouthEast, Road_Normal); | 206 | (map.get_fcoords(map.tl_n(m_position)), |
10 | 207 | RoadType::kSouthEast, | ||
11 | 208 | m_building->get_size() == BaseImmovable::SMALL? RoadType::kNormal : RoadType::kBusy); | ||
12 | 207 | 209 | ||
13 | 208 | building.set_economy(get_economy()); | 210 | building.set_economy(get_economy()); |
14 | 209 | } | 211 | } |
15 | @@ -219,7 +221,7 @@ | |||
16 | 219 | 221 | ||
17 | 220 | const Map & map = egbase.map(); | 222 | const Map & map = egbase.map(); |
18 | 221 | egbase.set_road | 223 | egbase.set_road |
20 | 222 | (map.get_fcoords(map.tl_n(m_position)), Road_SouthEast, Road_None); | 224 | (map.get_fcoords(map.tl_n(m_position)), RoadType::kSouthEast, RoadType::kNone); |
21 | 223 | 225 | ||
22 | 224 | m_building = nullptr; | 226 | m_building = nullptr; |
23 | 225 | } | 227 | } |
24 | 226 | 228 | ||
25 | === modified file 'src/economy/road.cc' | |||
26 | --- src/economy/road.cc 2014-11-30 18:49:38 +0000 | |||
27 | +++ src/economy/road.cc 2015-02-09 05:57:46 +0000 | |||
28 | @@ -99,7 +99,7 @@ | |||
29 | 99 | Player & owner = start.owner(); | 99 | Player & owner = start.owner(); |
30 | 100 | Road & road = *new Road(); | 100 | Road & road = *new Road(); |
31 | 101 | road.set_owner(&owner); | 101 | road.set_owner(&owner); |
33 | 102 | road.m_type = Road_Normal; | 102 | road.m_type = RoadType::kNormal; |
34 | 103 | road.m_flags[FlagStart] = &start; | 103 | road.m_flags[FlagStart] = &start; |
35 | 104 | road.m_flags[FlagEnd] = &end; | 104 | road.m_flags[FlagEnd] = &end; |
36 | 105 | // m_flagidx is set when attach_road() is called, i.e. in init() | 105 | // m_flagidx is set when attach_road() is called, i.e. in init() |
37 | @@ -224,7 +224,7 @@ | |||
38 | 224 | Direction const rdir = 2 * (dir - WALK_E); | 224 | Direction const rdir = 2 * (dir - WALK_E); |
39 | 225 | 225 | ||
40 | 226 | if (rdir <= 4) | 226 | if (rdir <= 4) |
42 | 227 | egbase.set_road(curf, rdir, Road_None); | 227 | egbase.set_road(curf, rdir, RoadType::kNone); |
43 | 228 | } | 228 | } |
44 | 229 | 229 | ||
45 | 230 | // mark the road that leads away from this field | 230 | // mark the road that leads away from this field |
46 | @@ -233,7 +233,7 @@ | |||
47 | 233 | Direction const rdir = 2 * (dir - WALK_E); | 233 | Direction const rdir = 2 * (dir - WALK_E); |
48 | 234 | 234 | ||
49 | 235 | if (rdir <= 4) | 235 | if (rdir <= 4) |
51 | 236 | egbase.set_road(curf, rdir, Road_None); | 236 | egbase.set_road(curf, rdir, RoadType::kNone); |
52 | 237 | 237 | ||
53 | 238 | map.get_neighbour(curf, dir, &curf); | 238 | map.get_neighbour(curf, dir, &curf); |
54 | 239 | } | 239 | } |
55 | @@ -293,7 +293,7 @@ | |||
56 | 293 | } else if | 293 | } else if |
57 | 294 | (!slot.carrier_request && | 294 | (!slot.carrier_request && |
58 | 295 | (slot.carrier_type == 1 || | 295 | (slot.carrier_type == 1 || |
60 | 296 | m_type == Road_Busy)) { | 296 | m_type == RoadType::kBusy)) { |
61 | 297 | _request_carrier(slot); | 297 | _request_carrier(slot); |
62 | 298 | } | 298 | } |
63 | 299 | } | 299 | } |
64 | @@ -584,7 +584,7 @@ | |||
65 | 584 | (!slot.carrier.get(game) && | 584 | (!slot.carrier.get(game) && |
66 | 585 | !slot.carrier_request && | 585 | !slot.carrier_request && |
67 | 586 | (slot.carrier_type == 1 || | 586 | (slot.carrier_type == 1 || |
69 | 587 | m_type == Road_Busy)) { | 587 | m_type == RoadType::kBusy)) { |
70 | 588 | _request_carrier(slot); | 588 | _request_carrier(slot); |
71 | 589 | } | 589 | } |
72 | 590 | } | 590 | } |
73 | @@ -632,7 +632,7 @@ | |||
74 | 632 | // ie: cancelling current task | 632 | // ie: cancelling current task |
75 | 633 | m_carrier_slots[1].carrier = nullptr; | 633 | m_carrier_slots[1].carrier = nullptr; |
76 | 634 | m_carrier_slots[1].carrier_request = nullptr; | 634 | m_carrier_slots[1].carrier_request = nullptr; |
78 | 635 | m_type = Road_Normal; | 635 | m_type = RoadType::kNormal; |
79 | 636 | _mark_map(game); | 636 | _mark_map(game); |
80 | 637 | } | 637 | } |
81 | 638 | } | 638 | } |
82 | @@ -648,7 +648,7 @@ | |||
83 | 648 | if (100 < tdelta) { | 648 | if (100 < tdelta) { |
84 | 649 | m_busyness_last_update = gametime; | 649 | m_busyness_last_update = gametime; |
85 | 650 | if (500 < (m_busyness += 10)) { | 650 | if (500 < (m_busyness += 10)) { |
87 | 651 | m_type = Road_Busy; | 651 | m_type = RoadType::kBusy; |
88 | 652 | _mark_map(game); | 652 | _mark_map(game); |
89 | 653 | for (CarrierSlot& slot : m_carrier_slots) { | 653 | for (CarrierSlot& slot : m_carrier_slots) { |
90 | 654 | if | 654 | if |
91 | 655 | 655 | ||
92 | === modified file 'src/graphic/game_renderer.cc' | |||
93 | --- src/graphic/game_renderer.cc 2014-11-28 08:13:14 +0000 | |||
94 | +++ src/graphic/game_renderer.cc 2015-02-09 05:57:46 +0000 | |||
95 | @@ -209,6 +209,13 @@ | |||
96 | 209 | 209 | ||
97 | 210 | f.brightness = field_brightness(fcoords, gametime, map, player); | 210 | f.brightness = field_brightness(fcoords, gametime, map, player); |
98 | 211 | 211 | ||
99 | 212 | PlayerNumber owner_number = fcoords.field->get_owned_by(); | ||
100 | 213 | if (owner_number > 0) { | ||
101 | 214 | f.road_textures = &egbase.player(owner_number).tribe().road_textures(); | ||
102 | 215 | } else { | ||
103 | 216 | f.road_textures = nullptr; | ||
104 | 217 | } | ||
105 | 218 | |||
106 | 212 | f.roads = field_roads(fcoords, map, player); | 219 | f.roads = field_roads(fcoords, map, player); |
107 | 213 | } | 220 | } |
108 | 214 | } | 221 | } |
109 | 215 | 222 | ||
110 | === modified file 'src/graphic/gl/fields_to_draw.h' | |||
111 | --- src/graphic/gl/fields_to_draw.h 2014-11-08 18:06:17 +0000 | |||
112 | +++ src/graphic/gl/fields_to_draw.h 2015-02-09 05:57:46 +0000 | |||
113 | @@ -20,11 +20,14 @@ | |||
114 | 20 | #ifndef WL_GRAPHIC_GL_FIELDS_TO_DRAW_H | 20 | #ifndef WL_GRAPHIC_GL_FIELDS_TO_DRAW_H |
115 | 21 | #define WL_GRAPHIC_GL_FIELDS_TO_DRAW_H | 21 | #define WL_GRAPHIC_GL_FIELDS_TO_DRAW_H |
116 | 22 | 22 | ||
117 | 23 | #include <cstddef> | ||
118 | 24 | #include <string> | ||
119 | 23 | #include <vector> | 25 | #include <vector> |
120 | 24 | #include <cstddef> | ||
121 | 25 | 26 | ||
122 | 26 | #include <stdint.h> | 27 | #include <stdint.h> |
123 | 27 | 28 | ||
124 | 29 | #include "logic/road_textures.h" | ||
125 | 30 | |||
126 | 28 | // Helper struct that contains the data needed for drawing all fields. All | 31 | // Helper struct that contains the data needed for drawing all fields. All |
127 | 29 | // methods are inlined for performance reasons. | 32 | // methods are inlined for performance reasons. |
128 | 30 | class FieldsToDraw { | 33 | class FieldsToDraw { |
129 | @@ -37,6 +40,7 @@ | |||
130 | 37 | float brightness; // brightness of the pixel | 40 | float brightness; // brightness of the pixel |
131 | 38 | uint8_t ter_r, ter_d; // Texture index of the right and down triangle. | 41 | uint8_t ter_r, ter_d; // Texture index of the right and down triangle. |
132 | 39 | uint8_t roads; // Bitmask of roads to render, see logic/roadtype.h. | 42 | uint8_t roads; // Bitmask of roads to render, see logic/roadtype.h. |
133 | 43 | const RoadTextures* road_textures; // Road Textures to use for drawing. | ||
134 | 40 | }; | 44 | }; |
135 | 41 | 45 | ||
136 | 42 | FieldsToDraw(int minfx, int maxfx, int minfy, int maxfy) | 46 | FieldsToDraw(int minfx, int maxfx, int minfy, int maxfy) |
137 | 43 | 47 | ||
138 | === modified file 'src/graphic/gl/road_program.cc' | |||
139 | --- src/graphic/gl/road_program.cc 2015-01-20 18:54:50 +0000 | |||
140 | +++ src/graphic/gl/road_program.cc 2015-02-09 05:57:46 +0000 | |||
141 | @@ -19,6 +19,7 @@ | |||
142 | 19 | 19 | ||
143 | 20 | #include "graphic/gl/road_program.h" | 20 | #include "graphic/gl/road_program.h" |
144 | 21 | 21 | ||
145 | 22 | #include <cassert> | ||
146 | 22 | #include <cmath> | 23 | #include <cmath> |
147 | 23 | 24 | ||
148 | 24 | #include "base/log.h" | 25 | #include "base/log.h" |
149 | @@ -37,17 +38,14 @@ | |||
150 | 37 | // Attributes. | 38 | // Attributes. |
151 | 38 | attribute vec2 attr_position; | 39 | attribute vec2 attr_position; |
152 | 39 | attribute vec2 attr_texture_position; | 40 | attribute vec2 attr_texture_position; |
153 | 40 | attribute float attr_texture_mix; | ||
154 | 41 | attribute float attr_brightness; | 41 | attribute float attr_brightness; |
155 | 42 | 42 | ||
156 | 43 | // Outputs. | 43 | // Outputs. |
157 | 44 | varying vec2 out_texture_position; | 44 | varying vec2 out_texture_position; |
158 | 45 | varying float out_texture_mix; | ||
159 | 46 | varying float out_brightness; | 45 | varying float out_brightness; |
160 | 47 | 46 | ||
161 | 48 | void main() { | 47 | void main() { |
162 | 49 | out_texture_position = attr_texture_position; | 48 | out_texture_position = attr_texture_position; |
163 | 50 | out_texture_mix = attr_texture_mix; | ||
164 | 51 | out_brightness = attr_brightness; | 49 | out_brightness = attr_brightness; |
165 | 52 | gl_Position = vec4(attr_position, 0., 1.); | 50 | gl_Position = vec4(attr_position, 0., 1.); |
166 | 53 | } | 51 | } |
167 | @@ -58,16 +56,12 @@ | |||
168 | 58 | 56 | ||
169 | 59 | // Inputs. | 57 | // Inputs. |
170 | 60 | varying vec2 out_texture_position; | 58 | varying vec2 out_texture_position; |
171 | 61 | varying float out_texture_mix; | ||
172 | 62 | varying float out_brightness; | 59 | varying float out_brightness; |
173 | 63 | 60 | ||
176 | 64 | uniform sampler2D u_normal_road_texture; | 61 | uniform sampler2D u_texture; |
175 | 65 | uniform sampler2D u_busy_road_texture; | ||
177 | 66 | 62 | ||
178 | 67 | void main() { | 63 | void main() { |
182 | 68 | vec4 normal_road_color = texture2D(u_normal_road_texture, out_texture_position); | 64 | vec4 color = texture2D(u_texture, out_texture_position); |
180 | 69 | vec4 busy_road_color = texture2D(u_busy_road_texture, out_texture_position); | ||
181 | 70 | vec4 color = mix(normal_road_color, busy_road_color, out_texture_mix); | ||
183 | 71 | color.rgb *= out_brightness; | 65 | color.rgb *= out_brightness; |
184 | 72 | gl_FragColor = color; | 66 | gl_FragColor = color; |
185 | 73 | } | 67 | } |
186 | @@ -81,14 +75,9 @@ | |||
187 | 81 | attr_position_ = glGetAttribLocation(gl_program_.object(), "attr_position"); | 75 | attr_position_ = glGetAttribLocation(gl_program_.object(), "attr_position"); |
188 | 82 | attr_texture_position_ = | 76 | attr_texture_position_ = |
189 | 83 | glGetAttribLocation(gl_program_.object(), "attr_texture_position"); | 77 | glGetAttribLocation(gl_program_.object(), "attr_texture_position"); |
190 | 84 | attr_texture_mix_ = glGetAttribLocation(gl_program_.object(), "attr_texture_mix"); | ||
191 | 85 | attr_brightness_ = glGetAttribLocation(gl_program_.object(), "attr_brightness"); | 78 | attr_brightness_ = glGetAttribLocation(gl_program_.object(), "attr_brightness"); |
192 | 86 | 79 | ||
198 | 87 | u_normal_road_texture_ = glGetUniformLocation(gl_program_.object(), "u_normal_road_texture"); | 80 | u_texture_ = glGetUniformLocation(gl_program_.object(), "u_texture"); |
194 | 88 | u_busy_road_texture_ = glGetUniformLocation(gl_program_.object(), "u_busy_road_texture"); | ||
195 | 89 | |||
196 | 90 | normal_road_texture_ = load_image("world/pics/roadt_normal.png"); | ||
197 | 91 | busy_road_texture_ = load_image("world/pics/roadt_busy.png"); | ||
199 | 92 | } | 81 | } |
200 | 93 | 82 | ||
201 | 94 | RoadProgram::~RoadProgram() { | 83 | RoadProgram::~RoadProgram() { |
202 | @@ -97,16 +86,15 @@ | |||
203 | 97 | void RoadProgram::add_road(const Surface& surface, | 86 | void RoadProgram::add_road(const Surface& surface, |
204 | 98 | const FieldsToDraw::Field& start, | 87 | const FieldsToDraw::Field& start, |
205 | 99 | const FieldsToDraw::Field& end, | 88 | const FieldsToDraw::Field& end, |
207 | 100 | const Widelands::RoadType road_type) { | 89 | const Widelands::RoadType road_type, |
208 | 90 | const Direction direction, | ||
209 | 91 | int* gl_texture) { | ||
210 | 101 | // The thickness of the road in pixels on screen. | 92 | // The thickness of the road in pixels on screen. |
211 | 102 | static constexpr float kRoadThicknessInPixels = 5.; | 93 | static constexpr float kRoadThicknessInPixels = 5.; |
212 | 103 | 94 | ||
213 | 104 | // The overshot of the road in either direction in percent. | 95 | // The overshot of the road in either direction in percent. |
214 | 105 | static constexpr float kRoadElongationInPercent = .1; | 96 | static constexpr float kRoadElongationInPercent = .1; |
215 | 106 | 97 | ||
216 | 107 | // A tiny value we use instead 0, to make sure that we always sample inside of the texture. | ||
217 | 108 | constexpr float kEpsilon = 1e-6; | ||
218 | 109 | |||
219 | 110 | const float delta_x = end.pixel_x - start.pixel_x; | 98 | const float delta_x = end.pixel_x - start.pixel_x; |
220 | 111 | const float delta_y = end.pixel_y - start.pixel_y; | 99 | const float delta_y = end.pixel_y - start.pixel_y; |
221 | 112 | const float vector_length = std::hypot(delta_x, delta_y); | 100 | const float vector_length = std::hypot(delta_x, delta_y); |
222 | @@ -119,35 +107,43 @@ | |||
223 | 119 | const float road_thickness_x = (-delta_y / vector_length) * kRoadThicknessInPixels; | 107 | const float road_thickness_x = (-delta_y / vector_length) * kRoadThicknessInPixels; |
224 | 120 | const float road_thickness_y = (delta_x / vector_length) * kRoadThicknessInPixels; | 108 | const float road_thickness_y = (delta_x / vector_length) * kRoadThicknessInPixels; |
225 | 121 | 109 | ||
227 | 122 | const float texture_mix = road_type == Widelands::Road_Normal ? 0. : 1.; | 110 | const Texture& texture = |
228 | 111 | road_type == Widelands::RoadType::kNormal ? | ||
229 | 112 | start.road_textures->get_normal_texture(start.fx, start.fy, direction) : | ||
230 | 113 | start.road_textures->get_busy_texture(start.fx, start.fy, direction); | ||
231 | 114 | if (*gl_texture == -1) { | ||
232 | 115 | *gl_texture = texture.get_gl_texture(); | ||
233 | 116 | } | ||
234 | 117 | // We assume that all road textures are in the same OpenGL texture, i.e. in | ||
235 | 118 | // one texture atlas. | ||
236 | 119 | assert(*gl_texture == texture.get_gl_texture()); | ||
237 | 120 | |||
238 | 121 | const auto& texture_rect = texture.texture_coordinates(); | ||
239 | 123 | 122 | ||
240 | 124 | vertices_.emplace_back(PerVertexData{ | 123 | vertices_.emplace_back(PerVertexData{ |
241 | 125 | start.pixel_x - road_overshoot_x + road_thickness_x, | 124 | start.pixel_x - road_overshoot_x + road_thickness_x, |
242 | 126 | start.pixel_y - road_overshoot_y + road_thickness_y, | 125 | start.pixel_y - road_overshoot_y + road_thickness_y, |
245 | 127 | kEpsilon, | 126 | texture_rect.x, |
246 | 128 | kEpsilon, | 127 | texture_rect.y, |
247 | 129 | start.brightness, | 128 | start.brightness, |
248 | 130 | texture_mix, | ||
249 | 131 | }); | 129 | }); |
250 | 132 | surface.pixel_to_gl(&vertices_.back().gl_x, &vertices_.back().gl_y); | 130 | surface.pixel_to_gl(&vertices_.back().gl_x, &vertices_.back().gl_y); |
251 | 133 | 131 | ||
252 | 134 | vertices_.emplace_back(PerVertexData{ | 132 | vertices_.emplace_back(PerVertexData{ |
253 | 135 | start.pixel_x - road_overshoot_x - road_thickness_x, | 133 | start.pixel_x - road_overshoot_x - road_thickness_x, |
254 | 136 | start.pixel_y - road_overshoot_y - road_thickness_y, | 134 | start.pixel_y - road_overshoot_y - road_thickness_y, |
257 | 137 | kEpsilon, | 135 | texture_rect.x, |
258 | 138 | 1.f - kEpsilon, | 136 | texture_rect.y + texture_rect.h, |
259 | 139 | start.brightness, | 137 | start.brightness, |
260 | 140 | texture_mix, | ||
261 | 141 | }); | 138 | }); |
262 | 142 | surface.pixel_to_gl(&vertices_.back().gl_x, &vertices_.back().gl_y); | 139 | surface.pixel_to_gl(&vertices_.back().gl_x, &vertices_.back().gl_y); |
263 | 143 | 140 | ||
264 | 144 | vertices_.emplace_back(PerVertexData{ | 141 | vertices_.emplace_back(PerVertexData{ |
265 | 145 | end.pixel_x + road_overshoot_x + road_thickness_x, | 142 | end.pixel_x + road_overshoot_x + road_thickness_x, |
266 | 146 | end.pixel_y + road_overshoot_y + road_thickness_y, | 143 | end.pixel_y + road_overshoot_y + road_thickness_y, |
269 | 147 | 1.f - kEpsilon, | 144 | texture_rect.x + texture_rect.w, |
270 | 148 | kEpsilon, | 145 | texture_rect.y, |
271 | 149 | end.brightness, | 146 | end.brightness, |
272 | 150 | texture_mix, | ||
273 | 151 | }); | 147 | }); |
274 | 152 | surface.pixel_to_gl(&vertices_.back().gl_x, &vertices_.back().gl_y); | 148 | surface.pixel_to_gl(&vertices_.back().gl_x, &vertices_.back().gl_y); |
275 | 153 | 149 | ||
276 | @@ -161,10 +157,9 @@ | |||
277 | 161 | vertices_.emplace_back(PerVertexData{ | 157 | vertices_.emplace_back(PerVertexData{ |
278 | 162 | end.pixel_x + road_overshoot_x - road_thickness_x, | 158 | end.pixel_x + road_overshoot_x - road_thickness_x, |
279 | 163 | end.pixel_y + road_overshoot_y - road_thickness_y, | 159 | end.pixel_y + road_overshoot_y - road_thickness_y, |
282 | 164 | 1.f - kEpsilon, | 160 | texture_rect.x + texture_rect.w, |
283 | 165 | 1.f - kEpsilon, | 161 | texture_rect.y + texture_rect.h, |
284 | 166 | end.brightness, | 162 | end.brightness, |
285 | 167 | texture_mix, | ||
286 | 168 | }); | 163 | }); |
287 | 169 | surface.pixel_to_gl(&vertices_.back().gl_x, &vertices_.back().gl_y); | 164 | surface.pixel_to_gl(&vertices_.back().gl_x, &vertices_.back().gl_y); |
288 | 170 | } | 165 | } |
289 | @@ -172,6 +167,7 @@ | |||
290 | 172 | void RoadProgram::draw(const Surface& surface, const FieldsToDraw& fields_to_draw) { | 167 | void RoadProgram::draw(const Surface& surface, const FieldsToDraw& fields_to_draw) { |
291 | 173 | vertices_.clear(); | 168 | vertices_.clear(); |
292 | 174 | 169 | ||
293 | 170 | int gl_texture = -1; | ||
294 | 175 | for (size_t current_index = 0; current_index < fields_to_draw.size(); ++current_index) { | 171 | for (size_t current_index = 0; current_index < fields_to_draw.size(); ++current_index) { |
295 | 176 | const FieldsToDraw::Field& field = fields_to_draw.at(current_index); | 172 | const FieldsToDraw::Field& field = fields_to_draw.at(current_index); |
296 | 177 | 173 | ||
297 | @@ -179,9 +175,9 @@ | |||
298 | 179 | const int rn_index = fields_to_draw.calculate_index(field.fx + 1, field.fy); | 175 | const int rn_index = fields_to_draw.calculate_index(field.fx + 1, field.fy); |
299 | 180 | if (rn_index != -1) { | 176 | if (rn_index != -1) { |
300 | 181 | const Widelands::RoadType road = | 177 | const Widelands::RoadType road = |
304 | 182 | static_cast<Widelands::RoadType>(field.roads & Widelands::Road_Mask); | 178 | static_cast<Widelands::RoadType>(field.roads & Widelands::RoadType::kMask); |
305 | 183 | if (road != Widelands::Road_None) { | 179 | if (road != Widelands::RoadType::kNone) { |
306 | 184 | add_road(surface, field, fields_to_draw.at(rn_index), road); | 180 | add_road(surface, field, fields_to_draw.at(rn_index), road, kEast, &gl_texture); |
307 | 185 | } | 181 | } |
308 | 186 | } | 182 | } |
309 | 187 | 183 | ||
310 | @@ -189,9 +185,9 @@ | |||
311 | 189 | const int brn_index = fields_to_draw.calculate_index(field.fx + (field.fy & 1), field.fy + 1); | 185 | const int brn_index = fields_to_draw.calculate_index(field.fx + (field.fy & 1), field.fy + 1); |
312 | 190 | if (brn_index != -1) { | 186 | if (brn_index != -1) { |
313 | 191 | const Widelands::RoadType road = | 187 | const Widelands::RoadType road = |
317 | 192 | static_cast<Widelands::RoadType>((field.roads >> 2) & Widelands::Road_Mask); | 188 | static_cast<Widelands::RoadType>((field.roads >> 2) & Widelands::RoadType::kMask); |
318 | 193 | if (road != Widelands::Road_None) { | 189 | if (road != Widelands::RoadType::kNone) { |
319 | 194 | add_road(surface, field, fields_to_draw.at(brn_index), road); | 190 | add_road(surface, field, fields_to_draw.at(brn_index), road, kSouthEast, &gl_texture); |
320 | 195 | } | 191 | } |
321 | 196 | } | 192 | } |
322 | 197 | 193 | ||
323 | @@ -200,9 +196,9 @@ | |||
324 | 200 | fields_to_draw.calculate_index(field.fx + (field.fy & 1) - 1, field.fy + 1); | 196 | fields_to_draw.calculate_index(field.fx + (field.fy & 1) - 1, field.fy + 1); |
325 | 201 | if (bln_index != -1) { | 197 | if (bln_index != -1) { |
326 | 202 | const Widelands::RoadType road = | 198 | const Widelands::RoadType road = |
330 | 203 | static_cast<Widelands::RoadType>((field.roads >> 4) & Widelands::Road_Mask); | 199 | static_cast<Widelands::RoadType>((field.roads >> 4) & Widelands::RoadType::kMask); |
331 | 204 | if (road != Widelands::Road_None) { | 200 | if (road != Widelands::RoadType::kNone) { |
332 | 205 | add_road(surface, field, fields_to_draw.at(bln_index), road); | 201 | add_road(surface, field, fields_to_draw.at(bln_index), road, kSouthWest, &gl_texture); |
333 | 206 | } | 202 | } |
334 | 207 | } | 203 | } |
335 | 208 | } | 204 | } |
336 | @@ -212,7 +208,6 @@ | |||
337 | 212 | glEnableVertexAttribArray(attr_position_); | 208 | glEnableVertexAttribArray(attr_position_); |
338 | 213 | glEnableVertexAttribArray(attr_texture_position_); | 209 | glEnableVertexAttribArray(attr_texture_position_); |
339 | 214 | glEnableVertexAttribArray(attr_brightness_); | 210 | glEnableVertexAttribArray(attr_brightness_); |
340 | 215 | glEnableVertexAttribArray(attr_texture_mix_); | ||
341 | 216 | 211 | ||
342 | 217 | glBindBuffer(GL_ARRAY_BUFFER, gl_array_buffer_.object()); | 212 | glBindBuffer(GL_ARRAY_BUFFER, gl_array_buffer_.object()); |
343 | 218 | glBufferData( | 213 | glBufferData( |
344 | @@ -229,25 +224,18 @@ | |||
345 | 229 | set_attrib_pointer(attr_position_, 2, offsetof(PerVertexData, gl_x)); | 224 | set_attrib_pointer(attr_position_, 2, offsetof(PerVertexData, gl_x)); |
346 | 230 | set_attrib_pointer(attr_texture_position_, 2, offsetof(PerVertexData, texture_x)); | 225 | set_attrib_pointer(attr_texture_position_, 2, offsetof(PerVertexData, texture_x)); |
347 | 231 | set_attrib_pointer(attr_brightness_, 1, offsetof(PerVertexData, brightness)); | 226 | set_attrib_pointer(attr_brightness_, 1, offsetof(PerVertexData, brightness)); |
348 | 232 | set_attrib_pointer(attr_texture_mix_, 1, offsetof(PerVertexData, texture_mix)); | ||
349 | 233 | 227 | ||
350 | 234 | glBindBuffer(GL_ARRAY_BUFFER, 0); | 228 | glBindBuffer(GL_ARRAY_BUFFER, 0); |
351 | 235 | 229 | ||
352 | 236 | // Bind the textures. | 230 | // Bind the textures. |
353 | 237 | glActiveTexture(GL_TEXTURE0); | 231 | glActiveTexture(GL_TEXTURE0); |
356 | 238 | glBindTexture(GL_TEXTURE_2D, normal_road_texture_->get_gl_texture()); | 232 | glBindTexture(GL_TEXTURE_2D, gl_texture); |
355 | 239 | glUniform1i(u_normal_road_texture_, 0); | ||
357 | 240 | 233 | ||
361 | 241 | glActiveTexture(GL_TEXTURE1); | 234 | glUniform1i(u_texture_, 0); |
359 | 242 | glBindTexture(GL_TEXTURE_2D, busy_road_texture_->get_gl_texture()); | ||
360 | 243 | glUniform1i(u_busy_road_texture_, 1); | ||
362 | 244 | 235 | ||
363 | 245 | glDrawArrays(GL_TRIANGLES, 0, vertices_.size()); | 236 | glDrawArrays(GL_TRIANGLES, 0, vertices_.size()); |
364 | 246 | 237 | ||
365 | 247 | glDisableVertexAttribArray(attr_position_); | 238 | glDisableVertexAttribArray(attr_position_); |
366 | 248 | glDisableVertexAttribArray(attr_texture_position_); | 239 | glDisableVertexAttribArray(attr_texture_position_); |
367 | 249 | glDisableVertexAttribArray(attr_brightness_); | 240 | glDisableVertexAttribArray(attr_brightness_); |
368 | 250 | glDisableVertexAttribArray(attr_texture_mix_); | ||
369 | 251 | |||
370 | 252 | glActiveTexture(GL_TEXTURE0); | ||
371 | 253 | } | 241 | } |
372 | 254 | 242 | ||
373 | === modified file 'src/graphic/gl/road_program.h' | |||
374 | --- src/graphic/gl/road_program.h 2014-11-24 07:10:03 +0000 | |||
375 | +++ src/graphic/gl/road_program.h 2015-02-09 05:57:46 +0000 | |||
376 | @@ -48,21 +48,18 @@ | |||
377 | 48 | float texture_x; | 48 | float texture_x; |
378 | 49 | float texture_y; | 49 | float texture_y; |
379 | 50 | float brightness; | 50 | float brightness; |
380 | 51 | |||
381 | 52 | // This is a hack: we want to draw busy and normal roads in the same | ||
382 | 53 | // run, but since samplers (apparently?) cannot be passed through | ||
383 | 54 | // attribute arrays, we instead sample twice (busy and normal) and mix | ||
384 | 55 | // them together with 'texture_mix' which is either 1 or 0. | ||
385 | 56 | float texture_mix; | ||
386 | 57 | }; | 51 | }; |
388 | 58 | static_assert(sizeof(PerVertexData) == 24, "Wrong padding."); | 52 | static_assert(sizeof(PerVertexData) == 20, "Wrong padding."); |
389 | 59 | 53 | ||
390 | 60 | // Adds a road from 'start' to 'end' to be rendered in this frame using the | 54 | // Adds a road from 'start' to 'end' to be rendered in this frame using the |
391 | 61 | // correct texture for 'road_type'. | 55 | // correct texture for 'road_type'. |
392 | 56 | enum Direction {kEast, kSouthEast, kSouthWest}; | ||
393 | 62 | void add_road(const Surface& surface, | 57 | void add_road(const Surface& surface, |
394 | 63 | const FieldsToDraw::Field& start, | 58 | const FieldsToDraw::Field& start, |
395 | 64 | const FieldsToDraw::Field& end, | 59 | const FieldsToDraw::Field& end, |
397 | 65 | const Widelands::RoadType road_type); | 60 | const Widelands::RoadType road_type, |
398 | 61 | const Direction direction, | ||
399 | 62 | int* gl_texture); | ||
400 | 66 | 63 | ||
401 | 67 | // The buffer that will contain 'vertices_' for rendering. | 64 | // The buffer that will contain 'vertices_' for rendering. |
402 | 68 | Gl::Buffer gl_array_buffer_; | 65 | Gl::Buffer gl_array_buffer_; |
403 | @@ -74,19 +71,13 @@ | |||
404 | 74 | GLint attr_position_; | 71 | GLint attr_position_; |
405 | 75 | GLint attr_texture_position_; | 72 | GLint attr_texture_position_; |
406 | 76 | GLint attr_brightness_; | 73 | GLint attr_brightness_; |
407 | 77 | GLint attr_texture_mix_; | ||
408 | 78 | 74 | ||
409 | 79 | // Uniforms. | 75 | // Uniforms. |
412 | 80 | GLint u_normal_road_texture_; | 76 | GLint u_texture_; |
411 | 81 | GLint u_busy_road_texture_; | ||
413 | 82 | 77 | ||
414 | 83 | // All vertices that get rendered this frame. | 78 | // All vertices that get rendered this frame. |
415 | 84 | std::vector<PerVertexData> vertices_; | 79 | std::vector<PerVertexData> vertices_; |
416 | 85 | 80 | ||
417 | 86 | // The road textures. | ||
418 | 87 | std::unique_ptr<Texture> normal_road_texture_; | ||
419 | 88 | std::unique_ptr<Texture> busy_road_texture_; | ||
420 | 89 | |||
421 | 90 | DISALLOW_COPY_AND_ASSIGN(RoadProgram); | 81 | DISALLOW_COPY_AND_ASSIGN(RoadProgram); |
422 | 91 | }; | 82 | }; |
423 | 92 | 83 | ||
424 | 93 | 84 | ||
425 | === modified file 'src/logic/CMakeLists.txt' | |||
426 | --- src/logic/CMakeLists.txt 2015-01-31 16:03:59 +0000 | |||
427 | +++ src/logic/CMakeLists.txt 2015-02-09 05:57:46 +0000 | |||
428 | @@ -167,6 +167,8 @@ | |||
429 | 167 | replay.h | 167 | replay.h |
430 | 168 | requirements.cc | 168 | requirements.cc |
431 | 169 | requirements.h | 169 | requirements.h |
432 | 170 | road_textures.cc | ||
433 | 171 | road_textures.h | ||
434 | 170 | roadtype.h | 172 | roadtype.h |
435 | 171 | save_handler.cc | 173 | save_handler.cc |
436 | 172 | save_handler.h | 174 | save_handler.h |
437 | 173 | 175 | ||
438 | === modified file 'src/logic/bob.h' | |||
439 | --- src/logic/bob.h 2014-09-19 12:54:54 +0000 | |||
440 | +++ src/logic/bob.h 2015-02-09 05:57:46 +0000 | |||
441 | @@ -35,7 +35,7 @@ | |||
442 | 35 | class Map; | 35 | class Map; |
443 | 36 | struct Route; | 36 | struct Route; |
444 | 37 | struct Transfer; | 37 | struct Transfer; |
446 | 38 | struct TribeDescr; | 38 | class TribeDescr; |
447 | 39 | 39 | ||
448 | 40 | 40 | ||
449 | 41 | /** | 41 | /** |
450 | 42 | 42 | ||
451 | === modified file 'src/logic/buildcost.h' | |||
452 | --- src/logic/buildcost.h 2014-09-10 10:18:46 +0000 | |||
453 | +++ src/logic/buildcost.h 2015-02-09 05:57:46 +0000 | |||
454 | @@ -30,7 +30,7 @@ | |||
455 | 30 | 30 | ||
456 | 31 | namespace Widelands { | 31 | namespace Widelands { |
457 | 32 | 32 | ||
459 | 33 | struct TribeDescr; | 33 | class TribeDescr; |
460 | 34 | 34 | ||
461 | 35 | struct Buildcost : std::map<WareIndex, uint8_t> { | 35 | struct Buildcost : std::map<WareIndex, uint8_t> { |
462 | 36 | void parse(const TribeDescr & tribe, Section & buildcost_s); | 36 | void parse(const TribeDescr & tribe, Section & buildcost_s); |
463 | 37 | 37 | ||
464 | === modified file 'src/logic/building.h' | |||
465 | --- src/logic/building.h 2014-09-29 12:37:07 +0000 | |||
466 | +++ src/logic/building.h 2015-02-09 05:57:46 +0000 | |||
467 | @@ -47,7 +47,7 @@ | |||
468 | 47 | 47 | ||
469 | 48 | struct Flag; | 48 | struct Flag; |
470 | 49 | struct Message; | 49 | struct Message; |
472 | 50 | struct TribeDescr; | 50 | class TribeDescr; |
473 | 51 | class WaresQueue; | 51 | class WaresQueue; |
474 | 52 | 52 | ||
475 | 53 | class Building; | 53 | class Building; |
476 | 54 | 54 | ||
477 | === modified file 'src/logic/editor_game_base.cc' | |||
478 | --- src/logic/editor_game_base.cc 2015-01-31 16:03:59 +0000 | |||
479 | +++ src/logic/editor_game_base.cc 2015-02-09 05:57:46 +0000 | |||
480 | @@ -32,6 +32,9 @@ | |||
481 | 32 | #include "graphic/color.h" | 32 | #include "graphic/color.h" |
482 | 33 | #include "graphic/font_handler.h" | 33 | #include "graphic/font_handler.h" |
483 | 34 | #include "graphic/graphic.h" | 34 | #include "graphic/graphic.h" |
484 | 35 | #include "graphic/image_io.h" | ||
485 | 36 | #include "graphic/texture_atlas.h" | ||
486 | 37 | #include "io/filesystem/layered_filesystem.h" | ||
487 | 35 | #include "logic/battle.h" | 38 | #include "logic/battle.h" |
488 | 36 | #include "logic/building.h" | 39 | #include "logic/building.h" |
489 | 37 | #include "logic/constants.h" | 40 | #include "logic/constants.h" |
490 | @@ -282,7 +285,34 @@ | |||
491 | 282 | tribe_descr->load_graphics(); | 285 | tribe_descr->load_graphics(); |
492 | 283 | } | 286 | } |
493 | 284 | 287 | ||
495 | 285 | // TODO(unknown): load player graphics? (maybe) | 288 | // Construct and hold on to the texture atlas that contains all road images. |
496 | 289 | TextureAtlas ta; | ||
497 | 290 | |||
498 | 291 | // These will be deleted at the end of the method. | ||
499 | 292 | std::vector<std::unique_ptr<Texture>> individual_textures_; | ||
500 | 293 | for (auto* tribe : tribes_) { | ||
501 | 294 | for (const std::string& texture_path : tribe->normal_road_paths()) { | ||
502 | 295 | individual_textures_.emplace_back(load_image(texture_path, g_fs)); | ||
503 | 296 | ta.add(*individual_textures_.back()); | ||
504 | 297 | } | ||
505 | 298 | for (const std::string& texture_path : tribe->busy_road_paths()) { | ||
506 | 299 | individual_textures_.emplace_back(load_image(texture_path, g_fs)); | ||
507 | 300 | ta.add(*individual_textures_.back()); | ||
508 | 301 | } | ||
509 | 302 | } | ||
510 | 303 | |||
511 | 304 | std::vector<std::unique_ptr<Texture>> textures; | ||
512 | 305 | road_texture_ = ta.pack(&textures); | ||
513 | 306 | |||
514 | 307 | size_t next_texture_to_move = 0; | ||
515 | 308 | for (auto* tribe : tribes_) { | ||
516 | 309 | for (size_t i = 0; i < tribe->normal_road_paths().size(); ++i) { | ||
517 | 310 | tribe->add_normal_road_texture(std::move(textures.at(next_texture_to_move++))); | ||
518 | 311 | } | ||
519 | 312 | for (size_t i = 0; i < tribe->busy_road_paths().size(); ++i) { | ||
520 | 313 | tribe->add_busy_road_texture(std::move(textures.at(next_texture_to_move++))); | ||
521 | 314 | } | ||
522 | 315 | } | ||
523 | 286 | } | 316 | } |
524 | 287 | 317 | ||
525 | 288 | /** | 318 | /** |
526 | @@ -516,12 +546,12 @@ | |||
527 | 516 | assert(&first_field <= f.field); | 546 | assert(&first_field <= f.field); |
528 | 517 | assert (f.field < &first_field + m.max_index()); | 547 | assert (f.field < &first_field + m.max_index()); |
529 | 518 | assert | 548 | assert |
533 | 519 | (direction == Road_SouthWest || | 549 | (direction == RoadType::kSouthWest || |
534 | 520 | direction == Road_SouthEast || | 550 | direction == RoadType::kSouthEast || |
535 | 521 | direction == Road_East); | 551 | direction == RoadType::kEast); |
536 | 522 | assert | 552 | assert |
539 | 523 | (roadtype == Road_None || roadtype == Road_Normal || | 553 | (roadtype == RoadType::kNone || roadtype == RoadType::kNormal || |
540 | 524 | roadtype == Road_Busy || roadtype == Road_Water); | 554 | roadtype == RoadType::kBusy || roadtype == RoadType::kWater); |
541 | 525 | 555 | ||
542 | 526 | if (f.field->get_road(direction) == roadtype) | 556 | if (f.field->get_road(direction) == roadtype) |
543 | 527 | return; | 557 | return; |
544 | @@ -530,17 +560,17 @@ | |||
545 | 530 | FCoords neighbour; | 560 | FCoords neighbour; |
546 | 531 | uint8_t mask = 0; | 561 | uint8_t mask = 0; |
547 | 532 | switch (direction) { | 562 | switch (direction) { |
549 | 533 | case Road_SouthWest: | 563 | case RoadType::kSouthWest: |
550 | 534 | neighbour = m.bl_n(f); | 564 | neighbour = m.bl_n(f); |
552 | 535 | mask = Road_Mask << Road_SouthWest; | 565 | mask = RoadType::kMask << RoadType::kSouthWest; |
553 | 536 | break; | 566 | break; |
555 | 537 | case Road_SouthEast: | 567 | case RoadType::kSouthEast: |
556 | 538 | neighbour = m.br_n(f); | 568 | neighbour = m.br_n(f); |
558 | 539 | mask = Road_Mask << Road_SouthEast; | 569 | mask = RoadType::kMask << RoadType::kSouthEast; |
559 | 540 | break; | 570 | break; |
561 | 541 | case Road_East: | 571 | case RoadType::kEast: |
562 | 542 | neighbour = m. r_n(f); | 572 | neighbour = m. r_n(f); |
564 | 543 | mask = Road_Mask << Road_East; | 573 | mask = RoadType::kMask << RoadType::kEast; |
565 | 544 | break; | 574 | break; |
566 | 545 | default: | 575 | default: |
567 | 546 | assert(false); | 576 | assert(false); |
568 | 547 | 577 | ||
569 | === modified file 'src/logic/editor_game_base.h' | |||
570 | --- src/logic/editor_game_base.h 2015-01-31 16:03:59 +0000 | |||
571 | +++ src/logic/editor_game_base.h 2015-02-09 05:57:46 +0000 | |||
572 | @@ -26,6 +26,7 @@ | |||
573 | 26 | #include <vector> | 26 | #include <vector> |
574 | 27 | 27 | ||
575 | 28 | #include "base/macros.h" | 28 | #include "base/macros.h" |
576 | 29 | #include "graphic/texture.h" | ||
577 | 29 | #include "logic/bob.h" | 30 | #include "logic/bob.h" |
578 | 30 | #include "logic/building.h" | 31 | #include "logic/building.h" |
579 | 31 | #include "logic/map.h" | 32 | #include "logic/map.h" |
580 | @@ -49,7 +50,7 @@ | |||
581 | 49 | struct ObjectManager; | 50 | struct ObjectManager; |
582 | 50 | class Player; | 51 | class Player; |
583 | 51 | struct PlayerImmovable; | 52 | struct PlayerImmovable; |
585 | 52 | struct TribeDescr; | 53 | class TribeDescr; |
586 | 53 | struct Flag; | 54 | struct Flag; |
587 | 54 | struct AttackController; | 55 | struct AttackController; |
588 | 55 | 56 | ||
589 | @@ -262,9 +263,10 @@ | |||
590 | 262 | uint32_t lasttrackserial_; | 263 | uint32_t lasttrackserial_; |
591 | 263 | std::map<uint32_t, void*> trackpointers_; | 264 | std::map<uint32_t, void*> trackpointers_; |
592 | 264 | 265 | ||
593 | 266 | std::unique_ptr<Texture> road_texture_; | ||
594 | 265 | 267 | ||
597 | 266 | DISALLOW_COPY_AND_ASSIGN(EditorGameBase); | 268 | DISALLOW_COPY_AND_ASSIGN(EditorGameBase); |
598 | 267 | }; | 269 | }; |
599 | 268 | 270 | ||
600 | 269 | #define iterate_players_existing(p, nr_players, egbase, player) \ | 271 | #define iterate_players_existing(p, nr_players, egbase, player) \ |
601 | 270 | iterate_player_numbers( \ | 272 | iterate_player_numbers( \ |
602 | 271 | 273 | ||
603 | === modified file 'src/logic/field.h' | |||
604 | --- src/logic/field.h 2014-12-01 21:47:22 +0000 | |||
605 | +++ src/logic/field.h 2015-02-09 05:57:46 +0000 | |||
606 | @@ -198,10 +198,10 @@ | |||
607 | 198 | 198 | ||
608 | 199 | int32_t get_roads() const {return roads;} | 199 | int32_t get_roads() const {return roads;} |
609 | 200 | int32_t get_road(int32_t const dir) const { | 200 | int32_t get_road(int32_t const dir) const { |
611 | 201 | return (roads >> dir) & Road_Mask; | 201 | return (roads >> dir) & RoadType::kMask; |
612 | 202 | } | 202 | } |
613 | 203 | void set_road(int32_t const dir, int32_t const type) { | 203 | void set_road(int32_t const dir, int32_t const type) { |
615 | 204 | roads &= ~(Road_Mask << dir); | 204 | roads &= ~(RoadType::kMask << dir); |
616 | 205 | roads |= type << dir; | 205 | roads |= type << dir; |
617 | 206 | } | 206 | } |
618 | 207 | 207 | ||
619 | 208 | 208 | ||
620 | === modified file 'src/logic/immovable.h' | |||
621 | --- src/logic/immovable.h 2014-09-14 11:31:58 +0000 | |||
622 | +++ src/logic/immovable.h 2015-02-09 05:57:46 +0000 | |||
623 | @@ -44,7 +44,7 @@ | |||
624 | 44 | class World; | 44 | class World; |
625 | 45 | struct Flag; | 45 | struct Flag; |
626 | 46 | struct PlayerImmovable; | 46 | struct PlayerImmovable; |
628 | 47 | struct TribeDescr; | 47 | class TribeDescr; |
629 | 48 | 48 | ||
630 | 49 | struct NoteImmovable { | 49 | struct NoteImmovable { |
631 | 50 | CAN_BE_SEND_AS_NOTE(NoteId::Immovable) | 50 | CAN_BE_SEND_AS_NOTE(NoteId::Immovable) |
632 | 51 | 51 | ||
633 | === modified file 'src/logic/player.cc' | |||
634 | --- src/logic/player.cc 2015-01-31 16:03:59 +0000 | |||
635 | +++ src/logic/player.cc 2015-02-09 05:57:46 +0000 | |||
636 | @@ -1054,8 +1054,8 @@ | |||
637 | 1054 | Field & tr_field = m_fields[tr.field - &first_map_field]; | 1054 | Field & tr_field = m_fields[tr.field - &first_map_field]; |
638 | 1055 | if (tr_field.vision <= 1) { | 1055 | if (tr_field.vision <= 1) { |
639 | 1056 | tr_field.terrains.d = tr.field->terrain_d(); | 1056 | tr_field.terrains.d = tr.field->terrain_d(); |
642 | 1057 | tr_field.roads &= ~(Road_Mask << Road_SouthWest); | 1057 | tr_field.roads &= ~(RoadType::kMask << RoadType::kSouthWest); |
643 | 1058 | tr_field.roads |= Road_Mask << Road_SouthWest & tr.field->get_roads(); | 1058 | tr_field.roads |= RoadType::kMask << RoadType::kSouthWest & tr.field->get_roads(); |
644 | 1059 | } | 1059 | } |
645 | 1060 | } | 1060 | } |
646 | 1061 | { // discover both triangles and the SE edge of the top left neighbour | 1061 | { // discover both triangles and the SE edge of the top left neighbour |
647 | @@ -1063,8 +1063,8 @@ | |||
648 | 1063 | Field & tl_field = m_fields[tl.field - &first_map_field]; | 1063 | Field & tl_field = m_fields[tl.field - &first_map_field]; |
649 | 1064 | if (tl_field.vision <= 1) { | 1064 | if (tl_field.vision <= 1) { |
650 | 1065 | tl_field.terrains = tl.field->get_terrains(); | 1065 | tl_field.terrains = tl.field->get_terrains(); |
653 | 1066 | tl_field.roads &= ~(Road_Mask << Road_SouthEast); | 1066 | tl_field.roads &= ~(RoadType::kMask << RoadType::kSouthEast); |
654 | 1067 | tl_field.roads |= Road_Mask << Road_SouthEast & tl.field->get_roads(); | 1067 | tl_field.roads |= RoadType::kMask << RoadType::kSouthEast & tl.field->get_roads(); |
655 | 1068 | } | 1068 | } |
656 | 1069 | } | 1069 | } |
657 | 1070 | { // discover the R triangle and the E edge of the left neighbour | 1070 | { // discover the R triangle and the E edge of the left neighbour |
658 | @@ -1072,8 +1072,8 @@ | |||
659 | 1072 | Field & l_field = m_fields[l.field - &first_map_field]; | 1072 | Field & l_field = m_fields[l.field - &first_map_field]; |
660 | 1073 | if (l_field.vision <= 1) { | 1073 | if (l_field.vision <= 1) { |
661 | 1074 | l_field.terrains.r = l.field->terrain_r(); | 1074 | l_field.terrains.r = l.field->terrain_r(); |
664 | 1075 | l_field.roads &= ~(Road_Mask << Road_East); | 1075 | l_field.roads &= ~(RoadType::kMask << RoadType::kEast); |
665 | 1076 | l_field.roads |= Road_Mask << Road_East & l.field->get_roads(); | 1076 | l_field.roads |= RoadType::kMask << RoadType::kEast & l.field->get_roads(); |
666 | 1077 | } | 1077 | } |
667 | 1078 | } | 1078 | } |
668 | 1079 | } | 1079 | } |
669 | 1080 | 1080 | ||
670 | === modified file 'src/logic/player.h' | |||
671 | --- src/logic/player.h 2014-12-28 16:45:37 +0000 | |||
672 | +++ src/logic/player.h 2015-02-09 05:57:46 +0000 | |||
673 | @@ -42,7 +42,7 @@ | |||
674 | 42 | class Soldier; | 42 | class Soldier; |
675 | 43 | class TrainingSite; | 43 | class TrainingSite; |
676 | 44 | struct Flag; | 44 | struct Flag; |
678 | 45 | struct TribeDescr; | 45 | class TribeDescr; |
679 | 46 | struct Road; | 46 | struct Road; |
680 | 47 | struct AttackController; | 47 | struct AttackController; |
681 | 48 | 48 | ||
682 | @@ -246,14 +246,14 @@ | |||
683 | 246 | /// east, as far as this player knows. | 246 | /// east, as far as this player knows. |
684 | 247 | /// Only valid when this player has seen this node or the node to the | 247 | /// Only valid when this player has seen this node or the node to the |
685 | 248 | /// east. | 248 | /// east. |
687 | 249 | uint8_t road_e() const {return roads & Road_Mask;} | 249 | uint8_t road_e() const {return roads & RoadType::kMask;} |
688 | 250 | 250 | ||
689 | 251 | /// Whether there is a road between this node and the node to the | 251 | /// Whether there is a road between this node and the node to the |
690 | 252 | /// southeast, as far as this player knows. | 252 | /// southeast, as far as this player knows. |
691 | 253 | /// Only valid when this player has seen this node or the node to the | 253 | /// Only valid when this player has seen this node or the node to the |
692 | 254 | /// southeast. | 254 | /// southeast. |
693 | 255 | uint8_t road_se() const { | 255 | uint8_t road_se() const { |
695 | 256 | return roads >> Road_SouthEast & Road_Mask; | 256 | return roads >> RoadType::kSouthEast & RoadType::kMask; |
696 | 257 | } | 257 | } |
697 | 258 | 258 | ||
698 | 259 | /// Whether there is a road between this node and the node to the | 259 | /// Whether there is a road between this node and the node to the |
699 | @@ -261,7 +261,7 @@ | |||
700 | 261 | /// Only valid when this player has seen this node or the node to the | 261 | /// Only valid when this player has seen this node or the node to the |
701 | 262 | /// southwest. | 262 | /// southwest. |
702 | 263 | uint8_t road_sw() const { | 263 | uint8_t road_sw() const { |
704 | 264 | return roads >> Road_SouthWest & Road_Mask; | 264 | return roads >> RoadType::kSouthWest & RoadType::kMask; |
705 | 265 | } | 265 | } |
706 | 266 | 266 | ||
707 | 267 | /** | 267 | /** |
708 | 268 | 268 | ||
709 | === modified file 'src/logic/production_program.h' | |||
710 | --- src/logic/production_program.h 2014-11-28 16:40:55 +0000 | |||
711 | +++ src/logic/production_program.h 2015-02-09 05:57:46 +0000 | |||
712 | @@ -43,7 +43,7 @@ | |||
713 | 43 | struct ImmovableDescr; | 43 | struct ImmovableDescr; |
714 | 44 | struct ProductionSiteDescr; | 44 | struct ProductionSiteDescr; |
715 | 45 | class ProductionSite; | 45 | class ProductionSite; |
717 | 46 | struct TribeDescr; | 46 | class TribeDescr; |
718 | 47 | class Worker; | 47 | class Worker; |
719 | 48 | class World; | 48 | class World; |
720 | 49 | 49 | ||
721 | 50 | 50 | ||
722 | === added file 'src/logic/road_textures.cc' | |||
723 | --- src/logic/road_textures.cc 1970-01-01 00:00:00 +0000 | |||
724 | +++ src/logic/road_textures.cc 2015-02-09 05:57:46 +0000 | |||
725 | @@ -0,0 +1,38 @@ | |||
726 | 1 | /* | ||
727 | 2 | * Copyright (C) 2006-2015 by the Widelands Development Team | ||
728 | 3 | * | ||
729 | 4 | * This program is free software; you can redistribute it and/or | ||
730 | 5 | * modify it under the terms of the GNU General Public License | ||
731 | 6 | * as published by the Free Software Foundation; either version 2 | ||
732 | 7 | * of the License, or (at your option) any later version. | ||
733 | 8 | * | ||
734 | 9 | * This program is distributed in the hope that it will be useful, | ||
735 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
736 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
737 | 12 | * GNU General Public License for more details. | ||
738 | 13 | * | ||
739 | 14 | * You should have received a copy of the GNU General Public License | ||
740 | 15 | * along with this program; if not, write to the Free Software | ||
741 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
742 | 17 | * | ||
743 | 18 | */ | ||
744 | 19 | |||
745 | 20 | #include "logic/road_textures.h" | ||
746 | 21 | |||
747 | 22 | #include <memory> | ||
748 | 23 | |||
749 | 24 | const Texture& RoadTextures::get_normal_texture(int x, int y, int direction) const { | ||
750 | 25 | return *normal_textures_.at((x + y + direction) % normal_textures_.size()); | ||
751 | 26 | } | ||
752 | 27 | |||
753 | 28 | const Texture& RoadTextures::get_busy_texture(int x, int y, int direction) const { | ||
754 | 29 | return *busy_textures_.at((x + y + direction) % busy_textures_.size()); | ||
755 | 30 | } | ||
756 | 31 | |||
757 | 32 | void RoadTextures::add_normal_road_texture(std::unique_ptr<Texture> texture) { | ||
758 | 33 | normal_textures_.emplace_back(std::move(texture)); | ||
759 | 34 | } | ||
760 | 35 | |||
761 | 36 | void RoadTextures::add_busy_road_texture(std::unique_ptr<Texture> texture) { | ||
762 | 37 | busy_textures_.emplace_back(std::move(texture)); | ||
763 | 38 | } | ||
764 | 0 | 39 | ||
765 | === added file 'src/logic/road_textures.h' | |||
766 | --- src/logic/road_textures.h 1970-01-01 00:00:00 +0000 | |||
767 | +++ src/logic/road_textures.h 2015-02-09 05:57:46 +0000 | |||
768 | @@ -0,0 +1,45 @@ | |||
769 | 1 | /* | ||
770 | 2 | * Copyright (C) 2006-2015 by the Widelands Development Team | ||
771 | 3 | * | ||
772 | 4 | * This program is free software; you can redistribute it and/or | ||
773 | 5 | * modify it under the terms of the GNU General Public License | ||
774 | 6 | * as published by the Free Software Foundation; either version 2 | ||
775 | 7 | * of the License, or (at your option) any later version. | ||
776 | 8 | * | ||
777 | 9 | * This program is distributed in the hope that it will be useful, | ||
778 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
779 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
780 | 12 | * GNU General Public License for more details. | ||
781 | 13 | * | ||
782 | 14 | * You should have received a copy of the GNU General Public License | ||
783 | 15 | * along with this program; if not, write to the Free Software | ||
784 | 16 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
785 | 17 | * | ||
786 | 18 | */ | ||
787 | 19 | |||
788 | 20 | #ifndef WL_LOGIC_ROAD_TEXTURES_H | ||
789 | 21 | #define WL_LOGIC_ROAD_TEXTURES_H | ||
790 | 22 | |||
791 | 23 | #include <memory> | ||
792 | 24 | #include <vector> | ||
793 | 25 | |||
794 | 26 | #include "graphic/texture.h" | ||
795 | 27 | |||
796 | 28 | // Simple container to give access of the road textures of a tribe. | ||
797 | 29 | class RoadTextures { | ||
798 | 30 | public: | ||
799 | 31 | // Returns the road texture that should be used for the Cooordinate x, y and | ||
800 | 32 | // the road going into direction 'direction' (which can be any number). | ||
801 | 33 | const Texture& get_normal_texture(int x, int y, int direction) const; | ||
802 | 34 | const Texture& get_busy_texture(int x, int y, int direction) const; | ||
803 | 35 | |||
804 | 36 | // Adds a new road texture. | ||
805 | 37 | void add_normal_road_texture(std::unique_ptr<Texture> texture); | ||
806 | 38 | void add_busy_road_texture(std::unique_ptr<Texture> texture); | ||
807 | 39 | |||
808 | 40 | private: | ||
809 | 41 | std::vector<std::unique_ptr<Texture>> normal_textures_; | ||
810 | 42 | std::vector<std::unique_ptr<Texture>> busy_textures_; | ||
811 | 43 | }; | ||
812 | 44 | |||
813 | 45 | #endif // end of include guard: WL_LOGIC_ROAD_TEXTURES_H | ||
814 | 0 | 46 | ||
815 | === modified file 'src/logic/roadtype.h' | |||
816 | --- src/logic/roadtype.h 2014-11-01 20:40:39 +0000 | |||
817 | +++ src/logic/roadtype.h 2015-02-09 05:57:46 +0000 | |||
818 | @@ -30,15 +30,15 @@ | |||
819 | 30 | // the drawing code to keep around what kind of road it should draw. I guess | 30 | // the drawing code to keep around what kind of road it should draw. I guess |
820 | 31 | // that is the reason why it was combined in the first place. Still it is ugly. | 31 | // that is the reason why it was combined in the first place. Still it is ugly. |
821 | 32 | enum RoadType { | 32 | enum RoadType { |
827 | 33 | Road_None = 0, | 33 | kNone = 0, |
828 | 34 | Road_Normal = 1, | 34 | kNormal = 1, |
829 | 35 | Road_Busy = 2, | 35 | kBusy = 2, |
830 | 36 | Road_Water = 3, | 36 | kWater = 3, |
831 | 37 | Road_Mask = 3, | 37 | kMask = 3, |
832 | 38 | 38 | ||
836 | 39 | Road_East = 0, // shift values | 39 | kEast = 0, // shift values |
837 | 40 | Road_SouthEast = 2, | 40 | kSouthEast = 2, |
838 | 41 | Road_SouthWest = 4, | 41 | kSouthWest = 4, |
839 | 42 | }; | 42 | }; |
840 | 43 | 43 | ||
841 | 44 | } | 44 | } |
842 | 45 | 45 | ||
843 | === modified file 'src/logic/tribe.cc' | |||
844 | --- src/logic/tribe.cc 2015-01-31 16:03:59 +0000 | |||
845 | +++ src/logic/tribe.cc 2015-02-09 05:57:46 +0000 | |||
846 | @@ -28,10 +28,12 @@ | |||
847 | 28 | 28 | ||
848 | 29 | #include "base/i18n.h" | 29 | #include "base/i18n.h" |
849 | 30 | #include "base/macros.h" | 30 | #include "base/macros.h" |
850 | 31 | #include "base/wexception.h" | ||
851 | 31 | #include "graphic/graphic.h" | 32 | #include "graphic/graphic.h" |
852 | 32 | #include "helper.h" | 33 | #include "helper.h" |
853 | 33 | #include "io/fileread.h" | 34 | #include "io/fileread.h" |
854 | 34 | #include "io/filesystem/disk_filesystem.h" | 35 | #include "io/filesystem/disk_filesystem.h" |
855 | 36 | #include "io/filesystem/filesystem.h" | ||
856 | 35 | #include "io/filesystem/layered_filesystem.h" | 37 | #include "io/filesystem/layered_filesystem.h" |
857 | 36 | #include "logic/carrier.h" | 38 | #include "logic/carrier.h" |
858 | 37 | #include "logic/constructionsite.h" | 39 | #include "logic/constructionsite.h" |
859 | @@ -235,6 +237,33 @@ | |||
860 | 235 | PARSE_ORDER_INFORMATION(worker); | 237 | PARSE_ORDER_INFORMATION(worker); |
861 | 236 | } | 238 | } |
862 | 237 | 239 | ||
863 | 240 | { | ||
864 | 241 | Section road_s = root_conf.get_safe_section("roads"); | ||
865 | 242 | const auto load_roads = [&road_s, this]( | ||
866 | 243 | const std::string& prefix, std::vector<std::string>* images) { | ||
867 | 244 | for (int i = 0; i < 99; ++i) { | ||
868 | 245 | const char* img = | ||
869 | 246 | road_s.get_string((boost::format("%s_%02i") % prefix % i).str().c_str(), nullptr); | ||
870 | 247 | if (img == nullptr) { | ||
871 | 248 | break; | ||
872 | 249 | } | ||
873 | 250 | if (!g_fs->file_exists(img)) { | ||
874 | 251 | throw new GameDataError("File %s for roadtype %s in tribe %s does not exist", | ||
875 | 252 | img, | ||
876 | 253 | prefix.c_str(), | ||
877 | 254 | m_name.c_str()); | ||
878 | 255 | } | ||
879 | 256 | images->emplace_back(img); | ||
880 | 257 | } | ||
881 | 258 | if (images->empty()) { | ||
882 | 259 | throw new GameDataError( | ||
883 | 260 | "No %s roads defined in tribe %s.", prefix.c_str(), m_name.c_str()); | ||
884 | 261 | } | ||
885 | 262 | }; | ||
886 | 263 | load_roads("normal", &m_normal_road_paths); | ||
887 | 264 | load_roads("busy", &m_busy_road_paths); | ||
888 | 265 | } | ||
889 | 266 | |||
890 | 238 | m_frontier_animation_id = | 267 | m_frontier_animation_id = |
891 | 239 | g_gr->animations().load(path, root_conf.get_safe_section("frontier")); | 268 | g_gr->animations().load(path, root_conf.get_safe_section("frontier")); |
892 | 240 | m_flag_animation_id = | 269 | m_flag_animation_id = |
893 | @@ -292,6 +321,27 @@ | |||
894 | 292 | m_buildings.get(i)->load_graphics(); | 321 | m_buildings.get(i)->load_graphics(); |
895 | 293 | } | 322 | } |
896 | 294 | 323 | ||
897 | 324 | const std::vector<std::string>& TribeDescr::normal_road_paths() const { | ||
898 | 325 | return m_normal_road_paths; | ||
899 | 326 | } | ||
900 | 327 | |||
901 | 328 | const std::vector<std::string>& TribeDescr::busy_road_paths() const { | ||
902 | 329 | return m_busy_road_paths; | ||
903 | 330 | } | ||
904 | 331 | |||
905 | 332 | |||
906 | 333 | void TribeDescr::add_normal_road_texture(std::unique_ptr<Texture> texture) { | ||
907 | 334 | m_road_textures.add_normal_road_texture(std::move(texture)); | ||
908 | 335 | } | ||
909 | 336 | |||
910 | 337 | void TribeDescr::add_busy_road_texture(std::unique_ptr<Texture> texture) { | ||
911 | 338 | m_road_textures.add_busy_road_texture(std::move(texture)); | ||
912 | 339 | } | ||
913 | 340 | |||
914 | 341 | const RoadTextures& TribeDescr::road_textures() const { | ||
915 | 342 | return m_road_textures; | ||
916 | 343 | } | ||
917 | 344 | |||
918 | 295 | 345 | ||
919 | 296 | /* | 346 | /* |
920 | 297 | * does this tribe exist? | 347 | * does this tribe exist? |
921 | 298 | 348 | ||
922 | === modified file 'src/logic/tribe.h' | |||
923 | --- src/logic/tribe.h 2014-09-14 11:31:58 +0000 | |||
924 | +++ src/logic/tribe.h 2015-02-09 05:57:46 +0000 | |||
925 | @@ -21,14 +21,18 @@ | |||
926 | 21 | #define WL_LOGIC_TRIBE_H | 21 | #define WL_LOGIC_TRIBE_H |
927 | 22 | 22 | ||
928 | 23 | #include <map> | 23 | #include <map> |
929 | 24 | #include <memory> | ||
930 | 24 | #include <vector> | 25 | #include <vector> |
931 | 25 | 26 | ||
932 | 26 | #include "base/macros.h" | 27 | #include "base/macros.h" |
933 | 27 | #include "graphic/animation.h" | 28 | #include "graphic/animation.h" |
934 | 29 | #include "graphic/texture.h" | ||
935 | 28 | #include "logic/bob.h" | 30 | #include "logic/bob.h" |
936 | 29 | #include "logic/building.h" | 31 | #include "logic/building.h" |
937 | 30 | #include "logic/description_maintainer.h" | 32 | #include "logic/description_maintainer.h" |
938 | 31 | #include "logic/immovable.h" | 33 | #include "logic/immovable.h" |
939 | 34 | #include "logic/road_textures.h" | ||
940 | 35 | #include "logic/roadtype.h" | ||
941 | 32 | #include "logic/tribe_basic_info.h" | 36 | #include "logic/tribe_basic_info.h" |
942 | 33 | #include "logic/ware_descr.h" | 37 | #include "logic/ware_descr.h" |
943 | 34 | #include "logic/worker.h" | 38 | #include "logic/worker.h" |
944 | @@ -52,7 +56,8 @@ | |||
945 | 52 | buildings it can build and the associated graphics. | 56 | buildings it can build and the associated graphics. |
946 | 53 | Two players can choose the same tribe. | 57 | Two players can choose the same tribe. |
947 | 54 | */ | 58 | */ |
949 | 55 | struct TribeDescr { | 59 | class TribeDescr { |
950 | 60 | public: | ||
951 | 56 | TribeDescr(const std::string & name, EditorGameBase &); | 61 | TribeDescr(const std::string & name, EditorGameBase &); |
952 | 57 | 62 | ||
953 | 58 | // Static function to check for tribes. | 63 | // Static function to check for tribes. |
954 | @@ -62,7 +67,20 @@ | |||
955 | 62 | static std::vector<TribeBasicInfo> get_all_tribe_infos(); | 67 | static std::vector<TribeBasicInfo> get_all_tribe_infos(); |
956 | 63 | 68 | ||
957 | 64 | 69 | ||
959 | 65 | const std::string & name() const {return m_name;} | 70 | const std::string& name() const {return m_name;} |
960 | 71 | |||
961 | 72 | // A vector of all texture images that can be used for drawing a | ||
962 | 73 | // (normal|busy) road. The images are guaranteed to exist. | ||
963 | 74 | const std::vector<std::string>& normal_road_paths() const; | ||
964 | 75 | const std::vector<std::string>& busy_road_paths() const; | ||
965 | 76 | |||
966 | 77 | // Add the corresponding texture (which probably resides in a | ||
967 | 78 | // texture atlas) for roads. | ||
968 | 79 | void add_normal_road_texture(std::unique_ptr<Texture> texture); | ||
969 | 80 | void add_busy_road_texture(std::unique_ptr<Texture> texture); | ||
970 | 81 | |||
971 | 82 | // The road textures used for drawing roads. | ||
972 | 83 | const RoadTextures& road_textures() const; | ||
973 | 66 | 84 | ||
974 | 67 | WareIndex get_nrworkers() const {return m_workers.get_nitems();} | 85 | WareIndex get_nrworkers() const {return m_workers.get_nitems();} |
975 | 68 | WorkerDescr const * get_worker_descr(const WareIndex& index) const { | 86 | WorkerDescr const * get_worker_descr(const WareIndex& index) const { |
976 | @@ -174,6 +192,11 @@ | |||
977 | 174 | 192 | ||
978 | 175 | private: | 193 | private: |
979 | 176 | const std::string m_name; | 194 | const std::string m_name; |
980 | 195 | |||
981 | 196 | std::vector<std::string> m_normal_road_paths; | ||
982 | 197 | std::vector<std::string> m_busy_road_paths; | ||
983 | 198 | RoadTextures m_road_textures; | ||
984 | 199 | |||
985 | 177 | uint32_t m_frontier_animation_id; | 200 | uint32_t m_frontier_animation_id; |
986 | 178 | uint32_t m_flag_animation_id; | 201 | uint32_t m_flag_animation_id; |
987 | 179 | uint32_t m_bob_vision_range; | 202 | uint32_t m_bob_vision_range; |
988 | 180 | 203 | ||
989 | === modified file 'src/logic/ware_descr.h' | |||
990 | --- src/logic/ware_descr.h 2014-09-10 08:55:04 +0000 | |||
991 | +++ src/logic/ware_descr.h 2015-02-09 05:57:46 +0000 | |||
992 | @@ -39,7 +39,7 @@ | |||
993 | 39 | 39 | ||
994 | 40 | namespace Widelands { | 40 | namespace Widelands { |
995 | 41 | 41 | ||
997 | 42 | struct TribeDescr; | 42 | class TribeDescr; |
998 | 43 | 43 | ||
999 | 44 | /** | 44 | /** |
1000 | 45 | * Wares can be stored in warehouses. They can be transferred across an | 45 | * Wares can be stored in warehouses. They can be transferred across an |
1001 | 46 | 46 | ||
1002 | === modified file 'src/logic/warehouse.h' | |||
1003 | --- src/logic/warehouse.h 2014-09-19 12:54:54 +0000 | |||
1004 | +++ src/logic/warehouse.h 2015-02-09 05:57:46 +0000 | |||
1005 | @@ -38,7 +38,7 @@ | |||
1006 | 38 | class Request; | 38 | class Request; |
1007 | 39 | struct Requirements; | 39 | struct Requirements; |
1008 | 40 | class Soldier; | 40 | class Soldier; |
1010 | 41 | struct TribeDescr; | 41 | class TribeDescr; |
1011 | 42 | class WareInstance; | 42 | class WareInstance; |
1012 | 43 | struct WareList; | 43 | struct WareList; |
1013 | 44 | 44 | ||
1014 | 45 | 45 | ||
1015 | === modified file 'src/logic/worker_descr.h' | |||
1016 | --- src/logic/worker_descr.h 2014-09-19 12:54:54 +0000 | |||
1017 | +++ src/logic/worker_descr.h 2015-02-09 05:57:46 +0000 | |||
1018 | @@ -37,7 +37,7 @@ | |||
1019 | 37 | 37 | ||
1020 | 38 | class WorkerDescr : public BobDescr | 38 | class WorkerDescr : public BobDescr |
1021 | 39 | { | 39 | { |
1023 | 40 | friend struct TribeDescr; | 40 | friend class TribeDescr; |
1024 | 41 | friend class Warehouse; | 41 | friend class Warehouse; |
1025 | 42 | friend struct WorkerProgram; | 42 | friend struct WorkerProgram; |
1026 | 43 | 43 | ||
1027 | 44 | 44 | ||
1028 | === modified file 'src/map_io/map_players_view_packet.cc' | |||
1029 | --- src/map_io/map_players_view_packet.cc 2014-10-27 10:14:10 +0000 | |||
1030 | +++ src/map_io/map_players_view_packet.cc 2015-02-09 05:57:46 +0000 | |||
1031 | @@ -485,11 +485,11 @@ | |||
1032 | 485 | { // edges | 485 | { // edges |
1033 | 486 | uint8_t mask = 0; | 486 | uint8_t mask = 0; |
1034 | 487 | if (f_vision | bl_vision) | 487 | if (f_vision | bl_vision) |
1036 | 488 | mask = Road_Mask << Road_SouthWest; | 488 | mask = RoadType::kMask << RoadType::kSouthWest; |
1037 | 489 | if (f_vision | br_vision) | 489 | if (f_vision | br_vision) |
1039 | 490 | mask |= Road_Mask << Road_SouthEast; | 490 | mask |= RoadType::kMask << RoadType::kSouthEast; |
1040 | 491 | if (f_vision | r_vision) | 491 | if (f_vision | r_vision) |
1042 | 492 | mask |= Road_Mask << Road_East; | 492 | mask |= RoadType::kMask << RoadType::kEast; |
1043 | 493 | f_player_field.roads = f.field->get_roads() & mask; | 493 | f_player_field.roads = f.field->get_roads() & mask; |
1044 | 494 | } | 494 | } |
1045 | 495 | 495 | ||
1046 | @@ -816,17 +816,17 @@ | |||
1047 | 816 | { // edges | 816 | { // edges |
1048 | 817 | uint8_t mask = 0; | 817 | uint8_t mask = 0; |
1049 | 818 | if (f_seen | bl_seen) { | 818 | if (f_seen | bl_seen) { |
1051 | 819 | mask = Road_Mask << Road_SouthWest; | 819 | mask = RoadType::kMask << RoadType::kSouthWest; |
1052 | 820 | } else if (f_everseen | bl_everseen) { | 820 | } else if (f_everseen | bl_everseen) { |
1053 | 821 | // The player has seen the SouthWest edge but does not see | 821 | // The player has seen the SouthWest edge but does not see |
1054 | 822 | // it now. Load his information about this edge from file. | 822 | // it now. Load his information about this edge from file. |
1055 | 823 | if (road_file_version < 2) { | 823 | if (road_file_version < 2) { |
1057 | 824 | try {roads = legacy_road_bitbuffer.get() << Road_SouthWest;} | 824 | try {roads = legacy_road_bitbuffer.get() << RoadType::kSouthWest;} |
1058 | 825 | catch (const FileRead::FileBoundaryExceeded &) { | 825 | catch (const FileRead::FileBoundaryExceeded &) { |
1059 | 826 | throw GameDataError | 826 | throw GameDataError |
1060 | 827 | ("MapPlayersViewPacket::read: player %u: in " | 827 | ("MapPlayersViewPacket::read: player %u: in " |
1061 | 828 | "\"%s\": node (%i, %i): unexpected end of file while " | 828 | "\"%s\": node (%i, %i): unexpected end of file while " |
1063 | 829 | "reading Road_SouthWest", | 829 | "reading RoadType::kSouthWest", |
1064 | 830 | plnum, roads_filename, f.x, f.y); | 830 | plnum, roads_filename, f.x, f.y); |
1065 | 831 | } | 831 | } |
1066 | 832 | } else { | 832 | } else { |
1067 | @@ -834,17 +834,17 @@ | |||
1068 | 834 | } | 834 | } |
1069 | 835 | } | 835 | } |
1070 | 836 | if (f_seen | br_seen) { | 836 | if (f_seen | br_seen) { |
1072 | 837 | mask |= Road_Mask << Road_SouthEast; | 837 | mask |= RoadType::kMask << RoadType::kSouthEast; |
1073 | 838 | } else if (f_everseen | br_everseen) { | 838 | } else if (f_everseen | br_everseen) { |
1074 | 839 | // The player has seen the SouthEast edge but does not see | 839 | // The player has seen the SouthEast edge but does not see |
1075 | 840 | // it now. Load his information about this edge from file. | 840 | // it now. Load his information about this edge from file. |
1076 | 841 | if (road_file_version < 2) { | 841 | if (road_file_version < 2) { |
1078 | 842 | try {roads |= legacy_road_bitbuffer.get() << Road_SouthEast;} | 842 | try {roads |= legacy_road_bitbuffer.get() << RoadType::kSouthEast;} |
1079 | 843 | catch (const FileRead::FileBoundaryExceeded &) { | 843 | catch (const FileRead::FileBoundaryExceeded &) { |
1080 | 844 | throw GameDataError | 844 | throw GameDataError |
1081 | 845 | ("MapPlayersViewPacket::read: player %u: in " | 845 | ("MapPlayersViewPacket::read: player %u: in " |
1082 | 846 | "\"%s\": node (%i, %i): unexpected end of file while " | 846 | "\"%s\": node (%i, %i): unexpected end of file while " |
1084 | 847 | "reading Road_SouthEast", | 847 | "reading RoadType::kSouthEast", |
1085 | 848 | plnum, roads_filename, f.x, f.y); | 848 | plnum, roads_filename, f.x, f.y); |
1086 | 849 | } | 849 | } |
1087 | 850 | } else { | 850 | } else { |
1088 | @@ -852,17 +852,17 @@ | |||
1089 | 852 | } | 852 | } |
1090 | 853 | } | 853 | } |
1091 | 854 | if (f_seen | r_seen) { | 854 | if (f_seen | r_seen) { |
1093 | 855 | mask |= Road_Mask << Road_East; | 855 | mask |= RoadType::kMask << RoadType::kEast; |
1094 | 856 | } else if (f_everseen | r_everseen) { | 856 | } else if (f_everseen | r_everseen) { |
1095 | 857 | // The player has seen the East edge but does not see | 857 | // The player has seen the East edge but does not see |
1096 | 858 | // it now. Load his information about this edge from file. | 858 | // it now. Load his information about this edge from file. |
1097 | 859 | if (road_file_version < 2) { | 859 | if (road_file_version < 2) { |
1099 | 860 | try {roads |= legacy_road_bitbuffer.get() << Road_East;} | 860 | try {roads |= legacy_road_bitbuffer.get() << RoadType::kEast;} |
1100 | 861 | catch (const FileRead::FileBoundaryExceeded &) { | 861 | catch (const FileRead::FileBoundaryExceeded &) { |
1101 | 862 | throw GameDataError | 862 | throw GameDataError |
1102 | 863 | ("MapPlayersViewPacket::read: player %u: in " | 863 | ("MapPlayersViewPacket::read: player %u: in " |
1103 | 864 | "\"%s\": node (%i, %i): unexpected end of file while " | 864 | "\"%s\": node (%i, %i): unexpected end of file while " |
1105 | 865 | "reading Road_East", | 865 | "reading RoadType::kEast", |
1106 | 866 | plnum, roads_filename, f.x, f.y); | 866 | plnum, roads_filename, f.x, f.y); |
1107 | 867 | } | 867 | } |
1108 | 868 | } else { | 868 | } else { |
1109 | 869 | 869 | ||
1110 | === modified file 'src/scripting/lua_game.h' | |||
1111 | --- src/scripting/lua_game.h 2015-01-31 16:03:59 +0000 | |||
1112 | +++ src/scripting/lua_game.h 2015-02-09 05:57:46 +0000 | |||
1113 | @@ -27,7 +27,7 @@ | |||
1114 | 27 | #include "scripting/luna.h" | 27 | #include "scripting/luna.h" |
1115 | 28 | 28 | ||
1116 | 29 | namespace Widelands { | 29 | namespace Widelands { |
1118 | 30 | struct TribeDescr; | 30 | class TribeDescr; |
1119 | 31 | class Objective; | 31 | class Objective; |
1120 | 32 | struct Message; | 32 | struct Message; |
1121 | 33 | } | 33 | } |
1122 | 34 | 34 | ||
1123 | === modified file 'src/scripting/lua_map.cc' | |||
1124 | --- src/scripting/lua_map.cc 2015-01-31 16:03:59 +0000 | |||
1125 | +++ src/scripting/lua_map.cc 2015-02-09 05:57:46 +0000 | |||
1126 | @@ -220,7 +220,7 @@ | |||
1127 | 220 | WorkersMap valid_workers; | 220 | WorkersMap valid_workers; |
1128 | 221 | valid_workers.insert(WorkerAmount(r.owner().tribe().worker_index("carrier"), 1)); | 221 | valid_workers.insert(WorkerAmount(r.owner().tribe().worker_index("carrier"), 1)); |
1129 | 222 | 222 | ||
1131 | 223 | if (r.get_roadtype() == Road_Busy) | 223 | if (r.get_roadtype() == RoadType::kBusy) |
1132 | 224 | valid_workers.insert(WorkerAmount(r.owner().tribe().carrier2(), 1)); | 224 | valid_workers.insert(WorkerAmount(r.owner().tribe().carrier2(), 1)); |
1133 | 225 | 225 | ||
1134 | 226 | return valid_workers; | 226 | return valid_workers; |
1135 | @@ -2531,9 +2531,9 @@ | |||
1136 | 2531 | */ | 2531 | */ |
1137 | 2532 | int LuaRoad::get_road_type(lua_State * L) { | 2532 | int LuaRoad::get_road_type(lua_State * L) { |
1138 | 2533 | switch (get(L, get_egbase(L))->get_roadtype()) { | 2533 | switch (get(L, get_egbase(L))->get_roadtype()) { |
1140 | 2534 | case Road_Normal: | 2534 | case RoadType::kNormal: |
1141 | 2535 | lua_pushstring(L, "normal"); break; | 2535 | lua_pushstring(L, "normal"); break; |
1143 | 2536 | case Road_Busy: | 2536 | case RoadType::kBusy: |
1144 | 2537 | lua_pushstring(L, "busy"); break; | 2537 | lua_pushstring(L, "busy"); break; |
1145 | 2538 | default: | 2538 | default: |
1146 | 2539 | report_error(L, "Unknown Roadtype! This is a bug in widelands!"); | 2539 | report_error(L, "Unknown Roadtype! This is a bug in widelands!"); |
1147 | 2540 | 2540 | ||
1148 | === modified file 'src/wui/encyclopedia_window.h' | |||
1149 | --- src/wui/encyclopedia_window.h 2014-09-20 09:37:47 +0000 | |||
1150 | +++ src/wui/encyclopedia_window.h 2015-02-09 05:57:46 +0000 | |||
1151 | @@ -29,7 +29,7 @@ | |||
1152 | 29 | 29 | ||
1153 | 30 | namespace Widelands { | 30 | namespace Widelands { |
1154 | 31 | struct WareDescr; | 31 | struct WareDescr; |
1156 | 32 | struct TribeDescr; | 32 | class TribeDescr; |
1157 | 33 | } | 33 | } |
1158 | 34 | 34 | ||
1159 | 35 | class InteractivePlayer; | 35 | class InteractivePlayer; |
1160 | 36 | 36 | ||
1161 | === modified file 'src/wui/interactive_base.cc' | |||
1162 | --- src/wui/interactive_base.cc 2015-01-31 16:03:59 +0000 | |||
1163 | +++ src/wui/interactive_base.cc 2015-02-09 05:57:46 +0000 | |||
1164 | @@ -767,7 +767,7 @@ | |||
1165 | 767 | int32_t const shift = 2 * (dir - Widelands::WALK_E); | 767 | int32_t const shift = 2 * (dir - Widelands::WALK_E); |
1166 | 768 | 768 | ||
1167 | 769 | uint8_t set_to = overlay_manager.get_road_overlay(c); | 769 | uint8_t set_to = overlay_manager.get_road_overlay(c); |
1169 | 770 | set_to |= Widelands::Road_Normal << shift; | 770 | set_to |= Widelands::RoadType::kNormal << shift; |
1170 | 771 | overlay_manager.register_road_overlay(c, set_to, m_jobid); | 771 | overlay_manager.register_road_overlay(c, set_to, m_jobid); |
1171 | 772 | } | 772 | } |
1172 | 773 | 773 | ||
1173 | 774 | 774 | ||
1174 | === modified file 'src/wui/waresdisplay.h' | |||
1175 | --- src/wui/waresdisplay.h 2014-09-14 11:31:58 +0000 | |||
1176 | +++ src/wui/waresdisplay.h 2015-02-09 05:57:46 +0000 | |||
1177 | @@ -32,7 +32,7 @@ | |||
1178 | 32 | namespace UI {struct Textarea;} | 32 | namespace UI {struct Textarea;} |
1179 | 33 | 33 | ||
1180 | 34 | namespace Widelands { | 34 | namespace Widelands { |
1182 | 35 | struct TribeDescr; | 35 | class TribeDescr; |
1183 | 36 | struct WareList; | 36 | struct WareList; |
1184 | 37 | } | 37 | } |
1185 | 38 | 38 | ||
1186 | 39 | 39 | ||
1187 | === modified file 'tribes/atlanteans/conf' | |||
1188 | --- tribes/atlanteans/conf 2014-08-26 17:25:00 +0000 | |||
1189 | +++ tribes/atlanteans/conf 2015-02-09 05:57:46 +0000 | |||
1190 | @@ -8,12 +8,18 @@ | |||
1191 | 8 | uiposition=100 | 8 | uiposition=100 |
1192 | 9 | carrier2=horse | 9 | carrier2=horse |
1193 | 10 | icon=pics/icon.png | 10 | icon=pics/icon.png |
1194 | 11 | |||
1195 | 11 | # Wares and workers positions in wares window. Columns are separated by ;, | 12 | # Wares and workers positions in wares window. Columns are separated by ;, |
1196 | 12 | # Entries in the columns separated by , | 13 | # Entries in the columns separated by , |
1197 | 13 | wares_order=stone, log, planks, spideryarn, spidercloth; fish, smoked_fish, meat, smoked_meat, water, corn, cornflour, blackroot, blackrootflour, bread; quartz, diamond, coal, ironore, iron, goldore, gold; pick, saw, shovel, hammer, milking_tongs, fishing_net, bucket, hunting_bow, hook_pole, scythe, bread_paddle, fire_tongs; light_trident, long_trident, steel_trident, double_trident, heavy_double_trident,steel_shield, advanced_shield, tabard, goldyarn, golden_tabard | 14 | wares_order=stone, log, planks, spideryarn, spidercloth; fish, smoked_fish, meat, smoked_meat, water, corn, cornflour, blackroot, blackrootflour, bread; quartz, diamond, coal, ironore, iron, goldore, gold; pick, saw, shovel, hammer, milking_tongs, fishing_net, bucket, hunting_bow, hook_pole, scythe, bread_paddle, fire_tongs; light_trident, long_trident, steel_trident, double_trident, heavy_double_trident,steel_shield, advanced_shield, tabard, goldyarn, golden_tabard |
1198 | 14 | 15 | ||
1199 | 15 | workers_order=carrier, horse, horsebreeder; stonecutter, woodcutter, sawyer, forester, builder, spiderbreeder, weaver, shipwright; fisher, fish_breeder, hunter, smoker, farmer, blackroot_farmer, miller, baker; geologist, miner, charcoal_burner, smelter; toolsmith; soldier, trainer, weaponsmith, armorsmith, scout | 16 | workers_order=carrier, horse, horsebreeder; stonecutter, woodcutter, sawyer, forester, builder, spiderbreeder, weaver, shipwright; fisher, fish_breeder, hunter, smoker, farmer, blackroot_farmer, miller, baker; geologist, miner, charcoal_burner, smelter; toolsmith; soldier, trainer, weaponsmith, armorsmith, scout |
1200 | 16 | 17 | ||
1201 | 18 | # Image file paths for this tribe's road textures | ||
1202 | 19 | [roads] | ||
1203 | 20 | busy_00=tribes/atlanteans/pics/roadt_busy.png | ||
1204 | 21 | normal_00=tribes/atlanteans/pics/roadt_normal.png | ||
1205 | 22 | |||
1206 | 17 | # Some blue fires would be fine, but just an idea | 23 | # Some blue fires would be fine, but just an idea |
1207 | 18 | [frontier] | 24 | [frontier] |
1208 | 19 | pics=pics/frontier_??.png | 25 | pics=pics/frontier_??.png |
1209 | 20 | 26 | ||
1210 | === added file 'tribes/atlanteans/pics/roadt_busy.png' | |||
1211 | 21 | Binary files tribes/atlanteans/pics/roadt_busy.png 1970-01-01 00:00:00 +0000 and tribes/atlanteans/pics/roadt_busy.png 2015-02-09 05:57:46 +0000 differ | 27 | Binary files tribes/atlanteans/pics/roadt_busy.png 1970-01-01 00:00:00 +0000 and tribes/atlanteans/pics/roadt_busy.png 2015-02-09 05:57:46 +0000 differ |
1212 | === added file 'tribes/atlanteans/pics/roadt_normal.png' | |||
1213 | 22 | Binary files tribes/atlanteans/pics/roadt_normal.png 1970-01-01 00:00:00 +0000 and tribes/atlanteans/pics/roadt_normal.png 2015-02-09 05:57:46 +0000 differ | 28 | Binary files tribes/atlanteans/pics/roadt_normal.png 1970-01-01 00:00:00 +0000 and tribes/atlanteans/pics/roadt_normal.png 2015-02-09 05:57:46 +0000 differ |
1214 | === modified file 'tribes/barbarians/conf' | |||
1215 | --- tribes/barbarians/conf 2014-08-26 17:25:00 +0000 | |||
1216 | +++ tribes/barbarians/conf 2015-02-09 05:57:46 +0000 | |||
1217 | @@ -8,12 +8,17 @@ | |||
1218 | 8 | uiposition=10 | 8 | uiposition=10 |
1219 | 9 | carrier2=ox | 9 | carrier2=ox |
1220 | 10 | icon=pics/icon.png | 10 | icon=pics/icon.png |
1221 | 11 | |||
1222 | 11 | # Wares and workers positions in wares window. Columns are separated by ;, | 12 | # Wares and workers positions in wares window. Columns are separated by ;, |
1223 | 12 | # Entries in the columns separated by , | 13 | # Entries in the columns separated by , |
1224 | 13 | wares_order= raw_stone,log, blackwood, grout, thatchreed, cloth; fish, meat, water, wheat, pittabread, beer, strongbeer, ration, snack, meal; coal, ironore, iron, goldore, gold; pick, felling_ax, shovel, hammer, fishing_rod, hunting_spear, scythe, bread_paddle, kitchen_tools, fire_tongs; ax, sharpax, broadax, bronzeax, battleax, warriorsax, helm , mask , warhelm | 14 | wares_order= raw_stone,log, blackwood, grout, thatchreed, cloth; fish, meat, water, wheat, pittabread, beer, strongbeer, ration, snack, meal; coal, ironore, iron, goldore, gold; pick, felling_ax, shovel, hammer, fishing_rod, hunting_spear, scythe, bread_paddle, kitchen_tools, fire_tongs; ax, sharpax, broadax, bronzeax, battleax, warriorsax, helm , mask , warhelm |
1225 | 14 | 15 | ||
1226 | 15 | workers_order=carrier, ox, cattlebreeder; stonemason, lumberjack, ranger, builder, lime-burner, gardener, weaver, shipwright; fisher , hunter , gamekeeper, farmer, baker, brewer, master-brewer, innkeeper; geologist,miner, chief-miner, master-miner, charcoal_burner, smelter; blacksmith, master-blacksmith; soldier, trainer, helmsmith, scout | 16 | workers_order=carrier, ox, cattlebreeder; stonemason, lumberjack, ranger, builder, lime-burner, gardener, weaver, shipwright; fisher , hunter , gamekeeper, farmer, baker, brewer, master-brewer, innkeeper; geologist,miner, chief-miner, master-miner, charcoal_burner, smelter; blacksmith, master-blacksmith; soldier, trainer, helmsmith, scout |
1227 | 16 | 17 | ||
1228 | 18 | # Image file paths for this tribe's road textures | ||
1229 | 19 | [roads] | ||
1230 | 20 | busy_00=tribes/barbarians/pics/roadt_busy.png | ||
1231 | 21 | normal_00=tribes/barbarians/pics/roadt_normal.png | ||
1232 | 17 | 22 | ||
1233 | 18 | [frontier] | 23 | [frontier] |
1234 | 19 | pics=pics/frontier_??.png | 24 | pics=pics/frontier_??.png |
1235 | 20 | 25 | ||
1236 | === added file 'tribes/barbarians/pics/roadt_busy.png' | |||
1237 | 21 | Binary files tribes/barbarians/pics/roadt_busy.png 1970-01-01 00:00:00 +0000 and tribes/barbarians/pics/roadt_busy.png 2015-02-09 05:57:46 +0000 differ | 26 | Binary files tribes/barbarians/pics/roadt_busy.png 1970-01-01 00:00:00 +0000 and tribes/barbarians/pics/roadt_busy.png 2015-02-09 05:57:46 +0000 differ |
1238 | === added file 'tribes/barbarians/pics/roadt_normal.png' | |||
1239 | 22 | Binary files tribes/barbarians/pics/roadt_normal.png 1970-01-01 00:00:00 +0000 and tribes/barbarians/pics/roadt_normal.png 2015-02-09 05:57:46 +0000 differ | 27 | Binary files tribes/barbarians/pics/roadt_normal.png 1970-01-01 00:00:00 +0000 and tribes/barbarians/pics/roadt_normal.png 2015-02-09 05:57:46 +0000 differ |
1240 | === modified file 'tribes/empire/conf' | |||
1241 | --- tribes/empire/conf 2014-08-26 17:25:00 +0000 | |||
1242 | +++ tribes/empire/conf 2015-02-09 05:57:46 +0000 | |||
1243 | @@ -8,12 +8,20 @@ | |||
1244 | 8 | uiposition=20 | 8 | uiposition=20 |
1245 | 9 | carrier2=donkey | 9 | carrier2=donkey |
1246 | 10 | icon=pics/icon.png | 10 | icon=pics/icon.png |
1247 | 11 | |||
1248 | 11 | # Wares and workers positions in wares window. Columns are separated by ;, | 12 | # Wares and workers positions in wares window. Columns are separated by ;, |
1249 | 12 | # Entries in the columns separated by , | 13 | # Entries in the columns separated by , |
1250 | 13 | wares_order=stone, log, wood, wool,cloth; fish,meat, water, wheat, flour, bread, beer, grape, wine, ration, meal; marble, marblecolumn, coal, ironore, iron, goldore, gold; pick, ax, saw, shovel, hammer, fishing_rod, hunting_spear, scythe, bread_paddle, basket, kitchen_tools, fire_tongs; wood_lance, lance, advanced_lance, heavy_lance, war_lance, helm, armor, chain_armor, plate_armor | 14 | wares_order=stone, log, wood, wool,cloth; fish,meat, water, wheat, flour, bread, beer, grape, wine, ration, meal; marble, marblecolumn, coal, ironore, iron, goldore, gold; pick, ax, saw, shovel, hammer, fishing_rod, hunting_spear, scythe, bread_paddle, basket, kitchen_tools, fire_tongs; wood_lance, lance, advanced_lance, heavy_lance, war_lance, helm, armor, chain_armor, plate_armor |
1251 | 14 | 15 | ||
1252 | 15 | workers_order=carrier, donkey, donkeybreeder; stonemason, carpenter, lumberjack, forester, builder, shepherd, weaver, shipwright; fisher, hunter, farmer, miller, baker, brewer, pig-breeder, vinefarmer, innkeeper; geologist, miner, master-miner, charcoal_burner, smelter; toolsmith; soldier, trainer, weaponsmith, armorsmith, scout | 16 | workers_order=carrier, donkey, donkeybreeder; stonemason, carpenter, lumberjack, forester, builder, shepherd, weaver, shipwright; fisher, hunter, farmer, miller, baker, brewer, pig-breeder, vinefarmer, innkeeper; geologist, miner, master-miner, charcoal_burner, smelter; toolsmith; soldier, trainer, weaponsmith, armorsmith, scout |
1253 | 16 | 17 | ||
1254 | 18 | # Image file paths for this tribe's road textures | ||
1255 | 19 | [roads] | ||
1256 | 20 | busy_00=tribes/empire/pics/roadt_busy.png | ||
1257 | 21 | normal_00=tribes/empire/pics/roadt_normal_00.png | ||
1258 | 22 | normal_01=tribes/empire/pics/roadt_normal_01.png | ||
1259 | 23 | normal_02=tribes/empire/pics/roadt_normal_02.png | ||
1260 | 24 | |||
1261 | 17 | # No idea for the frontier. Maybe some javelins? | 25 | # No idea for the frontier. Maybe some javelins? |
1262 | 18 | [frontier] | 26 | [frontier] |
1263 | 19 | pics=pics/frontier_??.png | 27 | pics=pics/frontier_??.png |
1264 | 20 | 28 | ||
1265 | === added file 'tribes/empire/pics/roadt_busy.png' | |||
1266 | 21 | Binary files tribes/empire/pics/roadt_busy.png 1970-01-01 00:00:00 +0000 and tribes/empire/pics/roadt_busy.png 2015-02-09 05:57:46 +0000 differ | 29 | Binary files tribes/empire/pics/roadt_busy.png 1970-01-01 00:00:00 +0000 and tribes/empire/pics/roadt_busy.png 2015-02-09 05:57:46 +0000 differ |
1267 | === added file 'tribes/empire/pics/roadt_normal_00.png' | |||
1268 | 22 | Binary files tribes/empire/pics/roadt_normal_00.png 1970-01-01 00:00:00 +0000 and tribes/empire/pics/roadt_normal_00.png 2015-02-09 05:57:46 +0000 differ | 30 | Binary files tribes/empire/pics/roadt_normal_00.png 1970-01-01 00:00:00 +0000 and tribes/empire/pics/roadt_normal_00.png 2015-02-09 05:57:46 +0000 differ |
1269 | === added file 'tribes/empire/pics/roadt_normal_01.png' | |||
1270 | 23 | Binary files tribes/empire/pics/roadt_normal_01.png 1970-01-01 00:00:00 +0000 and tribes/empire/pics/roadt_normal_01.png 2015-02-09 05:57:46 +0000 differ | 31 | Binary files tribes/empire/pics/roadt_normal_01.png 1970-01-01 00:00:00 +0000 and tribes/empire/pics/roadt_normal_01.png 2015-02-09 05:57:46 +0000 differ |
1271 | === added file 'tribes/empire/pics/roadt_normal_02.png' | |||
1272 | 24 | Binary files tribes/empire/pics/roadt_normal_02.png 1970-01-01 00:00:00 +0000 and tribes/empire/pics/roadt_normal_02.png 2015-02-09 05:57:46 +0000 differ | 32 | Binary files tribes/empire/pics/roadt_normal_02.png 1970-01-01 00:00:00 +0000 and tribes/empire/pics/roadt_normal_02.png 2015-02-09 05:57:46 +0000 differ |
1273 | === removed file 'world/pics/roadt_busy.png' | |||
1274 | 25 | Binary files world/pics/roadt_busy.png 2014-04-26 10:53:52 +0000 and world/pics/roadt_busy.png 1970-01-01 00:00:00 +0000 differ | 33 | Binary files world/pics/roadt_busy.png 2014-04-26 10:53:52 +0000 and world/pics/roadt_busy.png 1970-01-01 00:00:00 +0000 differ |
1275 | === removed file 'world/pics/roadt_normal.png' | |||
1276 | 26 | Binary files world/pics/roadt_normal.png 2015-01-13 20:54:09 +0000 and world/pics/roadt_normal.png 1970-01-01 00:00:00 +0000 differ | 34 | Binary files world/pics/roadt_normal.png 2015-01-13 20:54:09 +0000 and world/pics/roadt_normal.png 1970-01-01 00:00:00 +0000 differ |
When testing, make sure to use the empire since it is the only tribe that already has more than one road graphic.