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<textured_line_with_width_vertex> trade_flow_vertices;
129 std::vector<GLint> trade_flow_arrow_starts;
130 std::vector<GLsizei> trade_flow_arrow_counts;
131 //
132 std::vector<curved_line_vertex> unit_arrow_vertices;
133 std::vector<GLint> unit_arrow_starts;
134 std::vector<GLsizei> unit_arrow_counts;
135 //
136 std::vector<curved_line_vertex> attack_unit_arrow_vertices;
137 std::vector<GLint> attack_unit_arrow_starts;
138 std::vector<GLsizei> attack_unit_arrow_counts;
139 //
140 std::vector<curved_line_vertex> retreat_unit_arrow_vertices;
141 std::vector<GLint> retreat_unit_arrow_starts;
142 std::vector<GLsizei> retreat_unit_arrow_counts;
143 //
144 std::vector<curved_line_vertex> strategy_unit_arrow_vertices;
145 std::vector<GLint> strategy_unit_arrow_starts;
146 std::vector<GLsizei> strategy_unit_arrow_counts;
147 //
148 std::vector<curved_line_vertex> objective_unit_arrow_vertices;
149 std::vector<GLint> objective_unit_arrow_starts;
150 std::vector<GLsizei> objective_unit_arrow_counts;
151 //
152 std::vector<curved_line_vertex> other_objective_unit_arrow_vertices;
155 //
156 std::vector<GLuint> text_line_texture_per_quad;
157 std::vector<text_line_vertex> text_line_vertices;
158 std::vector<text_line_vertex> province_text_line_vertices;
159 std::vector<screen_vertex> drag_box_vertices;
160 std::vector<uint8_t> terrain_id_map;
161 std::vector<uint8_t> median_terrain_type;
162 std::vector<uint32_t> province_area;
163 std::vector<uint8_t> diagonal_borders;
164
165 // map pixel -> province id
166 std::vector<uint16_t> province_id_map;
167 std::vector<uint16_t> map_indices;
168
169 // province id mask to detect seas
170 std::vector<uint32_t> province_id_sea_mask;
171
175
176 // Meshes
177 static constexpr uint32_t vo_land = 0;
178 static constexpr uint32_t vo_border = 1;
179 static constexpr uint32_t vo_river = 2;
180 static constexpr uint32_t vo_unit_arrow = 3;
181 static constexpr uint32_t vo_text_line = 4;
182 static constexpr uint32_t vo_drag_box = 5;
183 static constexpr uint32_t vo_coastal = 6;
184 static constexpr uint32_t vo_railroad = 7;
185 static constexpr uint32_t vo_static_mesh = 8;
186 static constexpr uint32_t vo_province_text_line = 9;
187 static constexpr uint32_t vo_attack_unit_arrow = 10;
188 static constexpr uint32_t vo_retreat_unit_arrow = 11;
189 static constexpr uint32_t vo_strategy_unit_arrow = 12;
190 static constexpr uint32_t vo_objective_unit_arrow = 13;
192 static constexpr uint32_t vo_trade_flow = 15;
193 static constexpr uint32_t vo_count = 16;
194 GLuint vao_array[vo_count] = { 0 };
195 GLuint vbo_array[vo_count] = { 0 };
196 // Textures
197 static constexpr uint32_t texture_provinces = 0;
198 static constexpr uint32_t texture_terrain = 1;
199 static constexpr uint32_t texture_water_normal = 2;
200 static constexpr uint32_t texture_colormap_water = 3;
201 static constexpr uint32_t texture_colormap_terrain = 4;
203 static constexpr uint32_t texture_overlay = 6;
205 static constexpr uint32_t texture_stripes = 8;
206 static constexpr uint32_t texture_river_body = 9;
207 static constexpr uint32_t texture_national_border = 10;
208 static constexpr uint32_t texture_state_border = 11;
209 static constexpr uint32_t texture_prov_border = 12;
210 static constexpr uint32_t texture_imp_border = 13;
211 static constexpr uint32_t texture_unit_arrow = 14;
212 static constexpr uint32_t texture_province_fow = 15;
213 static constexpr uint32_t texture_coastal_border = 16;
215 static constexpr uint32_t texture_railroad = 18;
216 static constexpr uint32_t texture_attack_unit_arrow = 19;
221 static constexpr uint32_t texture_hover_border = 24;
222 static constexpr uint32_t texture_sea_mask = 25;
223 static constexpr uint32_t texture_arrow = 26;
224 static constexpr uint32_t texture_count = 27;
225 GLuint textures[texture_count] = { 0 };
226 // Texture Array
229 static constexpr uint32_t texture_array_count = 2;
231 // Shaders
232 static constexpr uint32_t shader_terrain = 0;
233 static constexpr uint32_t shader_line_border = 1;
234 static constexpr uint32_t shader_textured_line = 2;
235 static constexpr uint32_t shader_line_unit_arrow = 3;
236 static constexpr uint32_t shader_text_line = 4;
237 static constexpr uint32_t shader_drag_box = 5;
238 static constexpr uint32_t shader_borders = 6;
239 static constexpr uint32_t shader_railroad_line = 7;
242 static constexpr uint32_t shader_trade_flow = 10;
243 static constexpr uint32_t shader_count = 11;
244 GLuint shaders[shader_count] = { 0 };
245
246 static constexpr uint32_t uniform_offset = 0;
247 static constexpr uint32_t uniform_aspect_ratio = 1;
248 static constexpr uint32_t uniform_zoom = 2;
249 static constexpr uint32_t uniform_map_size = 3;
250 static constexpr uint32_t uniform_rotation = 4;
251 static constexpr uint32_t uniform_gamma = 5;
253 static constexpr uint32_t uniform_time = 7;
254 //
258 static constexpr uint32_t uniform_water_normal = 11;
259 static constexpr uint32_t uniform_colormap_water = 12;
260 static constexpr uint32_t uniform_colormap_terrain = 13;
261 static constexpr uint32_t uniform_overlay = 14;
262 static constexpr uint32_t uniform_province_color = 15;
265 static constexpr uint32_t uniform_stripes_texture = 18;
266 static constexpr uint32_t uniform_province_fow = 19;
268 static constexpr uint32_t uniform_width = 21;
270 static constexpr uint32_t uniform_line_texture = 23;
271 static constexpr uint32_t uniform_texture_sampler = 24;
272 static constexpr uint32_t uniform_opaque = 25;
273 static constexpr uint32_t uniform_is_black = 26;
274 static constexpr uint32_t uniform_border_width = 27;
275 static constexpr uint32_t uniform_unit_arrow = 28;
276 static constexpr uint32_t uniform_model_offset = 29;
277 static constexpr uint32_t uniform_target_facing = 30;
280 static constexpr uint32_t uniform_count = 33;
282
283 // models: Textures for static meshes
284 static constexpr uint32_t max_static_meshes = 42;
286
293
294 uint16_t safe_get_province(glm::ivec2 pt);
295 void make_coastal_borders(sys::state& state, std::vector<bool>& visited);
296 void make_borders(sys::state& state, std::vector<bool>& visited);
297
299 void create_meshes();
300 void gen_prov_color_texture(GLuint texture_handle, std::vector<uint32_t> const& prov_color, uint8_t layers = 1);
301
302 void create_curved_river_vertices(parsers::scenario_building_context& context, std::vector<uint8_t> const& river_data, std::vector<uint8_t> const& terrain_data);
303};
304
305void load_river_crossings(parsers::scenario_building_context& context, std::vector<uint8_t> const& river_data, glm::ivec2 map_size);
306
307void make_navy_path(sys::state& state, std::vector<map::curved_line_vertex>& buffer, dcon::navy_id selected_navy, float size_x, float size_y);
308void make_navy_direction(sys::state& state, std::vector<map::curved_line_vertex>& buffer, dcon::navy_id selected_navy, float size_x, float size_y);
309void make_sea_path(
310 sys::state& state,
311 std::vector<map::textured_line_with_width_vertex>& buffer,
312 dcon::province_id origin,
313 dcon::province_id target,
314 float width,
315 float size_x,
316 float size_y,
317 float shift_x,
318 float shift_y
319);
320void make_land_path(
321 sys::state& state,
322 std::vector<map::textured_line_with_width_vertex>& buffer,
323 dcon::province_id origin,
324 dcon::province_id target,
325 float width,
326 float size_x,
327 float size_y
328);
329
330void make_army_path(sys::state& state, std::vector<map::curved_line_vertex>& buffer, dcon::army_id selected_army, float size_x, float size_y);
331void make_army_direction(sys::state& state, std::vector<map::curved_line_vertex>& buffer, dcon::army_id selected_army, float size_x, float size_y);
332
333glm::vec2 put_in_local(glm::vec2 new_point, glm::vec2 base_point, float size_x);
334void 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);
335void 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);
336void 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);
337
338} // 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:214
static constexpr uint32_t uniform_texture_sampler
Definition: map.hpp:271
void update_railroad_paths(sys::state &state)
Definition: map.cpp:2004
static constexpr uint32_t uniform_colormap_water
Definition: map.hpp:259
static constexpr uint32_t shader_textured_line
Definition: map.hpp:234
std::vector< GLsizei > trade_flow_arrow_counts
Definition: map.hpp:130
static constexpr uint32_t texture_strategy_unit_arrow
Definition: map.hpp:218
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:377
static constexpr uint32_t texture_array_province_color
Definition: map.hpp:228
GLuint texture_arrays[texture_array_count]
Definition: map.hpp:230
static constexpr uint32_t uniform_rotation
Definition: map.hpp:250
static constexpr uint32_t uniform_overlay
Definition: map.hpp:261
static constexpr uint32_t texture_sea_mask
Definition: map.hpp:222
static constexpr uint32_t shader_line_border
Definition: map.hpp:233
static constexpr uint32_t vo_coastal
Definition: map.hpp:183
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:194
static constexpr uint32_t uniform_water_normal
Definition: map.hpp:258
static constexpr uint32_t uniform_stripes_texture
Definition: map.hpp:265
static constexpr uint32_t texture_colormap_water
Definition: map.hpp:200
static constexpr uint32_t texture_coastal_border
Definition: map.hpp:213
std::vector< GLint > coastal_starts
Definition: map.hpp:123
std::vector< text_line_vertex > province_text_line_vertices
Definition: map.hpp:158
std::vector< GLsizei > static_mesh_counts
Definition: map.hpp:126
std::vector< curved_line_vertex > retreat_unit_arrow_vertices
Definition: map.hpp:140
static constexpr uint32_t shader_map_standing_object
Definition: map.hpp:240
void load_map(sys::state &state)
Definition: map.cpp:2707
void set_selected_province(sys::state &state, dcon::province_id province_id)
Definition: map.cpp:1272
static constexpr uint32_t shader_count
Definition: map.hpp:243
std::vector< GLuint > text_line_texture_per_quad
Definition: map.hpp:156
static constexpr uint32_t shader_text_line
Definition: map.hpp:236
std::vector< text_line_vertex > text_line_vertices
Definition: map.hpp:157
static constexpr uint32_t uniform_diag_border_identifier
Definition: map.hpp:267
static constexpr uint32_t texture_imp_border
Definition: map.hpp:210
static constexpr uint32_t texture_array_count
Definition: map.hpp:229
static constexpr uint32_t vo_count
Definition: map.hpp:193
static constexpr uint32_t texture_province_fow
Definition: map.hpp:212
static constexpr uint32_t uniform_provinces_sea_mask
Definition: map.hpp:279
std::vector< GLsizei > strategy_unit_arrow_counts
Definition: map.hpp:146
static constexpr uint32_t uniform_opaque
Definition: map.hpp:272
static constexpr uint32_t texture_national_border
Definition: map.hpp:207
static constexpr uint32_t vo_land
Definition: map.hpp:177
static constexpr uint32_t vo_objective_unit_arrow
Definition: map.hpp:190
static constexpr uint32_t texture_hover_border
Definition: map.hpp:221
uint16_t safe_get_province(glm::ivec2 pt)
static constexpr uint32_t uniform_border_width
Definition: map.hpp:274
std::vector< border > borders
Definition: map.hpp:114
static constexpr uint32_t shader_line_unit_arrow
Definition: map.hpp:235
static constexpr uint32_t vo_province_text_line
Definition: map.hpp:186
std::vector< curved_line_vertex > attack_unit_arrow_vertices
Definition: map.hpp:136
static constexpr uint32_t vo_unit_arrow
Definition: map.hpp:180
std::vector< textured_line_with_width_vertex > trade_flow_vertices
Definition: map.hpp:128
std::vector< GLint > objective_unit_arrow_starts
Definition: map.hpp:149
static constexpr uint32_t shader_railroad_line
Definition: map.hpp:239
std::vector< GLint > river_starts
Definition: map.hpp:117
std::vector< uint8_t > median_terrain_type
Definition: map.hpp:161
static constexpr uint32_t uniform_province_highlight
Definition: map.hpp:264
static constexpr uint32_t texture_unit_arrow
Definition: map.hpp:211
void set_province_text_lines(sys::state &state, std::vector< text_line_generator_data > const &data)
Definition: map.cpp:2307
std::vector< uint16_t > province_id_map
Definition: map.hpp:166
static constexpr uint32_t uniform_province_color
Definition: map.hpp:262
std::vector< uint8_t > diagonal_borders
Definition: map.hpp:163
void gen_prov_color_texture(GLuint texture_handle, std::vector< uint32_t > const &prov_color, uint8_t layers=1)
Definition: map.cpp:1235
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:152
std::vector< GLint > static_mesh_starts
Definition: map.hpp:125
static constexpr uint32_t texture_prov_border
Definition: map.hpp:209
std::vector< GLsizei > other_objective_unit_arrow_counts
Definition: map.hpp:154
static constexpr uint32_t texture_terrain
Definition: map.hpp:198
GLuint static_mesh_textures[max_static_meshes]
Definition: map.hpp:285
std::vector< uint16_t > map_indices
Definition: map.hpp:167
static constexpr uint32_t vo_drag_box
Definition: map.hpp:182
static constexpr uint32_t vo_border
Definition: map.hpp:178
static constexpr uint32_t texture_overlay
Definition: map.hpp:203
static constexpr uint32_t shader_trade_flow
Definition: map.hpp:242
std::vector< curved_line_vertex > unit_arrow_vertices
Definition: map.hpp:132
std::vector< GLsizei > retreat_unit_arrow_counts
Definition: map.hpp:142
std::vector< curved_line_vertex > strategy_unit_arrow_vertices
Definition: map.hpp:144
static constexpr uint32_t uniform_count
Definition: map.hpp:280
static constexpr uint32_t uniform_colormap_terrain
Definition: map.hpp:260
static constexpr uint32_t uniform_aspect_ratio
Definition: map.hpp:247
void update_borders(sys::state &state)
Definition: map.cpp:59
static constexpr uint32_t uniform_time
Definition: map.hpp:253
std::vector< textured_line_vertex_b > coastal_vertices
Definition: map.hpp:122
static constexpr uint32_t uniform_province_fow
Definition: map.hpp:266
static constexpr uint32_t uniform_offset
Definition: map.hpp:246
static constexpr uint32_t vo_attack_unit_arrow
Definition: map.hpp:187
static constexpr uint32_t vo_trade_flow
Definition: map.hpp:192
void create_meshes()
Definition: map.cpp:262
static constexpr uint32_t uniform_terrain_texture_sampler
Definition: map.hpp:256
static constexpr uint32_t vo_other_objective_unit_arrow
Definition: map.hpp:191
void make_coastal_borders(sys::state &state, std::vector< bool > &visited)
std::vector< GLint > retreat_unit_arrow_starts
Definition: map.hpp:141
static constexpr uint32_t uniform_zoom
Definition: map.hpp:248
static constexpr uint32_t texture_array_terrainsheet
Definition: map.hpp:227
std::vector< uint8_t > terrain_id_map
Definition: map.hpp:160
static constexpr uint32_t texture_stripes
Definition: map.hpp:205
void load_border_data(parsers::scenario_building_context &context)
static constexpr uint32_t uniform_width
Definition: map.hpp:268
std::vector< GLsizei > objective_unit_arrow_counts
Definition: map.hpp:150
static constexpr uint32_t texture_retreat_unit_arrow
Definition: map.hpp:217
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:273
void make_borders(sys::state &state, std::vector< bool > &visited)
static constexpr uint32_t uniform_subroutines_index_2
Definition: map.hpp:269
static constexpr uint32_t max_static_meshes
Definition: map.hpp:284
GLuint shader_uniforms[shader_count][uniform_count]
Definition: map.hpp:281
static constexpr uint32_t uniform_target_topview_fixup
Definition: map.hpp:278
static constexpr uint32_t texture_provinces
Definition: map.hpp:197
static constexpr uint32_t vo_static_mesh
Definition: map.hpp:185
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:249
static constexpr uint32_t texture_railroad
Definition: map.hpp:215
GLuint shaders[shader_count]
Definition: map.hpp:244
static constexpr uint32_t vo_railroad
Definition: map.hpp:184
static constexpr uint32_t texture_water_normal
Definition: map.hpp:199
std::vector< GLint > attack_unit_arrow_starts
Definition: map.hpp:137
std::vector< GLsizei > unit_arrow_counts
Definition: map.hpp:134
void load_map_data(parsers::scenario_building_context &context)
static constexpr uint32_t texture_other_objective_unit_arrow
Definition: map.hpp:220
static constexpr uint32_t uniform_target_facing
Definition: map.hpp:277
static constexpr uint32_t shader_borders
Definition: map.hpp:238
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:452
static constexpr uint32_t uniform_line_texture
Definition: map.hpp:270
static constexpr uint32_t texture_objective_unit_arrow
Definition: map.hpp:219
static constexpr uint32_t vo_retreat_unit_arrow
Definition: map.hpp:188
void set_text_lines(sys::state &state, std::vector< text_line_generator_data > const &data)
Definition: map.cpp:2118
static constexpr uint32_t uniform_gamma
Definition: map.hpp:251
uint32_t size_y
Definition: map.hpp:173
void create_border_ogl_objects()
Definition: map.cpp:258
static constexpr uint32_t vo_strategy_unit_arrow
Definition: map.hpp:189
static constexpr uint32_t uniform_model_offset
Definition: map.hpp:276
static constexpr uint32_t texture_attack_unit_arrow
Definition: map.hpp:216
static constexpr uint32_t texture_province_highlight
Definition: map.hpp:204
uint32_t land_vertex_count
Definition: map.hpp:174
GLuint vbo_array[vo_count]
Definition: map.hpp:195
std::vector< GLint > railroad_starts
Definition: map.hpp:120
uint32_t size_x
Definition: map.hpp:172
std::vector< GLint > trade_flow_arrow_starts
Definition: map.hpp:129
std::vector< GLsizei > attack_unit_arrow_counts
Definition: map.hpp:138
std::vector< GLint > strategy_unit_arrow_starts
Definition: map.hpp:145
std::vector< GLint > unit_arrow_starts
Definition: map.hpp:133
std::vector< uint32_t > province_area
Definition: map.hpp:162
static constexpr uint32_t texture_river_body
Definition: map.hpp:206
static constexpr uint32_t uniform_subroutines_index
Definition: map.hpp:252
std::vector< GLint > other_objective_unit_arrow_starts
Definition: map.hpp:153
static constexpr uint32_t shader_drag_box
Definition: map.hpp:237
static constexpr uint32_t uniform_colormap_political
Definition: map.hpp:263
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:1301
static constexpr uint32_t uniform_provinces_texture_sampler
Definition: map.hpp:255
static constexpr uint32_t texture_count
Definition: map.hpp:224
std::vector< screen_vertex > drag_box_vertices
Definition: map.hpp:159
static constexpr uint32_t vo_river
Definition: map.hpp:179
GLuint textures[texture_count]
Definition: map.hpp:225
std::vector< uint32_t > province_id_sea_mask
Definition: map.hpp:170
static constexpr uint32_t vo_text_line
Definition: map.hpp:181
static constexpr uint32_t texture_arrow
Definition: map.hpp:223
static constexpr uint32_t texture_colormap_terrain
Definition: map.hpp:201
std::vector< GLsizei > railroad_counts
Definition: map.hpp:121
std::vector< curved_line_vertex > objective_unit_arrow_vertices
Definition: map.hpp:148
void set_province_color(std::vector< uint32_t > const &prov_color)
Definition: map.cpp:1278
static constexpr uint32_t shader_textured_line_with_variable_width
Definition: map.hpp:241
static constexpr uint32_t uniform_terrainsheet_texture_sampler
Definition: map.hpp:257
static constexpr uint32_t texture_colormap_political
Definition: map.hpp:202
static constexpr uint32_t texture_state_border
Definition: map.hpp:208
std::vector< textured_line_vertex > railroad_vertices
Definition: map.hpp:119
static constexpr uint32_t uniform_unit_arrow
Definition: map.hpp:275
static constexpr uint32_t shader_terrain
Definition: map.hpp:232
glm::vec2 put_in_local(glm::vec2 new_point, glm::vec2 base_point, float size_x)
Definition: map.cpp:1614
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:1867
void make_land_path(sys::state &state, std::vector< map::textured_line_with_width_vertex > &buffer, dcon::province_id origin, dcon::province_id target, float width, float size_x, float size_y)
Definition: map.cpp:1790
void make_sea_path(sys::state &state, std::vector< map::textured_line_with_width_vertex > &buffer, dcon::province_id origin, dcon::province_id target, float width, float size_x, float size_y, float shift_x, float shift_y)
Definition: map.cpp:1710
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:1378
direction
Definition: map_borders.cpp:8
void make_army_direction(sys::state &state, std::vector< map::curved_line_vertex > &buffer, dcon::army_id selected_army, float size_x, float size_y)
Definition: map.cpp:1910
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:1625
void make_navy_direction(sys::state &state, std::vector< map::curved_line_vertex > &buffer, dcon::navy_id selected_navy, float size_x, float size_y)
Definition: map.cpp:1668
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:1481
Definition: json.hpp:5434
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
Holds important data about the game world, state, and other data regarding windowing,...