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

Proposed by SirVer
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
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+249013@code.launchpad.net

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.

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

When testing, make sure to use the empire since it is the only tribe that already has more than one road graphic.

Revision history for this message
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?

review: Approve
Revision history for this message
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.

Revision history for this message
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?

Revision history for this message
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.

Revision history for this message
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://code.launchpad.net/~widelands-dev/widelands/busy_roads_for_buildings/+merge/249013
> You are subscribed to branch lp:widelands.
>

Revision history for this message
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://home.arcor.de/frank.ue/widelands_roads/roads_tribes.xcf.zip

Revision history for this message
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://home.arcor.de/frank.ue/widelands_roads/roads_tribes.xcf.zip
> --
>
> https://code.launchpad.net/~widelands-dev/widelands/busy_roads_for_buildings/+merge/249013
> You are subscribed to branch lp:widelands.
>

Revision history for this message
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

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/economy/flag.cc'
--- src/economy/flag.cc 2014-11-30 18:49:38 +0000
+++ src/economy/flag.cc 2015-02-09 05:57:46 +0000
@@ -203,7 +203,9 @@
203203
204 const Map & map = egbase.map();204 const Map & map = egbase.map();
205 egbase.set_road205 egbase.set_road
206 (map.get_fcoords(map.tl_n(m_position)), Road_SouthEast, Road_Normal);206 (map.get_fcoords(map.tl_n(m_position)),
207 RoadType::kSouthEast,
208 m_building->get_size() == BaseImmovable::SMALL? RoadType::kNormal : RoadType::kBusy);
207209
208 building.set_economy(get_economy());210 building.set_economy(get_economy());
209}211}
@@ -219,7 +221,7 @@
219221
220 const Map & map = egbase.map();222 const Map & map = egbase.map();
221 egbase.set_road223 egbase.set_road
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);
223225
224 m_building = nullptr;226 m_building = nullptr;
225}227}
226228
=== modified file 'src/economy/road.cc'
--- src/economy/road.cc 2014-11-30 18:49:38 +0000
+++ src/economy/road.cc 2015-02-09 05:57:46 +0000
@@ -99,7 +99,7 @@
99 Player & owner = start.owner();99 Player & owner = start.owner();
100 Road & road = *new Road();100 Road & road = *new Road();
101 road.set_owner(&owner);101 road.set_owner(&owner);
102 road.m_type = Road_Normal;102 road.m_type = RoadType::kNormal;
103 road.m_flags[FlagStart] = &start;103 road.m_flags[FlagStart] = &start;
104 road.m_flags[FlagEnd] = &end;104 road.m_flags[FlagEnd] = &end;
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()
@@ -224,7 +224,7 @@
224 Direction const rdir = 2 * (dir - WALK_E);224 Direction const rdir = 2 * (dir - WALK_E);
225225
226 if (rdir <= 4)226 if (rdir <= 4)
227 egbase.set_road(curf, rdir, Road_None);227 egbase.set_road(curf, rdir, RoadType::kNone);
228 }228 }
229229
230 // mark the road that leads away from this field230 // mark the road that leads away from this field
@@ -233,7 +233,7 @@
233 Direction const rdir = 2 * (dir - WALK_E);233 Direction const rdir = 2 * (dir - WALK_E);
234234
235 if (rdir <= 4)235 if (rdir <= 4)
236 egbase.set_road(curf, rdir, Road_None);236 egbase.set_road(curf, rdir, RoadType::kNone);
237237
238 map.get_neighbour(curf, dir, &curf);238 map.get_neighbour(curf, dir, &curf);
239 }239 }
@@ -293,7 +293,7 @@
293 } else if293 } else if
294 (!slot.carrier_request &&294 (!slot.carrier_request &&
295 (slot.carrier_type == 1 ||295 (slot.carrier_type == 1 ||
296 m_type == Road_Busy)) {296 m_type == RoadType::kBusy)) {
297 _request_carrier(slot);297 _request_carrier(slot);
298 }298 }
299 }299 }
@@ -584,7 +584,7 @@
584 (!slot.carrier.get(game) &&584 (!slot.carrier.get(game) &&
585 !slot.carrier_request &&585 !slot.carrier_request &&
586 (slot.carrier_type == 1 ||586 (slot.carrier_type == 1 ||
587 m_type == Road_Busy)) {587 m_type == RoadType::kBusy)) {
588 _request_carrier(slot);588 _request_carrier(slot);
589 }589 }
590 }590 }
@@ -632,7 +632,7 @@
632 // ie: cancelling current task632 // ie: cancelling current task
633 m_carrier_slots[1].carrier = nullptr;633 m_carrier_slots[1].carrier = nullptr;
634 m_carrier_slots[1].carrier_request = nullptr;634 m_carrier_slots[1].carrier_request = nullptr;
635 m_type = Road_Normal;635 m_type = RoadType::kNormal;
636 _mark_map(game);636 _mark_map(game);
637 }637 }
638 }638 }
@@ -648,7 +648,7 @@
648 if (100 < tdelta) {648 if (100 < tdelta) {
649 m_busyness_last_update = gametime;649 m_busyness_last_update = gametime;
650 if (500 < (m_busyness += 10)) {650 if (500 < (m_busyness += 10)) {
651 m_type = Road_Busy;651 m_type = RoadType::kBusy;
652 _mark_map(game);652 _mark_map(game);
653 for (CarrierSlot& slot : m_carrier_slots) {653 for (CarrierSlot& slot : m_carrier_slots) {
654 if654 if
655655
=== modified file 'src/graphic/game_renderer.cc'
--- src/graphic/game_renderer.cc 2014-11-28 08:13:14 +0000
+++ src/graphic/game_renderer.cc 2015-02-09 05:57:46 +0000
@@ -209,6 +209,13 @@
209209
210 f.brightness = field_brightness(fcoords, gametime, map, player);210 f.brightness = field_brightness(fcoords, gametime, map, player);
211211
212 PlayerNumber owner_number = fcoords.field->get_owned_by();
213 if (owner_number > 0) {
214 f.road_textures = &egbase.player(owner_number).tribe().road_textures();
215 } else {
216 f.road_textures = nullptr;
217 }
218
212 f.roads = field_roads(fcoords, map, player);219 f.roads = field_roads(fcoords, map, player);
213 }220 }
214 }221 }
215222
=== modified file 'src/graphic/gl/fields_to_draw.h'
--- src/graphic/gl/fields_to_draw.h 2014-11-08 18:06:17 +0000
+++ src/graphic/gl/fields_to_draw.h 2015-02-09 05:57:46 +0000
@@ -20,11 +20,14 @@
20#ifndef WL_GRAPHIC_GL_FIELDS_TO_DRAW_H20#ifndef WL_GRAPHIC_GL_FIELDS_TO_DRAW_H
21#define WL_GRAPHIC_GL_FIELDS_TO_DRAW_H21#define WL_GRAPHIC_GL_FIELDS_TO_DRAW_H
2222
23#include <cstddef>
24#include <string>
23#include <vector>25#include <vector>
24#include <cstddef>
2526
26#include <stdint.h>27#include <stdint.h>
2728
29#include "logic/road_textures.h"
30
28// Helper struct that contains the data needed for drawing all fields. All31// Helper struct that contains the data needed for drawing all fields. All
29// methods are inlined for performance reasons.32// methods are inlined for performance reasons.
30class FieldsToDraw {33class FieldsToDraw {
@@ -37,6 +40,7 @@
37 float brightness; // brightness of the pixel40 float brightness; // brightness of the pixel
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.
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.
43 const RoadTextures* road_textures; // Road Textures to use for drawing.
40 };44 };
4145
42 FieldsToDraw(int minfx, int maxfx, int minfy, int maxfy)46 FieldsToDraw(int minfx, int maxfx, int minfy, int maxfy)
4347
=== modified file 'src/graphic/gl/road_program.cc'
--- src/graphic/gl/road_program.cc 2015-01-20 18:54:50 +0000
+++ src/graphic/gl/road_program.cc 2015-02-09 05:57:46 +0000
@@ -19,6 +19,7 @@
1919
20#include "graphic/gl/road_program.h"20#include "graphic/gl/road_program.h"
2121
22#include <cassert>
22#include <cmath>23#include <cmath>
2324
24#include "base/log.h"25#include "base/log.h"
@@ -37,17 +38,14 @@
37// Attributes.38// Attributes.
38attribute vec2 attr_position;39attribute vec2 attr_position;
39attribute vec2 attr_texture_position;40attribute vec2 attr_texture_position;
40attribute float attr_texture_mix;
41attribute float attr_brightness;41attribute float attr_brightness;
4242
43// Outputs.43// Outputs.
44varying vec2 out_texture_position;44varying vec2 out_texture_position;
45varying float out_texture_mix;
46varying float out_brightness;45varying float out_brightness;
4746
48void main() {47void main() {
49 out_texture_position = attr_texture_position;48 out_texture_position = attr_texture_position;
50 out_texture_mix = attr_texture_mix;
51 out_brightness = attr_brightness;49 out_brightness = attr_brightness;
52 gl_Position = vec4(attr_position, 0., 1.);50 gl_Position = vec4(attr_position, 0., 1.);
53}51}
@@ -58,16 +56,12 @@
5856
59// Inputs.57// Inputs.
60varying vec2 out_texture_position;58varying vec2 out_texture_position;
61varying float out_texture_mix;
62varying float out_brightness;59varying float out_brightness;
6360
64uniform sampler2D u_normal_road_texture;61uniform sampler2D u_texture;
65uniform sampler2D u_busy_road_texture;
6662
67void main() {63void main() {
68 vec4 normal_road_color = texture2D(u_normal_road_texture, out_texture_position);64 vec4 color = texture2D(u_texture, out_texture_position);
69 vec4 busy_road_color = texture2D(u_busy_road_texture, out_texture_position);
70 vec4 color = mix(normal_road_color, busy_road_color, out_texture_mix);
71 color.rgb *= out_brightness;65 color.rgb *= out_brightness;
72 gl_FragColor = color;66 gl_FragColor = color;
73}67}
@@ -81,14 +75,9 @@
81 attr_position_ = glGetAttribLocation(gl_program_.object(), "attr_position");75 attr_position_ = glGetAttribLocation(gl_program_.object(), "attr_position");
82 attr_texture_position_ =76 attr_texture_position_ =
83 glGetAttribLocation(gl_program_.object(), "attr_texture_position");77 glGetAttribLocation(gl_program_.object(), "attr_texture_position");
84 attr_texture_mix_ = glGetAttribLocation(gl_program_.object(), "attr_texture_mix");
85 attr_brightness_ = glGetAttribLocation(gl_program_.object(), "attr_brightness");78 attr_brightness_ = glGetAttribLocation(gl_program_.object(), "attr_brightness");
8679
87 u_normal_road_texture_ = glGetUniformLocation(gl_program_.object(), "u_normal_road_texture");80 u_texture_ = glGetUniformLocation(gl_program_.object(), "u_texture");
88 u_busy_road_texture_ = glGetUniformLocation(gl_program_.object(), "u_busy_road_texture");
89
90 normal_road_texture_ = load_image("world/pics/roadt_normal.png");
91 busy_road_texture_ = load_image("world/pics/roadt_busy.png");
92}81}
9382
94RoadProgram::~RoadProgram() {83RoadProgram::~RoadProgram() {
@@ -97,16 +86,15 @@
97void RoadProgram::add_road(const Surface& surface,86void RoadProgram::add_road(const Surface& surface,
98 const FieldsToDraw::Field& start,87 const FieldsToDraw::Field& start,
99 const FieldsToDraw::Field& end,88 const FieldsToDraw::Field& end,
100 const Widelands::RoadType road_type) {89 const Widelands::RoadType road_type,
90 const Direction direction,
91 int* gl_texture) {
101 // The thickness of the road in pixels on screen.92 // The thickness of the road in pixels on screen.
102 static constexpr float kRoadThicknessInPixels = 5.;93 static constexpr float kRoadThicknessInPixels = 5.;
10394
104 // The overshot of the road in either direction in percent.95 // The overshot of the road in either direction in percent.
105 static constexpr float kRoadElongationInPercent = .1;96 static constexpr float kRoadElongationInPercent = .1;
10697
107 // A tiny value we use instead 0, to make sure that we always sample inside of the texture.
108 constexpr float kEpsilon = 1e-6;
109
110 const float delta_x = end.pixel_x - start.pixel_x;98 const float delta_x = end.pixel_x - start.pixel_x;
111 const float delta_y = end.pixel_y - start.pixel_y;99 const float delta_y = end.pixel_y - start.pixel_y;
112 const float vector_length = std::hypot(delta_x, delta_y);100 const float vector_length = std::hypot(delta_x, delta_y);
@@ -119,35 +107,43 @@
119 const float road_thickness_x = (-delta_y / vector_length) * kRoadThicknessInPixels;107 const float road_thickness_x = (-delta_y / vector_length) * kRoadThicknessInPixels;
120 const float road_thickness_y = (delta_x / vector_length) * kRoadThicknessInPixels;108 const float road_thickness_y = (delta_x / vector_length) * kRoadThicknessInPixels;
121109
122 const float texture_mix = road_type == Widelands::Road_Normal ? 0. : 1.;110 const Texture& texture =
111 road_type == Widelands::RoadType::kNormal ?
112 start.road_textures->get_normal_texture(start.fx, start.fy, direction) :
113 start.road_textures->get_busy_texture(start.fx, start.fy, direction);
114 if (*gl_texture == -1) {
115 *gl_texture = texture.get_gl_texture();
116 }
117 // We assume that all road textures are in the same OpenGL texture, i.e. in
118 // one texture atlas.
119 assert(*gl_texture == texture.get_gl_texture());
120
121 const auto& texture_rect = texture.texture_coordinates();
123122
124 vertices_.emplace_back(PerVertexData{123 vertices_.emplace_back(PerVertexData{
125 start.pixel_x - road_overshoot_x + road_thickness_x,124 start.pixel_x - road_overshoot_x + road_thickness_x,
126 start.pixel_y - road_overshoot_y + road_thickness_y,125 start.pixel_y - road_overshoot_y + road_thickness_y,
127 kEpsilon,126 texture_rect.x,
128 kEpsilon,127 texture_rect.y,
129 start.brightness,128 start.brightness,
130 texture_mix,
131 });129 });
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);
133131
134 vertices_.emplace_back(PerVertexData{132 vertices_.emplace_back(PerVertexData{
135 start.pixel_x - road_overshoot_x - road_thickness_x,133 start.pixel_x - road_overshoot_x - road_thickness_x,
136 start.pixel_y - road_overshoot_y - road_thickness_y,134 start.pixel_y - road_overshoot_y - road_thickness_y,
137 kEpsilon,135 texture_rect.x,
138 1.f - kEpsilon,136 texture_rect.y + texture_rect.h,
139 start.brightness,137 start.brightness,
140 texture_mix,
141 });138 });
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);
143140
144 vertices_.emplace_back(PerVertexData{141 vertices_.emplace_back(PerVertexData{
145 end.pixel_x + road_overshoot_x + road_thickness_x,142 end.pixel_x + road_overshoot_x + road_thickness_x,
146 end.pixel_y + road_overshoot_y + road_thickness_y,143 end.pixel_y + road_overshoot_y + road_thickness_y,
147 1.f - kEpsilon,144 texture_rect.x + texture_rect.w,
148 kEpsilon,145 texture_rect.y,
149 end.brightness,146 end.brightness,
150 texture_mix,
151 });147 });
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);
153149
@@ -161,10 +157,9 @@
161 vertices_.emplace_back(PerVertexData{157 vertices_.emplace_back(PerVertexData{
162 end.pixel_x + road_overshoot_x - road_thickness_x,158 end.pixel_x + road_overshoot_x - road_thickness_x,
163 end.pixel_y + road_overshoot_y - road_thickness_y,159 end.pixel_y + road_overshoot_y - road_thickness_y,
164 1.f - kEpsilon,160 texture_rect.x + texture_rect.w,
165 1.f - kEpsilon,161 texture_rect.y + texture_rect.h,
166 end.brightness,162 end.brightness,
167 texture_mix,
168 });163 });
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);
170}165}
@@ -172,6 +167,7 @@
172void RoadProgram::draw(const Surface& surface, const FieldsToDraw& fields_to_draw) {167void RoadProgram::draw(const Surface& surface, const FieldsToDraw& fields_to_draw) {
173 vertices_.clear();168 vertices_.clear();
174169
170 int gl_texture = -1;
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) {
176 const FieldsToDraw::Field& field = fields_to_draw.at(current_index);172 const FieldsToDraw::Field& field = fields_to_draw.at(current_index);
177173
@@ -179,9 +175,9 @@
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);
180 if (rn_index != -1) {176 if (rn_index != -1) {
181 const Widelands::RoadType road =177 const Widelands::RoadType road =
182 static_cast<Widelands::RoadType>(field.roads & Widelands::Road_Mask);178 static_cast<Widelands::RoadType>(field.roads & Widelands::RoadType::kMask);
183 if (road != Widelands::Road_None) {179 if (road != Widelands::RoadType::kNone) {
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);
185 }181 }
186 }182 }
187183
@@ -189,9 +185,9 @@
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);
190 if (brn_index != -1) {186 if (brn_index != -1) {
191 const Widelands::RoadType road =187 const Widelands::RoadType road =
192 static_cast<Widelands::RoadType>((field.roads >> 2) & Widelands::Road_Mask);188 static_cast<Widelands::RoadType>((field.roads >> 2) & Widelands::RoadType::kMask);
193 if (road != Widelands::Road_None) {189 if (road != Widelands::RoadType::kNone) {
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);
195 }191 }
196 }192 }
197193
@@ -200,9 +196,9 @@
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);
201 if (bln_index != -1) {197 if (bln_index != -1) {
202 const Widelands::RoadType road =198 const Widelands::RoadType road =
203 static_cast<Widelands::RoadType>((field.roads >> 4) & Widelands::Road_Mask);199 static_cast<Widelands::RoadType>((field.roads >> 4) & Widelands::RoadType::kMask);
204 if (road != Widelands::Road_None) {200 if (road != Widelands::RoadType::kNone) {
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);
206 }202 }
207 }203 }
208 }204 }
@@ -212,7 +208,6 @@
212 glEnableVertexAttribArray(attr_position_);208 glEnableVertexAttribArray(attr_position_);
213 glEnableVertexAttribArray(attr_texture_position_);209 glEnableVertexAttribArray(attr_texture_position_);
214 glEnableVertexAttribArray(attr_brightness_);210 glEnableVertexAttribArray(attr_brightness_);
215 glEnableVertexAttribArray(attr_texture_mix_);
216211
217 glBindBuffer(GL_ARRAY_BUFFER, gl_array_buffer_.object());212 glBindBuffer(GL_ARRAY_BUFFER, gl_array_buffer_.object());
218 glBufferData(213 glBufferData(
@@ -229,25 +224,18 @@
229 set_attrib_pointer(attr_position_, 2, offsetof(PerVertexData, gl_x));224 set_attrib_pointer(attr_position_, 2, offsetof(PerVertexData, gl_x));
230 set_attrib_pointer(attr_texture_position_, 2, offsetof(PerVertexData, texture_x));225 set_attrib_pointer(attr_texture_position_, 2, offsetof(PerVertexData, texture_x));
231 set_attrib_pointer(attr_brightness_, 1, offsetof(PerVertexData, brightness));226 set_attrib_pointer(attr_brightness_, 1, offsetof(PerVertexData, brightness));
232 set_attrib_pointer(attr_texture_mix_, 1, offsetof(PerVertexData, texture_mix));
233227
234 glBindBuffer(GL_ARRAY_BUFFER, 0);228 glBindBuffer(GL_ARRAY_BUFFER, 0);
235229
236 // Bind the textures.230 // Bind the textures.
237 glActiveTexture(GL_TEXTURE0);231 glActiveTexture(GL_TEXTURE0);
238 glBindTexture(GL_TEXTURE_2D, normal_road_texture_->get_gl_texture());232 glBindTexture(GL_TEXTURE_2D, gl_texture);
239 glUniform1i(u_normal_road_texture_, 0);
240233
241 glActiveTexture(GL_TEXTURE1);234 glUniform1i(u_texture_, 0);
242 glBindTexture(GL_TEXTURE_2D, busy_road_texture_->get_gl_texture());
243 glUniform1i(u_busy_road_texture_, 1);
244235
245 glDrawArrays(GL_TRIANGLES, 0, vertices_.size());236 glDrawArrays(GL_TRIANGLES, 0, vertices_.size());
246237
247 glDisableVertexAttribArray(attr_position_);238 glDisableVertexAttribArray(attr_position_);
248 glDisableVertexAttribArray(attr_texture_position_);239 glDisableVertexAttribArray(attr_texture_position_);
249 glDisableVertexAttribArray(attr_brightness_);240 glDisableVertexAttribArray(attr_brightness_);
250 glDisableVertexAttribArray(attr_texture_mix_);
251
252 glActiveTexture(GL_TEXTURE0);
253}241}
254242
=== modified file 'src/graphic/gl/road_program.h'
--- src/graphic/gl/road_program.h 2014-11-24 07:10:03 +0000
+++ src/graphic/gl/road_program.h 2015-02-09 05:57:46 +0000
@@ -48,21 +48,18 @@
48 float texture_x;48 float texture_x;
49 float texture_y;49 float texture_y;
50 float brightness;50 float brightness;
51
52 // This is a hack: we want to draw busy and normal roads in the same
53 // run, but since samplers (apparently?) cannot be passed through
54 // attribute arrays, we instead sample twice (busy and normal) and mix
55 // them together with 'texture_mix' which is either 1 or 0.
56 float texture_mix;
57 };51 };
58 static_assert(sizeof(PerVertexData) == 24, "Wrong padding.");52 static_assert(sizeof(PerVertexData) == 20, "Wrong padding.");
5953
60 // Adds a road from 'start' to 'end' to be rendered in this frame using the54 // Adds a road from 'start' to 'end' to be rendered in this frame using the
61 // correct texture for 'road_type'.55 // correct texture for 'road_type'.
56 enum Direction {kEast, kSouthEast, kSouthWest};
62 void add_road(const Surface& surface,57 void add_road(const Surface& surface,
63 const FieldsToDraw::Field& start,58 const FieldsToDraw::Field& start,
64 const FieldsToDraw::Field& end,59 const FieldsToDraw::Field& end,
65 const Widelands::RoadType road_type);60 const Widelands::RoadType road_type,
61 const Direction direction,
62 int* gl_texture);
6663
67 // The buffer that will contain 'vertices_' for rendering.64 // The buffer that will contain 'vertices_' for rendering.
68 Gl::Buffer gl_array_buffer_;65 Gl::Buffer gl_array_buffer_;
@@ -74,19 +71,13 @@
74 GLint attr_position_;71 GLint attr_position_;
75 GLint attr_texture_position_;72 GLint attr_texture_position_;
76 GLint attr_brightness_;73 GLint attr_brightness_;
77 GLint attr_texture_mix_;
7874
79 // Uniforms.75 // Uniforms.
80 GLint u_normal_road_texture_;76 GLint u_texture_;
81 GLint u_busy_road_texture_;
8277
83 // All vertices that get rendered this frame.78 // All vertices that get rendered this frame.
84 std::vector<PerVertexData> vertices_;79 std::vector<PerVertexData> vertices_;
8580
86 // The road textures.
87 std::unique_ptr<Texture> normal_road_texture_;
88 std::unique_ptr<Texture> busy_road_texture_;
89
90 DISALLOW_COPY_AND_ASSIGN(RoadProgram);81 DISALLOW_COPY_AND_ASSIGN(RoadProgram);
91};82};
9283
9384
=== modified file 'src/logic/CMakeLists.txt'
--- src/logic/CMakeLists.txt 2015-01-31 16:03:59 +0000
+++ src/logic/CMakeLists.txt 2015-02-09 05:57:46 +0000
@@ -167,6 +167,8 @@
167 replay.h167 replay.h
168 requirements.cc168 requirements.cc
169 requirements.h169 requirements.h
170 road_textures.cc
171 road_textures.h
170 roadtype.h172 roadtype.h
171 save_handler.cc173 save_handler.cc
172 save_handler.h174 save_handler.h
173175
=== modified file 'src/logic/bob.h'
--- src/logic/bob.h 2014-09-19 12:54:54 +0000
+++ src/logic/bob.h 2015-02-09 05:57:46 +0000
@@ -35,7 +35,7 @@
35class Map;35class Map;
36struct Route;36struct Route;
37struct Transfer;37struct Transfer;
38struct TribeDescr;38class TribeDescr;
3939
4040
41/**41/**
4242
=== modified file 'src/logic/buildcost.h'
--- src/logic/buildcost.h 2014-09-10 10:18:46 +0000
+++ src/logic/buildcost.h 2015-02-09 05:57:46 +0000
@@ -30,7 +30,7 @@
3030
31namespace Widelands {31namespace Widelands {
3232
33struct TribeDescr;33class TribeDescr;
3434
35struct Buildcost : std::map<WareIndex, uint8_t> {35struct Buildcost : std::map<WareIndex, uint8_t> {
36 void parse(const TribeDescr & tribe, Section & buildcost_s);36 void parse(const TribeDescr & tribe, Section & buildcost_s);
3737
=== modified file 'src/logic/building.h'
--- src/logic/building.h 2014-09-29 12:37:07 +0000
+++ src/logic/building.h 2015-02-09 05:57:46 +0000
@@ -47,7 +47,7 @@
4747
48struct Flag;48struct Flag;
49struct Message;49struct Message;
50struct TribeDescr;50class TribeDescr;
51class WaresQueue;51class WaresQueue;
5252
53class Building;53class Building;
5454
=== modified file 'src/logic/editor_game_base.cc'
--- src/logic/editor_game_base.cc 2015-01-31 16:03:59 +0000
+++ src/logic/editor_game_base.cc 2015-02-09 05:57:46 +0000
@@ -32,6 +32,9 @@
32#include "graphic/color.h"32#include "graphic/color.h"
33#include "graphic/font_handler.h"33#include "graphic/font_handler.h"
34#include "graphic/graphic.h"34#include "graphic/graphic.h"
35#include "graphic/image_io.h"
36#include "graphic/texture_atlas.h"
37#include "io/filesystem/layered_filesystem.h"
35#include "logic/battle.h"38#include "logic/battle.h"
36#include "logic/building.h"39#include "logic/building.h"
37#include "logic/constants.h"40#include "logic/constants.h"
@@ -282,7 +285,34 @@
282 tribe_descr->load_graphics();285 tribe_descr->load_graphics();
283 }286 }
284287
285 // TODO(unknown): load player graphics? (maybe)288 // Construct and hold on to the texture atlas that contains all road images.
289 TextureAtlas ta;
290
291 // These will be deleted at the end of the method.
292 std::vector<std::unique_ptr<Texture>> individual_textures_;
293 for (auto* tribe : tribes_) {
294 for (const std::string& texture_path : tribe->normal_road_paths()) {
295 individual_textures_.emplace_back(load_image(texture_path, g_fs));
296 ta.add(*individual_textures_.back());
297 }
298 for (const std::string& texture_path : tribe->busy_road_paths()) {
299 individual_textures_.emplace_back(load_image(texture_path, g_fs));
300 ta.add(*individual_textures_.back());
301 }
302 }
303
304 std::vector<std::unique_ptr<Texture>> textures;
305 road_texture_ = ta.pack(&textures);
306
307 size_t next_texture_to_move = 0;
308 for (auto* tribe : tribes_) {
309 for (size_t i = 0; i < tribe->normal_road_paths().size(); ++i) {
310 tribe->add_normal_road_texture(std::move(textures.at(next_texture_to_move++)));
311 }
312 for (size_t i = 0; i < tribe->busy_road_paths().size(); ++i) {
313 tribe->add_busy_road_texture(std::move(textures.at(next_texture_to_move++)));
314 }
315 }
286}316}
287317
288/**318/**
@@ -516,12 +546,12 @@
516 assert(&first_field <= f.field);546 assert(&first_field <= f.field);
517 assert (f.field < &first_field + m.max_index());547 assert (f.field < &first_field + m.max_index());
518 assert548 assert
519 (direction == Road_SouthWest ||549 (direction == RoadType::kSouthWest ||
520 direction == Road_SouthEast ||550 direction == RoadType::kSouthEast ||
521 direction == Road_East);551 direction == RoadType::kEast);
522 assert552 assert
523 (roadtype == Road_None || roadtype == Road_Normal ||553 (roadtype == RoadType::kNone || roadtype == RoadType::kNormal ||
524 roadtype == Road_Busy || roadtype == Road_Water);554 roadtype == RoadType::kBusy || roadtype == RoadType::kWater);
525555
526 if (f.field->get_road(direction) == roadtype)556 if (f.field->get_road(direction) == roadtype)
527 return;557 return;
@@ -530,17 +560,17 @@
530 FCoords neighbour;560 FCoords neighbour;
531 uint8_t mask = 0;561 uint8_t mask = 0;
532 switch (direction) {562 switch (direction) {
533 case Road_SouthWest:563 case RoadType::kSouthWest:
534 neighbour = m.bl_n(f);564 neighbour = m.bl_n(f);
535 mask = Road_Mask << Road_SouthWest;565 mask = RoadType::kMask << RoadType::kSouthWest;
536 break;566 break;
537 case Road_SouthEast:567 case RoadType::kSouthEast:
538 neighbour = m.br_n(f);568 neighbour = m.br_n(f);
539 mask = Road_Mask << Road_SouthEast;569 mask = RoadType::kMask << RoadType::kSouthEast;
540 break;570 break;
541 case Road_East:571 case RoadType::kEast:
542 neighbour = m. r_n(f);572 neighbour = m. r_n(f);
543 mask = Road_Mask << Road_East;573 mask = RoadType::kMask << RoadType::kEast;
544 break;574 break;
545 default:575 default:
546 assert(false);576 assert(false);
547577
=== modified file 'src/logic/editor_game_base.h'
--- src/logic/editor_game_base.h 2015-01-31 16:03:59 +0000
+++ src/logic/editor_game_base.h 2015-02-09 05:57:46 +0000
@@ -26,6 +26,7 @@
26#include <vector>26#include <vector>
2727
28#include "base/macros.h"28#include "base/macros.h"
29#include "graphic/texture.h"
29#include "logic/bob.h"30#include "logic/bob.h"
30#include "logic/building.h"31#include "logic/building.h"
31#include "logic/map.h"32#include "logic/map.h"
@@ -49,7 +50,7 @@
49struct ObjectManager;50struct ObjectManager;
50class Player;51class Player;
51struct PlayerImmovable;52struct PlayerImmovable;
52struct TribeDescr;53class TribeDescr;
53struct Flag;54struct Flag;
54struct AttackController;55struct AttackController;
5556
@@ -262,9 +263,10 @@
262 uint32_t lasttrackserial_;263 uint32_t lasttrackserial_;
263 std::map<uint32_t, void*> trackpointers_;264 std::map<uint32_t, void*> trackpointers_;
264265
266 std::unique_ptr<Texture> road_texture_;
265267
266 DISALLOW_COPY_AND_ASSIGN(EditorGameBase);268 DISALLOW_COPY_AND_ASSIGN(EditorGameBase);
267 };269};
268270
269#define iterate_players_existing(p, nr_players, egbase, player) \271#define iterate_players_existing(p, nr_players, egbase, player) \
270 iterate_player_numbers( \272 iterate_player_numbers( \
271273
=== modified file 'src/logic/field.h'
--- src/logic/field.h 2014-12-01 21:47:22 +0000
+++ src/logic/field.h 2015-02-09 05:57:46 +0000
@@ -198,10 +198,10 @@
198198
199 int32_t get_roads() const {return roads;}199 int32_t get_roads() const {return roads;}
200 int32_t get_road(int32_t const dir) const {200 int32_t get_road(int32_t const dir) const {
201 return (roads >> dir) & Road_Mask;201 return (roads >> dir) & RoadType::kMask;
202 }202 }
203 void set_road(int32_t const dir, int32_t const type) {203 void set_road(int32_t const dir, int32_t const type) {
204 roads &= ~(Road_Mask << dir);204 roads &= ~(RoadType::kMask << dir);
205 roads |= type << dir;205 roads |= type << dir;
206 }206 }
207207
208208
=== modified file 'src/logic/immovable.h'
--- src/logic/immovable.h 2014-09-14 11:31:58 +0000
+++ src/logic/immovable.h 2015-02-09 05:57:46 +0000
@@ -44,7 +44,7 @@
44class World;44class World;
45struct Flag;45struct Flag;
46struct PlayerImmovable;46struct PlayerImmovable;
47struct TribeDescr;47class TribeDescr;
4848
49struct NoteImmovable {49struct NoteImmovable {
50 CAN_BE_SEND_AS_NOTE(NoteId::Immovable)50 CAN_BE_SEND_AS_NOTE(NoteId::Immovable)
5151
=== modified file 'src/logic/player.cc'
--- src/logic/player.cc 2015-01-31 16:03:59 +0000
+++ src/logic/player.cc 2015-02-09 05:57:46 +0000
@@ -1054,8 +1054,8 @@
1054 Field & tr_field = m_fields[tr.field - &first_map_field];1054 Field & tr_field = m_fields[tr.field - &first_map_field];
1055 if (tr_field.vision <= 1) {1055 if (tr_field.vision <= 1) {
1056 tr_field.terrains.d = tr.field->terrain_d();1056 tr_field.terrains.d = tr.field->terrain_d();
1057 tr_field.roads &= ~(Road_Mask << Road_SouthWest);1057 tr_field.roads &= ~(RoadType::kMask << RoadType::kSouthWest);
1058 tr_field.roads |= Road_Mask << Road_SouthWest & tr.field->get_roads();1058 tr_field.roads |= RoadType::kMask << RoadType::kSouthWest & tr.field->get_roads();
1059 }1059 }
1060 }1060 }
1061 { // discover both triangles and the SE edge of the top left neighbour1061 { // discover both triangles and the SE edge of the top left neighbour
@@ -1063,8 +1063,8 @@
1063 Field & tl_field = m_fields[tl.field - &first_map_field];1063 Field & tl_field = m_fields[tl.field - &first_map_field];
1064 if (tl_field.vision <= 1) {1064 if (tl_field.vision <= 1) {
1065 tl_field.terrains = tl.field->get_terrains();1065 tl_field.terrains = tl.field->get_terrains();
1066 tl_field.roads &= ~(Road_Mask << Road_SouthEast);1066 tl_field.roads &= ~(RoadType::kMask << RoadType::kSouthEast);
1067 tl_field.roads |= Road_Mask << Road_SouthEast & tl.field->get_roads();1067 tl_field.roads |= RoadType::kMask << RoadType::kSouthEast & tl.field->get_roads();
1068 }1068 }
1069 }1069 }
1070 { // discover the R triangle and the E edge of the left neighbour1070 { // discover the R triangle and the E edge of the left neighbour
@@ -1072,8 +1072,8 @@
1072 Field & l_field = m_fields[l.field - &first_map_field];1072 Field & l_field = m_fields[l.field - &first_map_field];
1073 if (l_field.vision <= 1) {1073 if (l_field.vision <= 1) {
1074 l_field.terrains.r = l.field->terrain_r();1074 l_field.terrains.r = l.field->terrain_r();
1075 l_field.roads &= ~(Road_Mask << Road_East);1075 l_field.roads &= ~(RoadType::kMask << RoadType::kEast);
1076 l_field.roads |= Road_Mask << Road_East & l.field->get_roads();1076 l_field.roads |= RoadType::kMask << RoadType::kEast & l.field->get_roads();
1077 }1077 }
1078 }1078 }
1079}1079}
10801080
=== modified file 'src/logic/player.h'
--- src/logic/player.h 2014-12-28 16:45:37 +0000
+++ src/logic/player.h 2015-02-09 05:57:46 +0000
@@ -42,7 +42,7 @@
42class Soldier;42class Soldier;
43class TrainingSite;43class TrainingSite;
44struct Flag;44struct Flag;
45struct TribeDescr;45class TribeDescr;
46struct Road;46struct Road;
47struct AttackController;47struct AttackController;
4848
@@ -246,14 +246,14 @@
246 /// east, as far as this player knows.246 /// east, as far as this player knows.
247 /// Only valid when this player has seen this node or the node to the247 /// Only valid when this player has seen this node or the node to the
248 /// east.248 /// east.
249 uint8_t road_e() const {return roads & Road_Mask;}249 uint8_t road_e() const {return roads & RoadType::kMask;}
250250
251 /// Whether there is a road between this node and the node to the251 /// Whether there is a road between this node and the node to the
252 /// southeast, as far as this player knows.252 /// southeast, as far as this player knows.
253 /// Only valid when this player has seen this node or the node to the253 /// Only valid when this player has seen this node or the node to the
254 /// southeast.254 /// southeast.
255 uint8_t road_se() const {255 uint8_t road_se() const {
256 return roads >> Road_SouthEast & Road_Mask;256 return roads >> RoadType::kSouthEast & RoadType::kMask;
257 }257 }
258258
259 /// Whether there is a road between this node and the node to the259 /// Whether there is a road between this node and the node to the
@@ -261,7 +261,7 @@
261 /// Only valid when this player has seen this node or the node to the261 /// Only valid when this player has seen this node or the node to the
262 /// southwest.262 /// southwest.
263 uint8_t road_sw() const {263 uint8_t road_sw() const {
264 return roads >> Road_SouthWest & Road_Mask;264 return roads >> RoadType::kSouthWest & RoadType::kMask;
265 }265 }
266266
267 /**267 /**
268268
=== modified file 'src/logic/production_program.h'
--- src/logic/production_program.h 2014-11-28 16:40:55 +0000
+++ src/logic/production_program.h 2015-02-09 05:57:46 +0000
@@ -43,7 +43,7 @@
43struct ImmovableDescr;43struct ImmovableDescr;
44struct ProductionSiteDescr;44struct ProductionSiteDescr;
45class ProductionSite;45class ProductionSite;
46struct TribeDescr;46class TribeDescr;
47class Worker;47class Worker;
48class World;48class World;
4949
5050
=== added file 'src/logic/road_textures.cc'
--- src/logic/road_textures.cc 1970-01-01 00:00:00 +0000
+++ src/logic/road_textures.cc 2015-02-09 05:57:46 +0000
@@ -0,0 +1,38 @@
1/*
2 * Copyright (C) 2006-2015 by the Widelands Development Team
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 *
18 */
19
20#include "logic/road_textures.h"
21
22#include <memory>
23
24const Texture& RoadTextures::get_normal_texture(int x, int y, int direction) const {
25 return *normal_textures_.at((x + y + direction) % normal_textures_.size());
26}
27
28const Texture& RoadTextures::get_busy_texture(int x, int y, int direction) const {
29 return *busy_textures_.at((x + y + direction) % busy_textures_.size());
30}
31
32void RoadTextures::add_normal_road_texture(std::unique_ptr<Texture> texture) {
33 normal_textures_.emplace_back(std::move(texture));
34}
35
36void RoadTextures::add_busy_road_texture(std::unique_ptr<Texture> texture) {
37 busy_textures_.emplace_back(std::move(texture));
38}
039
=== added file 'src/logic/road_textures.h'
--- src/logic/road_textures.h 1970-01-01 00:00:00 +0000
+++ src/logic/road_textures.h 2015-02-09 05:57:46 +0000
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2006-2015 by the Widelands Development Team
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 *
18 */
19
20#ifndef WL_LOGIC_ROAD_TEXTURES_H
21#define WL_LOGIC_ROAD_TEXTURES_H
22
23#include <memory>
24#include <vector>
25
26#include "graphic/texture.h"
27
28// Simple container to give access of the road textures of a tribe.
29class RoadTextures {
30public:
31 // Returns the road texture that should be used for the Cooordinate x, y and
32 // the road going into direction 'direction' (which can be any number).
33 const Texture& get_normal_texture(int x, int y, int direction) const;
34 const Texture& get_busy_texture(int x, int y, int direction) const;
35
36 // Adds a new road texture.
37 void add_normal_road_texture(std::unique_ptr<Texture> texture);
38 void add_busy_road_texture(std::unique_ptr<Texture> texture);
39
40private:
41 std::vector<std::unique_ptr<Texture>> normal_textures_;
42 std::vector<std::unique_ptr<Texture>> busy_textures_;
43};
44
45#endif // end of include guard: WL_LOGIC_ROAD_TEXTURES_H
046
=== modified file 'src/logic/roadtype.h'
--- src/logic/roadtype.h 2014-11-01 20:40:39 +0000
+++ src/logic/roadtype.h 2015-02-09 05:57:46 +0000
@@ -30,15 +30,15 @@
30// the drawing code to keep around what kind of road it should draw. I guess30// the drawing code to keep around what kind of road it should draw. I guess
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.
32enum RoadType {32enum RoadType {
33 Road_None = 0,33 kNone = 0,
34 Road_Normal = 1,34 kNormal = 1,
35 Road_Busy = 2,35 kBusy = 2,
36 Road_Water = 3,36 kWater = 3,
37 Road_Mask = 3,37 kMask = 3,
3838
39 Road_East = 0, // shift values39 kEast = 0, // shift values
40 Road_SouthEast = 2,40 kSouthEast = 2,
41 Road_SouthWest = 4,41 kSouthWest = 4,
42};42};
4343
44}44}
4545
=== modified file 'src/logic/tribe.cc'
--- src/logic/tribe.cc 2015-01-31 16:03:59 +0000
+++ src/logic/tribe.cc 2015-02-09 05:57:46 +0000
@@ -28,10 +28,12 @@
2828
29#include "base/i18n.h"29#include "base/i18n.h"
30#include "base/macros.h"30#include "base/macros.h"
31#include "base/wexception.h"
31#include "graphic/graphic.h"32#include "graphic/graphic.h"
32#include "helper.h"33#include "helper.h"
33#include "io/fileread.h"34#include "io/fileread.h"
34#include "io/filesystem/disk_filesystem.h"35#include "io/filesystem/disk_filesystem.h"
36#include "io/filesystem/filesystem.h"
35#include "io/filesystem/layered_filesystem.h"37#include "io/filesystem/layered_filesystem.h"
36#include "logic/carrier.h"38#include "logic/carrier.h"
37#include "logic/constructionsite.h"39#include "logic/constructionsite.h"
@@ -235,6 +237,33 @@
235 PARSE_ORDER_INFORMATION(worker);237 PARSE_ORDER_INFORMATION(worker);
236 }238 }
237239
240 {
241 Section road_s = root_conf.get_safe_section("roads");
242 const auto load_roads = [&road_s, this](
243 const std::string& prefix, std::vector<std::string>* images) {
244 for (int i = 0; i < 99; ++i) {
245 const char* img =
246 road_s.get_string((boost::format("%s_%02i") % prefix % i).str().c_str(), nullptr);
247 if (img == nullptr) {
248 break;
249 }
250 if (!g_fs->file_exists(img)) {
251 throw new GameDataError("File %s for roadtype %s in tribe %s does not exist",
252 img,
253 prefix.c_str(),
254 m_name.c_str());
255 }
256 images->emplace_back(img);
257 }
258 if (images->empty()) {
259 throw new GameDataError(
260 "No %s roads defined in tribe %s.", prefix.c_str(), m_name.c_str());
261 }
262 };
263 load_roads("normal", &m_normal_road_paths);
264 load_roads("busy", &m_busy_road_paths);
265 }
266
238 m_frontier_animation_id =267 m_frontier_animation_id =
239 g_gr->animations().load(path, root_conf.get_safe_section("frontier"));268 g_gr->animations().load(path, root_conf.get_safe_section("frontier"));
240 m_flag_animation_id =269 m_flag_animation_id =
@@ -292,6 +321,27 @@
292 m_buildings.get(i)->load_graphics();321 m_buildings.get(i)->load_graphics();
293}322}
294323
324const std::vector<std::string>& TribeDescr::normal_road_paths() const {
325 return m_normal_road_paths;
326}
327
328const std::vector<std::string>& TribeDescr::busy_road_paths() const {
329 return m_busy_road_paths;
330}
331
332
333void TribeDescr::add_normal_road_texture(std::unique_ptr<Texture> texture) {
334 m_road_textures.add_normal_road_texture(std::move(texture));
335}
336
337void TribeDescr::add_busy_road_texture(std::unique_ptr<Texture> texture) {
338 m_road_textures.add_busy_road_texture(std::move(texture));
339}
340
341const RoadTextures& TribeDescr::road_textures() const {
342 return m_road_textures;
343}
344
295345
296/*346/*
297 * does this tribe exist?347 * does this tribe exist?
298348
=== modified file 'src/logic/tribe.h'
--- src/logic/tribe.h 2014-09-14 11:31:58 +0000
+++ src/logic/tribe.h 2015-02-09 05:57:46 +0000
@@ -21,14 +21,18 @@
21#define WL_LOGIC_TRIBE_H21#define WL_LOGIC_TRIBE_H
2222
23#include <map>23#include <map>
24#include <memory>
24#include <vector>25#include <vector>
2526
26#include "base/macros.h"27#include "base/macros.h"
27#include "graphic/animation.h"28#include "graphic/animation.h"
29#include "graphic/texture.h"
28#include "logic/bob.h"30#include "logic/bob.h"
29#include "logic/building.h"31#include "logic/building.h"
30#include "logic/description_maintainer.h"32#include "logic/description_maintainer.h"
31#include "logic/immovable.h"33#include "logic/immovable.h"
34#include "logic/road_textures.h"
35#include "logic/roadtype.h"
32#include "logic/tribe_basic_info.h"36#include "logic/tribe_basic_info.h"
33#include "logic/ware_descr.h"37#include "logic/ware_descr.h"
34#include "logic/worker.h"38#include "logic/worker.h"
@@ -52,7 +56,8 @@
52buildings it can build and the associated graphics.56buildings it can build and the associated graphics.
53Two players can choose the same tribe.57Two players can choose the same tribe.
54*/58*/
55struct TribeDescr {59class TribeDescr {
60public:
56 TribeDescr(const std::string & name, EditorGameBase &);61 TribeDescr(const std::string & name, EditorGameBase &);
5762
58 // Static function to check for tribes.63 // Static function to check for tribes.
@@ -62,7 +67,20 @@
62 static std::vector<TribeBasicInfo> get_all_tribe_infos();67 static std::vector<TribeBasicInfo> get_all_tribe_infos();
6368
6469
65 const std::string & name() const {return m_name;}70 const std::string& name() const {return m_name;}
71
72 // A vector of all texture images that can be used for drawing a
73 // (normal|busy) road. The images are guaranteed to exist.
74 const std::vector<std::string>& normal_road_paths() const;
75 const std::vector<std::string>& busy_road_paths() const;
76
77 // Add the corresponding texture (which probably resides in a
78 // texture atlas) for roads.
79 void add_normal_road_texture(std::unique_ptr<Texture> texture);
80 void add_busy_road_texture(std::unique_ptr<Texture> texture);
81
82 // The road textures used for drawing roads.
83 const RoadTextures& road_textures() const;
6684
67 WareIndex get_nrworkers() const {return m_workers.get_nitems();}85 WareIndex get_nrworkers() const {return m_workers.get_nitems();}
68 WorkerDescr const * get_worker_descr(const WareIndex& index) const {86 WorkerDescr const * get_worker_descr(const WareIndex& index) const {
@@ -174,6 +192,11 @@
174192
175private:193private:
176 const std::string m_name;194 const std::string m_name;
195
196 std::vector<std::string> m_normal_road_paths;
197 std::vector<std::string> m_busy_road_paths;
198 RoadTextures m_road_textures;
199
177 uint32_t m_frontier_animation_id;200 uint32_t m_frontier_animation_id;
178 uint32_t m_flag_animation_id;201 uint32_t m_flag_animation_id;
179 uint32_t m_bob_vision_range;202 uint32_t m_bob_vision_range;
180203
=== modified file 'src/logic/ware_descr.h'
--- src/logic/ware_descr.h 2014-09-10 08:55:04 +0000
+++ src/logic/ware_descr.h 2015-02-09 05:57:46 +0000
@@ -39,7 +39,7 @@
3939
40namespace Widelands {40namespace Widelands {
4141
42struct TribeDescr;42class TribeDescr;
4343
44/**44/**
45 * Wares can be stored in warehouses. They can be transferred across an45 * Wares can be stored in warehouses. They can be transferred across an
4646
=== modified file 'src/logic/warehouse.h'
--- src/logic/warehouse.h 2014-09-19 12:54:54 +0000
+++ src/logic/warehouse.h 2015-02-09 05:57:46 +0000
@@ -38,7 +38,7 @@
38class Request;38class Request;
39struct Requirements;39struct Requirements;
40class Soldier;40class Soldier;
41struct TribeDescr;41class TribeDescr;
42class WareInstance;42class WareInstance;
43struct WareList;43struct WareList;
4444
4545
=== modified file 'src/logic/worker_descr.h'
--- src/logic/worker_descr.h 2014-09-19 12:54:54 +0000
+++ src/logic/worker_descr.h 2015-02-09 05:57:46 +0000
@@ -37,7 +37,7 @@
3737
38class WorkerDescr : public BobDescr38class WorkerDescr : public BobDescr
39{39{
40 friend struct TribeDescr;40 friend class TribeDescr;
41 friend class Warehouse;41 friend class Warehouse;
42 friend struct WorkerProgram;42 friend struct WorkerProgram;
4343
4444
=== modified file 'src/map_io/map_players_view_packet.cc'
--- src/map_io/map_players_view_packet.cc 2014-10-27 10:14:10 +0000
+++ src/map_io/map_players_view_packet.cc 2015-02-09 05:57:46 +0000
@@ -485,11 +485,11 @@
485 { // edges485 { // edges
486 uint8_t mask = 0;486 uint8_t mask = 0;
487 if (f_vision | bl_vision)487 if (f_vision | bl_vision)
488 mask = Road_Mask << Road_SouthWest;488 mask = RoadType::kMask << RoadType::kSouthWest;
489 if (f_vision | br_vision)489 if (f_vision | br_vision)
490 mask |= Road_Mask << Road_SouthEast;490 mask |= RoadType::kMask << RoadType::kSouthEast;
491 if (f_vision | r_vision)491 if (f_vision | r_vision)
492 mask |= Road_Mask << Road_East;492 mask |= RoadType::kMask << RoadType::kEast;
493 f_player_field.roads = f.field->get_roads() & mask;493 f_player_field.roads = f.field->get_roads() & mask;
494 }494 }
495495
@@ -816,17 +816,17 @@
816 { // edges816 { // edges
817 uint8_t mask = 0;817 uint8_t mask = 0;
818 if (f_seen | bl_seen) {818 if (f_seen | bl_seen) {
819 mask = Road_Mask << Road_SouthWest;819 mask = RoadType::kMask << RoadType::kSouthWest;
820 } else if (f_everseen | bl_everseen) {820 } else if (f_everseen | bl_everseen) {
821 // The player has seen the SouthWest edge but does not see821 // The player has seen the SouthWest edge but does not see
822 // it now. Load his information about this edge from file.822 // it now. Load his information about this edge from file.
823 if (road_file_version < 2) {823 if (road_file_version < 2) {
824 try {roads = legacy_road_bitbuffer.get() << Road_SouthWest;}824 try {roads = legacy_road_bitbuffer.get() << RoadType::kSouthWest;}
825 catch (const FileRead::FileBoundaryExceeded &) {825 catch (const FileRead::FileBoundaryExceeded &) {
826 throw GameDataError826 throw GameDataError
827 ("MapPlayersViewPacket::read: player %u: in "827 ("MapPlayersViewPacket::read: player %u: in "
828 "\"%s\": node (%i, %i): unexpected end of file while "828 "\"%s\": node (%i, %i): unexpected end of file while "
829 "reading Road_SouthWest",829 "reading RoadType::kSouthWest",
830 plnum, roads_filename, f.x, f.y);830 plnum, roads_filename, f.x, f.y);
831 }831 }
832 } else {832 } else {
@@ -834,17 +834,17 @@
834 }834 }
835 }835 }
836 if (f_seen | br_seen) {836 if (f_seen | br_seen) {
837 mask |= Road_Mask << Road_SouthEast;837 mask |= RoadType::kMask << RoadType::kSouthEast;
838 } else if (f_everseen | br_everseen) {838 } else if (f_everseen | br_everseen) {
839 // The player has seen the SouthEast edge but does not see839 // The player has seen the SouthEast edge but does not see
840 // it now. Load his information about this edge from file.840 // it now. Load his information about this edge from file.
841 if (road_file_version < 2) {841 if (road_file_version < 2) {
842 try {roads |= legacy_road_bitbuffer.get() << Road_SouthEast;}842 try {roads |= legacy_road_bitbuffer.get() << RoadType::kSouthEast;}
843 catch (const FileRead::FileBoundaryExceeded &) {843 catch (const FileRead::FileBoundaryExceeded &) {
844 throw GameDataError844 throw GameDataError
845 ("MapPlayersViewPacket::read: player %u: in "845 ("MapPlayersViewPacket::read: player %u: in "
846 "\"%s\": node (%i, %i): unexpected end of file while "846 "\"%s\": node (%i, %i): unexpected end of file while "
847 "reading Road_SouthEast",847 "reading RoadType::kSouthEast",
848 plnum, roads_filename, f.x, f.y);848 plnum, roads_filename, f.x, f.y);
849 }849 }
850 } else {850 } else {
@@ -852,17 +852,17 @@
852 }852 }
853 }853 }
854 if (f_seen | r_seen) {854 if (f_seen | r_seen) {
855 mask |= Road_Mask << Road_East;855 mask |= RoadType::kMask << RoadType::kEast;
856 } else if (f_everseen | r_everseen) {856 } else if (f_everseen | r_everseen) {
857 // The player has seen the East edge but does not see857 // The player has seen the East edge but does not see
858 // it now. Load his information about this edge from file.858 // it now. Load his information about this edge from file.
859 if (road_file_version < 2) {859 if (road_file_version < 2) {
860 try {roads |= legacy_road_bitbuffer.get() << Road_East;}860 try {roads |= legacy_road_bitbuffer.get() << RoadType::kEast;}
861 catch (const FileRead::FileBoundaryExceeded &) {861 catch (const FileRead::FileBoundaryExceeded &) {
862 throw GameDataError862 throw GameDataError
863 ("MapPlayersViewPacket::read: player %u: in "863 ("MapPlayersViewPacket::read: player %u: in "
864 "\"%s\": node (%i, %i): unexpected end of file while "864 "\"%s\": node (%i, %i): unexpected end of file while "
865 "reading Road_East",865 "reading RoadType::kEast",
866 plnum, roads_filename, f.x, f.y);866 plnum, roads_filename, f.x, f.y);
867 }867 }
868 } else {868 } else {
869869
=== modified file 'src/scripting/lua_game.h'
--- src/scripting/lua_game.h 2015-01-31 16:03:59 +0000
+++ src/scripting/lua_game.h 2015-02-09 05:57:46 +0000
@@ -27,7 +27,7 @@
27#include "scripting/luna.h"27#include "scripting/luna.h"
2828
29namespace Widelands {29namespace Widelands {
30 struct TribeDescr;30 class TribeDescr;
31 class Objective;31 class Objective;
32 struct Message;32 struct Message;
33}33}
3434
=== modified file 'src/scripting/lua_map.cc'
--- src/scripting/lua_map.cc 2015-01-31 16:03:59 +0000
+++ src/scripting/lua_map.cc 2015-02-09 05:57:46 +0000
@@ -220,7 +220,7 @@
220 WorkersMap valid_workers;220 WorkersMap valid_workers;
221 valid_workers.insert(WorkerAmount(r.owner().tribe().worker_index("carrier"), 1));221 valid_workers.insert(WorkerAmount(r.owner().tribe().worker_index("carrier"), 1));
222222
223 if (r.get_roadtype() == Road_Busy)223 if (r.get_roadtype() == RoadType::kBusy)
224 valid_workers.insert(WorkerAmount(r.owner().tribe().carrier2(), 1));224 valid_workers.insert(WorkerAmount(r.owner().tribe().carrier2(), 1));
225225
226 return valid_workers;226 return valid_workers;
@@ -2531,9 +2531,9 @@
2531*/2531*/
2532int LuaRoad::get_road_type(lua_State * L) {2532int LuaRoad::get_road_type(lua_State * L) {
2533 switch (get(L, get_egbase(L))->get_roadtype()) {2533 switch (get(L, get_egbase(L))->get_roadtype()) {
2534 case Road_Normal:2534 case RoadType::kNormal:
2535 lua_pushstring(L, "normal"); break;2535 lua_pushstring(L, "normal"); break;
2536 case Road_Busy:2536 case RoadType::kBusy:
2537 lua_pushstring(L, "busy"); break;2537 lua_pushstring(L, "busy"); break;
2538 default:2538 default:
2539 report_error(L, "Unknown Roadtype! This is a bug in widelands!");2539 report_error(L, "Unknown Roadtype! This is a bug in widelands!");
25402540
=== modified file 'src/wui/encyclopedia_window.h'
--- src/wui/encyclopedia_window.h 2014-09-20 09:37:47 +0000
+++ src/wui/encyclopedia_window.h 2015-02-09 05:57:46 +0000
@@ -29,7 +29,7 @@
2929
30namespace Widelands {30namespace Widelands {
31struct WareDescr;31struct WareDescr;
32struct TribeDescr;32class TribeDescr;
33}33}
3434
35class InteractivePlayer;35class InteractivePlayer;
3636
=== modified file 'src/wui/interactive_base.cc'
--- src/wui/interactive_base.cc 2015-01-31 16:03:59 +0000
+++ src/wui/interactive_base.cc 2015-02-09 05:57:46 +0000
@@ -767,7 +767,7 @@
767 int32_t const shift = 2 * (dir - Widelands::WALK_E);767 int32_t const shift = 2 * (dir - Widelands::WALK_E);
768768
769 uint8_t set_to = overlay_manager.get_road_overlay(c);769 uint8_t set_to = overlay_manager.get_road_overlay(c);
770 set_to |= Widelands::Road_Normal << shift;770 set_to |= Widelands::RoadType::kNormal << shift;
771 overlay_manager.register_road_overlay(c, set_to, m_jobid);771 overlay_manager.register_road_overlay(c, set_to, m_jobid);
772 }772 }
773773
774774
=== modified file 'src/wui/waresdisplay.h'
--- src/wui/waresdisplay.h 2014-09-14 11:31:58 +0000
+++ src/wui/waresdisplay.h 2015-02-09 05:57:46 +0000
@@ -32,7 +32,7 @@
32namespace UI {struct Textarea;}32namespace UI {struct Textarea;}
3333
34namespace Widelands {34namespace Widelands {
35struct TribeDescr;35class TribeDescr;
36struct WareList;36struct WareList;
37}37}
3838
3939
=== modified file 'tribes/atlanteans/conf'
--- tribes/atlanteans/conf 2014-08-26 17:25:00 +0000
+++ tribes/atlanteans/conf 2015-02-09 05:57:46 +0000
@@ -8,12 +8,18 @@
8uiposition=1008uiposition=100
9carrier2=horse9carrier2=horse
10icon=pics/icon.png10icon=pics/icon.png
11
11# Wares and workers positions in wares window. Columns are separated by ;,12# Wares and workers positions in wares window. Columns are separated by ;,
12# Entries in the columns separated by ,13# Entries in the columns separated by ,
13wares_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_tabard14wares_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
1415
15workers_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, scout16workers_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
1617
18# Image file paths for this tribe's road textures
19[roads]
20busy_00=tribes/atlanteans/pics/roadt_busy.png
21normal_00=tribes/atlanteans/pics/roadt_normal.png
22
17# Some blue fires would be fine, but just an idea23# Some blue fires would be fine, but just an idea
18[frontier]24[frontier]
19pics=pics/frontier_??.png25pics=pics/frontier_??.png
2026
=== added file 'tribes/atlanteans/pics/roadt_busy.png'
21Binary 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 differ27Binary 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
=== added file 'tribes/atlanteans/pics/roadt_normal.png'
22Binary 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 differ28Binary 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
=== modified file 'tribes/barbarians/conf'
--- tribes/barbarians/conf 2014-08-26 17:25:00 +0000
+++ tribes/barbarians/conf 2015-02-09 05:57:46 +0000
@@ -8,12 +8,17 @@
8uiposition=108uiposition=10
9carrier2=ox9carrier2=ox
10icon=pics/icon.png10icon=pics/icon.png
11
11# Wares and workers positions in wares window. Columns are separated by ;,12# Wares and workers positions in wares window. Columns are separated by ;,
12# Entries in the columns separated by ,13# Entries in the columns separated by ,
13wares_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 , warhelm14wares_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
1415
15workers_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, scout16workers_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
1617
18# Image file paths for this tribe's road textures
19[roads]
20busy_00=tribes/barbarians/pics/roadt_busy.png
21normal_00=tribes/barbarians/pics/roadt_normal.png
1722
18[frontier]23[frontier]
19pics=pics/frontier_??.png24pics=pics/frontier_??.png
2025
=== added file 'tribes/barbarians/pics/roadt_busy.png'
21Binary 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 differ26Binary 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
=== added file 'tribes/barbarians/pics/roadt_normal.png'
22Binary 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 differ27Binary 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
=== modified file 'tribes/empire/conf'
--- tribes/empire/conf 2014-08-26 17:25:00 +0000
+++ tribes/empire/conf 2015-02-09 05:57:46 +0000
@@ -8,12 +8,20 @@
8uiposition=208uiposition=20
9carrier2=donkey9carrier2=donkey
10icon=pics/icon.png10icon=pics/icon.png
11
11# Wares and workers positions in wares window. Columns are separated by ;,12# Wares and workers positions in wares window. Columns are separated by ;,
12# Entries in the columns separated by ,13# Entries in the columns separated by ,
13wares_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_armor14wares_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
1415
15workers_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, scout16workers_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
1617
18# Image file paths for this tribe's road textures
19[roads]
20busy_00=tribes/empire/pics/roadt_busy.png
21normal_00=tribes/empire/pics/roadt_normal_00.png
22normal_01=tribes/empire/pics/roadt_normal_01.png
23normal_02=tribes/empire/pics/roadt_normal_02.png
24
17# No idea for the frontier. Maybe some javelins?25# No idea for the frontier. Maybe some javelins?
18[frontier]26[frontier]
19pics=pics/frontier_??.png27pics=pics/frontier_??.png
2028
=== added file 'tribes/empire/pics/roadt_busy.png'
21Binary 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 differ29Binary 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
=== added file 'tribes/empire/pics/roadt_normal_00.png'
22Binary 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 differ30Binary 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
=== added file 'tribes/empire/pics/roadt_normal_01.png'
23Binary 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 differ31Binary 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
=== added file 'tribes/empire/pics/roadt_normal_02.png'
24Binary 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 differ32Binary 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
=== removed file 'world/pics/roadt_busy.png'
25Binary 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 differ33Binary 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
=== removed file 'world/pics/roadt_normal.png'
26Binary 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 differ34Binary 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

Subscribers

People subscribed via source and target branches

to status/vote changes: