Project Alice
Loading...
Searching...
No Matches
map.hpp
Go to the documentation of this file.
1#pragma once
2
3#ifndef GLEW_STATIC
4#define GLEW_STATIC
5#endif
6#include "glew.h"
7
8#include "map_modes.hpp"
9#include "opengl_wrapper.hpp"
10#include <glm/vec2.hpp>
11#include <glm/mat4x4.hpp>
12
13namespace sys {
14struct state;
15};
16namespace parsers {
17struct scenario_building_context;
18};
19
20namespace map {
21
22struct map_vertex {
23 map_vertex(float x, float y) : position_(x, y){};
24 glm::vec2 position_;
25};
27 screen_vertex(float x, float y) : position_(x, y){};
28 glm::vec2 position_;
29};
30
33 curved_line_vertex(glm::vec2 position, glm::vec2 normal_direction, glm::vec2 direction, glm::vec2 texture_coord, float type)
34 : position_(position), normal_direction_(normal_direction), direction_(direction), texture_coord_(texture_coord), type_{type} {};
35 glm::vec2 position_;
37 glm::vec2 direction_;
38 glm::vec2 texture_coord_;
39 float type_ = 0.f;
40};
41
43 glm::vec2 position_;
46 float distance_ = 0.f;
47};
48
50 glm::vec2 position_;
53 float distance_ = 0.f;
54 float width_ = 0.f;
55};
56
58 glm::vec2 position;
59 glm::vec2 previous_point;
60 glm::vec2 next_point;
61 float texture_coordinate = 0.f;
62 float distance = 0.f;
63};
64
67 text_line_vertex(glm::vec2 position, glm::vec2 normal_direction, glm::vec2 direction, glm::vec3 texture_coord, float thickness)
68 : position_(position), normal_direction_(normal_direction), direction_(direction), texture_coord_(texture_coord), thickness_{ thickness } { };
69 glm::vec2 position_;
71 glm::vec2 direction_;
72 glm::vec3 texture_coord_;
73 float thickness_ = 0.f;
74};
75
78 text_line_generator_data(text::stored_glyphs&& text_, glm::vec4 coeff_, glm::vec2 basis_, glm::vec2 ratio_) : text(std::move(text_)), coeff{ coeff_ }, basis{ basis_ }, ratio{ ratio_ } { };
80 glm::vec4 coeff{0.f};
81 glm::vec2 basis{0.f};
82 glm::vec2 ratio{0.f};
83};
84
85struct border {
86 int start_index = 0;
87 int count = 0;
88 dcon::province_adjacency_id adj;
89 uint16_t padding = 0;
90};
91
92enum class map_view;
94public:
97
98 // Called to load the terrain and province map data
100 // Called to load the map. Will load the texture and shaders from disk
101 void load_map(sys::state& state);
102
103 void render(sys::state& state, glm::vec2 screen_size, glm::vec2 offset, float zoom, map_view map_view_mode, map_mode::mode active_map_mode,
104 glm::mat3 globe_rotation, float time_counter);
105 void update_borders(sys::state& state);
106 void update_fog_of_war(sys::state& state);
107 void set_selected_province(sys::state& state, dcon::province_id province_id);
108 void set_province_color(std::vector<uint32_t> const& prov_color);
109 void set_drag_box(bool draw_box, glm::vec2 pos1, glm::vec2 pos2, glm::vec2 pixel_size);
111 void set_text_lines(sys::state& state, std::vector<text_line_generator_data> const& data);
112 void set_province_text_lines(sys::state& state, std::vector<text_line_generator_data> const& data);
113
114 std::vector<border> borders;
115 std::vector<textured_line_vertex_b> border_vertices;
116 std::vector<textured_line_with_width_vertex> river_vertices;
117 std::vector<GLint> river_starts;
118 std::vector<GLsizei> river_counts;
119 std::vector<textured_line_vertex> railroad_vertices;
120 std::vector<GLint> railroad_starts;
121 std::vector<GLsizei> railroad_counts;
122 std::vector<textured_line_vertex_b> coastal_vertices;
123 std::vector<GLint> coastal_starts;
124 std::vector<GLsizei> coastal_counts;
125 std::vector<GLint> static_mesh_starts;
126 std::vector<GLsizei> static_mesh_counts;
127 //
128 std::vector<curved_line_vertex> unit_arrow_vertices;
129 std::vector<GLint> unit_arrow_starts;
130 std::vector<GLsizei> unit_arrow_counts;
131 //
132 std::vector<curved_line_vertex> attack_unit_arrow_vertices;
133 std::vector<GLint> attack_unit_arrow_starts;
134 std::vector<GLsizei> attack_unit_arrow_counts;
135 //
136 std::vector<curved_line_vertex> retreat_unit_arrow_vertices;
137 std::vector<GLint> retreat_unit_arrow_starts;
138 std::vector<GLsizei> retreat_unit_arrow_counts;
139 //
140 std::vector<curved_line_vertex> strategy_unit_arrow_vertices;
141 std::vector<GLint> strategy_unit_arrow_starts;
142 std::vector<GLsizei> strategy_unit_arrow_counts;
143 //
144 std::vector<curved_line_vertex> objective_unit_arrow_vertices;
145 std::vector<GLint> objective_unit_arrow_starts;
146 std::vector<GLsizei> objective_unit_arrow_counts;
147 //
148 std::vector<curved_line_vertex> other_objective_unit_arrow_vertices;
151 //
152 std::vector<GLuint> text_line_texture_per_quad;
153 std::vector<text_line_vertex> text_line_vertices;
154 std::vector<text_line_vertex> province_text_line_vertices;
155 std::vector<screen_vertex> drag_box_vertices;
156 std::vector<uint8_t> terrain_id_map;
157 std::vector<uint8_t> median_terrain_type;
158 std::vector<uint32_t> province_area;
159 std::vector<uint8_t> diagonal_borders;
160
161 // map pixel -> province id
162 std::vector<uint16_t> province_id_map;
163 std::vector<uint16_t> map_indices;
164
165 // province id mask to detect seas
166 std::vector<uint32_t> province_id_sea_mask;
167
171
172 // Meshes
173 static constexpr uint32_t vo_land = 0;
174 static constexpr uint32_t vo_border = 1;
175 static constexpr uint32_t vo_river = 2;
176 static constexpr uint32_t vo_unit_arrow = 3;
177 static constexpr uint32_t vo_text_line = 4;
178 static constexpr uint32_t vo_drag_box = 5;
179 static constexpr uint32_t vo_coastal = 6;
180 static constexpr uint32_t vo_railroad = 7;
181 static constexpr uint32_t vo_static_mesh = 8;
182 static constexpr uint32_t vo_province_text_line = 9;
183 static constexpr uint32_t vo_attack_unit_arrow = 10;
184 static constexpr uint32_t vo_retreat_unit_arrow = 11;
185 static constexpr uint32_t vo_strategy_unit_arrow = 12;
186 static constexpr uint32_t vo_objective_unit_arrow = 13;
188 static constexpr uint32_t vo_count = 15;
189 GLuint vao_array[vo_count] = { 0 };
190 GLuint vbo_array[vo_count] = { 0 };
191 // Textures
192 static constexpr uint32_t texture_provinces = 0;
193 static constexpr uint32_t texture_terrain = 1;
194 static constexpr uint32_t texture_water_normal = 2;
195 static constexpr uint32_t texture_colormap_water = 3;
196 static constexpr uint32_t texture_colormap_terrain = 4;
198 static constexpr uint32_t texture_overlay = 6;
200 static constexpr uint32_t texture_stripes = 8;
201 static constexpr uint32_t texture_river_body = 9;
202 static constexpr uint32_t texture_national_border = 10;
203 static constexpr uint32_t texture_state_border = 11;
204 static constexpr uint32_t texture_prov_border = 12;
205 static constexpr uint32_t texture_imp_border = 13;
206 static constexpr uint32_t texture_unit_arrow = 14;
207 static constexpr uint32_t texture_province_fow = 15;
208 static constexpr uint32_t texture_coastal_border = 16;
210 static constexpr uint32_t texture_railroad = 18;
211 static constexpr uint32_t texture_attack_unit_arrow = 19;
216 static constexpr uint32_t texture_hover_border = 24;
217 static constexpr uint32_t texture_sea_mask = 25;
218 static constexpr uint32_t texture_count = 26;
219 GLuint textures[texture_count] = { 0 };
220 // Texture Array
223 static constexpr uint32_t texture_array_count = 2;
225 // Shaders
226 static constexpr uint32_t shader_terrain = 0;
227 static constexpr uint32_t shader_line_border = 1;
228 static constexpr uint32_t shader_textured_line = 2;
229 static constexpr uint32_t shader_line_unit_arrow = 3;
230 static constexpr uint32_t shader_text_line = 4;
231 static constexpr uint32_t shader_drag_box = 5;
232 static constexpr uint32_t shader_borders = 6;
233 static constexpr uint32_t shader_railroad_line = 7;
236 static constexpr uint32_t shader_count = 10;
237 GLuint shaders[shader_count] = { 0 };
238
239 static constexpr uint32_t uniform_offset = 0;
240 static constexpr uint32_t uniform_aspect_ratio = 1;
241 static constexpr uint32_t uniform_zoom = 2;
242 static constexpr uint32_t uniform_map_size = 3;
243 static constexpr uint32_t uniform_rotation = 4;
244 static constexpr uint32_t uniform_gamma = 5;
246 static constexpr uint32_t uniform_time = 7;
247 //
251 static constexpr uint32_t uniform_water_normal = 11;
252 static constexpr uint32_t uniform_colormap_water = 12;
253 static constexpr uint32_t uniform_colormap_terrain = 13;
254 static constexpr uint32_t uniform_overlay = 14;
255 static constexpr uint32_t uniform_province_color = 15;
258 static constexpr uint32_t uniform_stripes_texture = 18;
259 static constexpr uint32_t uniform_province_fow = 19;
261 static constexpr uint32_t uniform_width = 21;
263 static constexpr uint32_t uniform_line_texture = 23;
264 static constexpr uint32_t uniform_texture_sampler = 24;
265 static constexpr uint32_t uniform_opaque = 25;
266 static constexpr uint32_t uniform_is_black = 26;
267 static constexpr uint32_t uniform_border_width = 27;
268 static constexpr uint32_t uniform_unit_arrow = 28;
269 static constexpr uint32_t uniform_model_offset = 29;
270 static constexpr uint32_t uniform_target_facing = 30;
273 static constexpr uint32_t uniform_count = 33;
275
276 // models: Textures for static meshes
277 static constexpr uint32_t max_static_meshes = 42;
279
286
287 uint16_t safe_get_province(glm::ivec2 pt);
288 void make_coastal_borders(sys::state& state, std::vector<bool>& visited);
289 void make_borders(sys::state& state, std::vector<bool>& visited);
290
292 void create_meshes();
293 void gen_prov_color_texture(GLuint texture_handle, std::vector<uint32_t> const& prov_color, uint8_t layers = 1);
294
295 void create_curved_river_vertices(parsers::scenario_building_context& context, std::vector<uint8_t> const& river_data, std::vector<uint8_t> const& terrain_data);
296};
297
298void load_river_crossings(parsers::scenario_building_context& context, std::vector<uint8_t> const& river_data, glm::ivec2 map_size);
299
300void make_navy_path(sys::state& state, std::vector<map::curved_line_vertex>& buffer, dcon::navy_id selected_navy, float size_x, float size_y);
301void make_army_path(sys::state& state, std::vector<map::curved_line_vertex>& buffer, dcon::army_id selected_army, float size_x, float size_y);
302glm::vec2 put_in_local(glm::vec2 new_point, glm::vec2 base_point, float size_x);
303void add_bezier_to_buffer(std::vector<map::curved_line_vertex>& buffer, glm::vec2 start, glm::vec2 end, glm::vec2 start_per, glm::vec2 end_per, float progress, bool last_curve, float size_x, float size_y, uint32_t num_b_segments);
304void add_tl_bezier_to_buffer(std::vector<map::textured_line_vertex>& buffer, glm::vec2 start, glm::vec2 end, glm::vec2 start_per, glm::vec2 end_per, float progress, bool last_curve, float size_x, float size_y, uint32_t num_b_segments, float& distance);
305void add_tl_bezier_to_buffer(std::vector<map::textured_line_with_width_vertex>& buffer, glm::vec2 start, glm::vec2 end, glm::vec2 start_tangent, glm::vec2 end_tangent, float progress, bool last_curve, float size_x, float size_y, uint32_t num_b_segments, float& distance, float width_start, float width_end);
306
307} // namespace map
std::vector< textured_line_with_width_vertex > river_vertices
Definition: map.hpp:116
static constexpr uint32_t texture_diag_border_identifier
Definition: map.hpp:209
static constexpr uint32_t uniform_texture_sampler
Definition: map.hpp:264
void update_railroad_paths(sys::state &state)
Definition: map.cpp:1707
static constexpr uint32_t uniform_colormap_water
Definition: map.hpp:252
static constexpr uint32_t shader_textured_line
Definition: map.hpp:228
static constexpr uint32_t texture_strategy_unit_arrow
Definition: map.hpp:213
void load_terrain_data(parsers::scenario_building_context &context)
std::vector< GLsizei > river_counts
Definition: map.hpp:118
void load_shaders(simple_fs::directory &root)
Definition: map.cpp:375
static constexpr uint32_t texture_array_province_color
Definition: map.hpp:222
GLuint texture_arrays[texture_array_count]
Definition: map.hpp:224
static constexpr uint32_t uniform_rotation
Definition: map.hpp:243
static constexpr uint32_t uniform_overlay
Definition: map.hpp:254
static constexpr uint32_t texture_sea_mask
Definition: map.hpp:217
static constexpr uint32_t shader_line_border
Definition: map.hpp:227
static constexpr uint32_t vo_coastal
Definition: map.hpp:179
std::vector< GLsizei > coastal_counts
Definition: map.hpp:124
void update_fog_of_war(sys::state &state)
Definition: map.cpp:72
GLuint vao_array[vo_count]
Definition: map.hpp:189
static constexpr uint32_t uniform_water_normal
Definition: map.hpp:251
static constexpr uint32_t uniform_stripes_texture
Definition: map.hpp:258
static constexpr uint32_t texture_colormap_water
Definition: map.hpp:195
static constexpr uint32_t texture_coastal_border
Definition: map.hpp:208
std::vector< GLint > coastal_starts
Definition: map.hpp:123
std::vector< text_line_vertex > province_text_line_vertices
Definition: map.hpp:154
std::vector< GLsizei > static_mesh_counts
Definition: map.hpp:126
std::vector< curved_line_vertex > retreat_unit_arrow_vertices
Definition: map.hpp:136
static constexpr uint32_t shader_map_standing_object
Definition: map.hpp:234
void load_map(sys::state &state)
Definition: map.cpp:2406
void set_selected_province(sys::state &state, dcon::province_id province_id)
Definition: map.cpp:1253
static constexpr uint32_t shader_count
Definition: map.hpp:236
std::vector< GLuint > text_line_texture_per_quad
Definition: map.hpp:152
static constexpr uint32_t shader_text_line
Definition: map.hpp:230
std::vector< text_line_vertex > text_line_vertices
Definition: map.hpp:153
static constexpr uint32_t uniform_diag_border_identifier
Definition: map.hpp:260
static constexpr uint32_t texture_imp_border
Definition: map.hpp:205
static constexpr uint32_t texture_array_count
Definition: map.hpp:223
static constexpr uint32_t vo_count
Definition: map.hpp:188
static constexpr uint32_t texture_province_fow
Definition: map.hpp:207
static constexpr uint32_t uniform_provinces_sea_mask
Definition: map.hpp:272
std::vector< GLsizei > strategy_unit_arrow_counts
Definition: map.hpp:142
static constexpr uint32_t uniform_opaque
Definition: map.hpp:265
static constexpr uint32_t texture_national_border
Definition: map.hpp:202
static constexpr uint32_t vo_land
Definition: map.hpp:173
static constexpr uint32_t vo_objective_unit_arrow
Definition: map.hpp:186
static constexpr uint32_t texture_hover_border
Definition: map.hpp:216
uint16_t safe_get_province(glm::ivec2 pt)
static constexpr uint32_t uniform_border_width
Definition: map.hpp:267
std::vector< border > borders
Definition: map.hpp:114
static constexpr uint32_t shader_line_unit_arrow
Definition: map.hpp:229
static constexpr uint32_t vo_province_text_line
Definition: map.hpp:182
std::vector< curved_line_vertex > attack_unit_arrow_vertices
Definition: map.hpp:132
static constexpr uint32_t vo_unit_arrow
Definition: map.hpp:176
std::vector< GLint > objective_unit_arrow_starts
Definition: map.hpp:145
static constexpr uint32_t shader_railroad_line
Definition: map.hpp:233
std::vector< GLint > river_starts
Definition: map.hpp:117
std::vector< uint8_t > median_terrain_type
Definition: map.hpp:157
static constexpr uint32_t uniform_province_highlight
Definition: map.hpp:257
static constexpr uint32_t texture_unit_arrow
Definition: map.hpp:206
void set_province_text_lines(sys::state &state, std::vector< text_line_generator_data > const &data)
Definition: map.cpp:2006
std::vector< uint16_t > province_id_map
Definition: map.hpp:162
static constexpr uint32_t uniform_province_color
Definition: map.hpp:255
std::vector< uint8_t > diagonal_borders
Definition: map.hpp:159
void gen_prov_color_texture(GLuint texture_handle, std::vector< uint32_t > const &prov_color, uint8_t layers=1)
Definition: map.cpp:1216
std::vector< textured_line_vertex_b > border_vertices
Definition: map.hpp:115
std::vector< curved_line_vertex > other_objective_unit_arrow_vertices
Definition: map.hpp:148
std::vector< GLint > static_mesh_starts
Definition: map.hpp:125
static constexpr uint32_t texture_prov_border
Definition: map.hpp:204
std::vector< GLsizei > other_objective_unit_arrow_counts
Definition: map.hpp:150
static constexpr uint32_t texture_terrain
Definition: map.hpp:193
GLuint static_mesh_textures[max_static_meshes]
Definition: map.hpp:278
std::vector< uint16_t > map_indices
Definition: map.hpp:163
static constexpr uint32_t vo_drag_box
Definition: map.hpp:178
static constexpr uint32_t vo_border
Definition: map.hpp:174
static constexpr uint32_t texture_overlay
Definition: map.hpp:198
std::vector< curved_line_vertex > unit_arrow_vertices
Definition: map.hpp:128
std::vector< GLsizei > retreat_unit_arrow_counts
Definition: map.hpp:138
std::vector< curved_line_vertex > strategy_unit_arrow_vertices
Definition: map.hpp:140
static constexpr uint32_t uniform_count
Definition: map.hpp:273
static constexpr uint32_t uniform_colormap_terrain
Definition: map.hpp:253
static constexpr uint32_t uniform_aspect_ratio
Definition: map.hpp:240
void update_borders(sys::state &state)
Definition: map.cpp:59
static constexpr uint32_t uniform_time
Definition: map.hpp:246
std::vector< textured_line_vertex_b > coastal_vertices
Definition: map.hpp:122
static constexpr uint32_t uniform_province_fow
Definition: map.hpp:259
static constexpr uint32_t uniform_offset
Definition: map.hpp:239
static constexpr uint32_t vo_attack_unit_arrow
Definition: map.hpp:183
void create_meshes()
Definition: map.cpp:262
static constexpr uint32_t uniform_terrain_texture_sampler
Definition: map.hpp:249
static constexpr uint32_t vo_other_objective_unit_arrow
Definition: map.hpp:187
void make_coastal_borders(sys::state &state, std::vector< bool > &visited)
std::vector< GLint > retreat_unit_arrow_starts
Definition: map.hpp:137
static constexpr uint32_t uniform_zoom
Definition: map.hpp:241
static constexpr uint32_t texture_array_terrainsheet
Definition: map.hpp:221
std::vector< uint8_t > terrain_id_map
Definition: map.hpp:156
static constexpr uint32_t texture_stripes
Definition: map.hpp:200
void load_border_data(parsers::scenario_building_context &context)
static constexpr uint32_t uniform_width
Definition: map.hpp:261
std::vector< GLsizei > objective_unit_arrow_counts
Definition: map.hpp:146
static constexpr uint32_t texture_retreat_unit_arrow
Definition: map.hpp:212
void load_provinces_mid_point(parsers::scenario_building_context &context)
void load_median_terrain_type(parsers::scenario_building_context &context)
static constexpr uint32_t uniform_is_black
Definition: map.hpp:266
void make_borders(sys::state &state, std::vector< bool > &visited)
static constexpr uint32_t uniform_subroutines_index_2
Definition: map.hpp:262
static constexpr uint32_t max_static_meshes
Definition: map.hpp:277
GLuint shader_uniforms[shader_count][uniform_count]
Definition: map.hpp:274
static constexpr uint32_t uniform_target_topview_fixup
Definition: map.hpp:271
static constexpr uint32_t texture_provinces
Definition: map.hpp:192
static constexpr uint32_t vo_static_mesh
Definition: map.hpp:181
void create_curved_river_vertices(parsers::scenario_building_context &context, std::vector< uint8_t > const &river_data, std::vector< uint8_t > const &terrain_data)
static constexpr uint32_t uniform_map_size
Definition: map.hpp:242
static constexpr uint32_t texture_railroad
Definition: map.hpp:210
GLuint shaders[shader_count]
Definition: map.hpp:237
static constexpr uint32_t vo_railroad
Definition: map.hpp:180
static constexpr uint32_t texture_water_normal
Definition: map.hpp:194
std::vector< GLint > attack_unit_arrow_starts
Definition: map.hpp:133
std::vector< GLsizei > unit_arrow_counts
Definition: map.hpp:130
void load_map_data(parsers::scenario_building_context &context)
static constexpr uint32_t texture_other_objective_unit_arrow
Definition: map.hpp:215
static constexpr uint32_t uniform_target_facing
Definition: map.hpp:270
static constexpr uint32_t shader_borders
Definition: map.hpp:232
void render(sys::state &state, glm::vec2 screen_size, glm::vec2 offset, float zoom, map_view map_view_mode, map_mode::mode active_map_mode, glm::mat3 globe_rotation, float time_counter)
Definition: map.cpp:449
static constexpr uint32_t uniform_line_texture
Definition: map.hpp:263
static constexpr uint32_t texture_objective_unit_arrow
Definition: map.hpp:214
static constexpr uint32_t vo_retreat_unit_arrow
Definition: map.hpp:184
void set_text_lines(sys::state &state, std::vector< text_line_generator_data > const &data)
Definition: map.cpp:1817
static constexpr uint32_t uniform_gamma
Definition: map.hpp:244
uint32_t size_y
Definition: map.hpp:169
void create_border_ogl_objects()
Definition: map.cpp:258
static constexpr uint32_t vo_strategy_unit_arrow
Definition: map.hpp:185
static constexpr uint32_t uniform_model_offset
Definition: map.hpp:269
static constexpr uint32_t texture_attack_unit_arrow
Definition: map.hpp:211
static constexpr uint32_t texture_province_highlight
Definition: map.hpp:199
uint32_t land_vertex_count
Definition: map.hpp:170
GLuint vbo_array[vo_count]
Definition: map.hpp:190
std::vector< GLint > railroad_starts
Definition: map.hpp:120
uint32_t size_x
Definition: map.hpp:168
std::vector< GLsizei > attack_unit_arrow_counts
Definition: map.hpp:134
std::vector< GLint > strategy_unit_arrow_starts
Definition: map.hpp:141
std::vector< GLint > unit_arrow_starts
Definition: map.hpp:129
std::vector< uint32_t > province_area
Definition: map.hpp:158
static constexpr uint32_t texture_river_body
Definition: map.hpp:201
static constexpr uint32_t uniform_subroutines_index
Definition: map.hpp:245
std::vector< GLint > other_objective_unit_arrow_starts
Definition: map.hpp:149
static constexpr uint32_t shader_drag_box
Definition: map.hpp:231
static constexpr uint32_t uniform_colormap_political
Definition: map.hpp:256
void load_province_data(parsers::scenario_building_context &context, ogl::image &image)
void set_drag_box(bool draw_box, glm::vec2 pos1, glm::vec2 pos2, glm::vec2 pixel_size)
Definition: map.cpp:1282
static constexpr uint32_t uniform_provinces_texture_sampler
Definition: map.hpp:248
static constexpr uint32_t texture_count
Definition: map.hpp:218
std::vector< screen_vertex > drag_box_vertices
Definition: map.hpp:155
static constexpr uint32_t vo_river
Definition: map.hpp:175
GLuint textures[texture_count]
Definition: map.hpp:219
std::vector< uint32_t > province_id_sea_mask
Definition: map.hpp:166
static constexpr uint32_t vo_text_line
Definition: map.hpp:177
static constexpr uint32_t texture_colormap_terrain
Definition: map.hpp:196
std::vector< GLsizei > railroad_counts
Definition: map.hpp:121
std::vector< curved_line_vertex > objective_unit_arrow_vertices
Definition: map.hpp:144
void set_province_color(std::vector< uint32_t > const &prov_color)
Definition: map.cpp:1259
static constexpr uint32_t shader_textured_line_with_variable_width
Definition: map.hpp:235
static constexpr uint32_t uniform_terrainsheet_texture_sampler
Definition: map.hpp:250
static constexpr uint32_t texture_colormap_political
Definition: map.hpp:197
static constexpr uint32_t texture_state_border
Definition: map.hpp:203
std::vector< textured_line_vertex > railroad_vertices
Definition: map.hpp:119
static constexpr uint32_t uniform_unit_arrow
Definition: map.hpp:268
static constexpr uint32_t shader_terrain
Definition: map.hpp:226
glm::vec2 put_in_local(glm::vec2 new_point, glm::vec2 base_point, float size_x)
Definition: map.cpp:1561
void make_army_path(sys::state &state, std::vector< map::curved_line_vertex > &buffer, dcon::army_id selected_army, float size_x, float size_y)
Definition: map.cpp:1616
map_view
Definition: map_state.hpp:17
void add_bezier_to_buffer(std::vector< map::curved_line_vertex > &buffer, glm::vec2 start, glm::vec2 end, glm::vec2 start_per, glm::vec2 end_per, float progress, bool last_curve, float size_x, float size_y, uint32_t num_b_segments)
Definition: map.cpp:1359
direction
Definition: map_borders.cpp:8
void make_navy_path(sys::state &state, std::vector< map::curved_line_vertex > &buffer, dcon::navy_id selected_navy, float size_x, float size_y)
Definition: map.cpp:1572
void load_river_crossings(parsers::scenario_building_context &context, std::vector< uint8_t > const &river_data, glm::ivec2 map_size)
void add_tl_bezier_to_buffer(std::vector< map::textured_line_vertex > &buffer, glm::vec2 start, glm::vec2 end, glm::vec2 start_per, glm::vec2 end_per, float progress, bool last_curve, float size_x, float size_y, uint32_t num_b_segments, float &distance)
Definition: map.cpp:1453
Definition: constants.hpp:4
Definition: bmfont.cpp:118
uint uint32_t
uchar uint8_t
int start_index
Definition: map.hpp:86
uint16_t padding
Definition: map.hpp:89
int count
Definition: map.hpp:87
dcon::province_adjacency_id adj
Definition: map.hpp:88
curved_line_vertex(glm::vec2 position, glm::vec2 normal_direction, glm::vec2 direction, glm::vec2 texture_coord, float type)
Definition: map.hpp:33
glm::vec2 position_
Definition: map.hpp:35
glm::vec2 texture_coord_
Definition: map.hpp:38
glm::vec2 direction_
Definition: map.hpp:37
glm::vec2 normal_direction_
Definition: map.hpp:36
map_vertex(float x, float y)
Definition: map.hpp:23
glm::vec2 position_
Definition: map.hpp:24
screen_vertex(float x, float y)
Definition: map.hpp:27
glm::vec2 position_
Definition: map.hpp:28
text::stored_glyphs text
Definition: map.hpp:79
text_line_generator_data(text::stored_glyphs &&text_, glm::vec4 coeff_, glm::vec2 basis_, glm::vec2 ratio_)
Definition: map.hpp:78
glm::vec2 position_
Definition: map.hpp:69
glm::vec2 normal_direction_
Definition: map.hpp:70
text_line_vertex(glm::vec2 position, glm::vec2 normal_direction, glm::vec2 direction, glm::vec3 texture_coord, float thickness)
Definition: map.hpp:67
glm::vec2 direction_
Definition: map.hpp:71
glm::vec3 texture_coord_
Definition: map.hpp:72
glm::vec2 previous_point
Definition: map.hpp:59
glm::vec2 normal_direction_
Definition: map.hpp:44
glm::vec2 position_
Definition: map.hpp:43