Project Alice
Loading...
Searching...
No Matches
map Namespace Reference

Classes

struct  bmp_pixel_data
 
struct  border
 
struct  border_direction
 
struct  curved_line_vertex
 
class  display_data
 
class  map_state
 
struct  map_vertex
 
struct  river_runner
 
struct  river_vertex
 
struct  screen_vertex
 
struct  text_line_generator_data
 
struct  text_line_vertex
 
struct  textured_line_vertex
 
struct  textured_line_vertex_b
 
struct  textured_line_with_width_vertex
 

Enumerations

enum  direction : uint8_t {
  UP_LEFT = 1 << 7 , UP_RIGHT = 1 << 6 , DOWN_LEFT = 1 << 5 , DOWN_RIGHT = 1 << 4 ,
  UP = 1 << 3 , DOWN = 1 << 2 , LEFT = 1 << 1 , RIGHT = 1 << 0
}
 
enum class  diagonal_border : uint8_t {
  UP_LEFT = 0x01 , UP_RIGHT = uint8_t(0x01 << 2) , DOWN_LEFT = uint8_t(0x01 << 4) , DOWN_RIGHT = uint8_t(0x01 << 6) ,
  NOTHING = 0
}
 
enum class  map_view { globe , globe_perspect , flat }
 

Functions

void add_nation_visible_provinces (sys::state &state, std::vector< dcon::province_id > &list, dcon::nation_id n)
 
void create_textured_line_vbo (GLuint vbo, std::vector< textured_line_vertex > &data)
 
void create_textured_line_vbo (GLuint vbo, std::vector< textured_line_with_width_vertex > &data)
 
void create_textured_line_b_vbo (GLuint vbo, std::vector< textured_line_vertex_b > &data)
 
void create_unit_arrow_vbo (GLuint vbo, std::vector< curved_line_vertex > &data)
 
void create_text_line_vbo (GLuint vbo)
 
void create_drag_box_vbo (GLuint vbo)
 
std::optional< simple_fs::filetry_load_shader (simple_fs::directory &root, native_string_view name)
 
GLuint create_program (simple_fs::file &vshader_file, simple_fs::file &fshader_file)
 
GLuint load_province_map (std::vector< uint16_t > &province_index, uint32_t size_x, uint32_t size_y)
 
void add_drag_box_line (std::vector< screen_vertex > &drag_box_vertices, glm::vec2 pos1, glm::vec2 pos2, glm::vec2 size, bool vertical)
 
void add_arrow_to_buffer (std::vector< map::curved_line_vertex > &buffer, glm::vec2 start, glm::vec2 end, glm::vec2 prev_normal_dir, glm::vec2 next_normal_dir, float fill_progress, bool end_arrow, float size_x, float size_y)
 
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)
 
void add_tl_segment_buffer (std::vector< map::textured_line_vertex > &buffer, glm::vec2 start, glm::vec2 end, glm::vec2 next_normal_dir, float size_x, float size_y, float &distance)
 
void add_tl_segment_buffer (std::vector< map::textured_line_with_width_vertex > &buffer, glm::vec2 start, glm::vec2 end, glm::vec2 next_normal_dir, float size_x, float size_y, float &distance, float width)
 
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)
 
void 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)
 
glm::vec2 put_in_local (glm::vec2 new_point, glm::vec2 base_point, float size_x)
 
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)
 
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)
 
void create_railroad_connection (sys::state &state, std::vector< glm::vec2 > &railroad, dcon::province_id p1, dcon::province_id p2)
 
bool get_provinces_part_of_rr_path (sys::state &state, std::vector< bool > &visited_adj, std::vector< bool > &visited_prov, std::vector< dcon::province_id > &provinces, dcon::province_id p)
 
GLuint load_dds_texture (simple_fs::directory const &dir, native_string_view file_name, int soil_flags=ogl::SOIL_FLAG_TEXTURE_REPEATS)
 
emfx::xac_pp_actor_material_layer get_diffuse_layer (emfx::xac_pp_actor_material const &mat)
 
void load_static_meshes (sys::state &state)
 
void load_river_crossings (parsers::scenario_building_context &context, std::vector< uint8_t > const &river_data, glm::ivec2 map_size)
 
bool extend_if_possible (uint32_t x, int32_t border_id, direction dir, std::vector< border_direction > &last_row, std::vector< border_direction > &current_row, glm::vec2 map_size, std::vector< curved_line_vertex > &border_vertices)
 
int32_t get_border_index (uint16_t map_province_id1, uint16_t map_province_id2, parsers::scenario_building_context &context)
 
bool is_river (uint8_t river_data)
 
int32_t river_width (uint8_t river_data)
 
bool is_river_source (uint8_t river_data)
 
bool is_river_merge (uint8_t river_data)
 
bool coastal_point (sys::state &state, uint16_t a, uint16_t b)
 
bool order_indifferent_compare (uint16_t a, uint16_t b, uint16_t c, uint16_t d)
 
std::vector< glm::vec2 > make_border_section (display_data &dat, sys::state &state, std::vector< bool > &visited, uint16_t prov_prim, uint16_t prov_sec, int32_t start_x, int32_t start_y)
 
void add_border_segment_vertices (display_data &dat, std::vector< glm::vec2 > const &points)
 
std::vector< glm::vec2 > make_coastal_loop (display_data &dat, sys::state &state, std::vector< bool > &visited, int32_t start_x, int32_t start_y)
 
void add_coastal_loop_vertices (display_data &dat, std::vector< glm::vec2 > const &points)
 
bool check_for_child (river_vertex *vertex, uint32_t x, uint32_t y)
 
bool check_for_parent (river_vertex *vertex, uint32_t x, uint32_t y)
 
bool check_for_river (std::vector< uint8_t > const &river_data, river_runner &runner, int32_t x, int32_t y, glm::ivec2 size)
 
std::vector< glm::ivec2 > check_for_potential_child (std::vector< uint8_t > const &river_data, river_runner &runner, glm::ivec2 size)
 
std::vector< uint8_tload_bmp (parsers::scenario_building_context &context, native_string_view name, glm::ivec2 map_size, uint8_t fill, std::vector< bmp_pixel_data > *color_table)
 
ankerl::unordered_dense::map< uint32_t, uint8_tinternal_make_index_map ()
 
glm::vec2 get_port_location (sys::state &state, dcon::province_id p)
 
bool is_sea_province (sys::state &state, dcon::province_id prov_id)
 
glm::vec2 get_navy_location (sys::state &state, dcon::province_id prov_id)
 
glm::vec2 get_army_location (sys::state &state, dcon::province_id prov_id)
 
void update_unit_arrows (sys::state &state, display_data &map_data)
 
void update_bbox (std::array< glm::vec2, 5 > &bbox, glm::vec2 p)
 
bool is_inside_bbox (std::array< glm::vec2, 5 > &bbox, glm::vec2 p)
 
void update_bbox_negative (std::array< glm::vec2, 5 > &bbox, glm::vec2 p)
 
dcon::nation_id get_top_overlord (sys::state &state, dcon::nation_id n)
 
void update_text_lines (sys::state &state, display_data &map_data)
 

Variables

constexpr float min_zoom = 1.0f
 
constexpr float max_zoom = 75.0f
 
constexpr float zoom_close = 5.f
 
constexpr float zoom_very_close = 8.f
 
constexpr uint32_t default_num_b_segments = 16
 
constexpr float control_point_length_factor = 0.3f
 

Enumeration Type Documentation

◆ diagonal_border

enum class map::diagonal_border : uint8_t
strong
Enumerator
UP_LEFT 
UP_RIGHT 
DOWN_LEFT 
DOWN_RIGHT 
NOTHING 

Definition at line 19 of file map_borders.cpp.

◆ direction

Enumerator
UP_LEFT 
UP_RIGHT 
DOWN_LEFT 
DOWN_RIGHT 
UP 
DOWN 
LEFT 
RIGHT 

Definition at line 8 of file map_borders.cpp.

◆ map_view

enum class map::map_view
strong
Enumerator
globe 
globe_perspect 
flat 

Definition at line 17 of file map_state.hpp.

Function Documentation

◆ add_arrow_to_buffer()

void map::add_arrow_to_buffer ( std::vector< map::curved_line_vertex > &  buffer,
glm::vec2  start,
glm::vec2  end,
glm::vec2  prev_normal_dir,
glm::vec2  next_normal_dir,
float  fill_progress,
bool  end_arrow,
float  size_x,
float  size_y 
)

Definition at line 1307 of file map.cpp.

Here is the caller graph for this function:

◆ add_bezier_to_buffer()

void map::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 at line 1359 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_border_segment_vertices()

void map::add_border_segment_vertices ( display_data dat,
std::vector< glm::vec2 > const &  points 
)

Definition at line 426 of file map_borders.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_coastal_loop_vertices()

void map::add_coastal_loop_vertices ( display_data dat,
std::vector< glm::vec2 > const &  points 
)

Definition at line 656 of file map_borders.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_drag_box_line()

void map::add_drag_box_line ( std::vector< screen_vertex > &  drag_box_vertices,
glm::vec2  pos1,
glm::vec2  pos2,
glm::vec2  size,
bool  vertical 
)

Definition at line 1263 of file map.cpp.

Here is the caller graph for this function:

◆ add_nation_visible_provinces()

void map::add_nation_visible_provinces ( sys::state state,
std::vector< dcon::province_id > &  list,
dcon::nation_id  n 
)

Definition at line 63 of file map.cpp.

Here is the caller graph for this function:

◆ add_tl_bezier_to_buffer() [1/2]

void map::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 at line 1453 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_tl_bezier_to_buffer() [2/2]

void map::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 
)

Definition at line 1506 of file map.cpp.

Here is the call graph for this function:

◆ add_tl_segment_buffer() [1/2]

void map::add_tl_segment_buffer ( std::vector< map::textured_line_vertex > &  buffer,
glm::vec2  start,
glm::vec2  end,
glm::vec2  next_normal_dir,
float  size_x,
float  size_y,
float &  distance 
)

Definition at line 1434 of file map.cpp.

Here is the caller graph for this function:

◆ add_tl_segment_buffer() [2/2]

void map::add_tl_segment_buffer ( std::vector< map::textured_line_with_width_vertex > &  buffer,
glm::vec2  start,
glm::vec2  end,
glm::vec2  next_normal_dir,
float  size_x,
float  size_y,
float &  distance,
float  width 
)

Definition at line 1444 of file map.cpp.

◆ check_for_child()

bool map::check_for_child ( river_vertex vertex,
uint32_t  x,
uint32_t  y 
)

Definition at line 848 of file map_borders.cpp.

◆ check_for_parent()

bool map::check_for_parent ( river_vertex vertex,
uint32_t  x,
uint32_t  y 
)

Definition at line 862 of file map_borders.cpp.

Here is the caller graph for this function:

◆ check_for_potential_child()

std::vector< glm::ivec2 > map::check_for_potential_child ( std::vector< uint8_t > const &  river_data,
river_runner runner,
glm::ivec2  size 
)

Definition at line 898 of file map_borders.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_for_river()

bool map::check_for_river ( std::vector< uint8_t > const &  river_data,
river_runner runner,
int32_t  x,
int32_t  y,
glm::ivec2  size 
)

Definition at line 876 of file map_borders.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ coastal_point()

bool map::coastal_point ( sys::state state,
uint16_t  a,
uint16_t  b 
)

Definition at line 269 of file map_borders.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_drag_box_vbo()

void map::create_drag_box_vbo ( GLuint  vbo)

Definition at line 247 of file map.cpp.

Here is the caller graph for this function:

◆ create_program()

GLuint map::create_program ( simple_fs::file vshader_file,
simple_fs::file fshader_file 
)

Definition at line 367 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_railroad_connection()

void map::create_railroad_connection ( sys::state state,
std::vector< glm::vec2 > &  railroad,
dcon::province_id  p1,
dcon::province_id  p2 
)

Definition at line 1659 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_text_line_vbo()

void map::create_text_line_vbo ( GLuint  vbo)

Definition at line 219 of file map.cpp.

Here is the caller graph for this function:

◆ create_textured_line_b_vbo()

void map::create_textured_line_b_vbo ( GLuint  vbo,
std::vector< textured_line_vertex_b > &  data 
)

Definition at line 166 of file map.cpp.

Here is the caller graph for this function:

◆ create_textured_line_vbo() [1/2]

void map::create_textured_line_vbo ( GLuint  vbo,
std::vector< textured_line_vertex > &  data 
)

Definition at line 112 of file map.cpp.

Here is the caller graph for this function:

◆ create_textured_line_vbo() [2/2]

void map::create_textured_line_vbo ( GLuint  vbo,
std::vector< textured_line_with_width_vertex > &  data 
)

Definition at line 137 of file map.cpp.

◆ create_unit_arrow_vbo()

void map::create_unit_arrow_vbo ( GLuint  vbo,
std::vector< curved_line_vertex > &  data 
)

Definition at line 190 of file map.cpp.

Here is the caller graph for this function:

◆ extend_if_possible()

bool map::extend_if_possible ( uint32_t  x,
int32_t  border_id,
direction  dir,
std::vector< border_direction > &  last_row,
std::vector< border_direction > &  current_row,
glm::vec2  map_size,
std::vector< curved_line_vertex > &  border_vertices 
)

Definition at line 42 of file map_borders.cpp.

◆ get_army_location()

glm::vec2 map::get_army_location ( sys::state state,
dcon::province_id  prov_id 
)

Definition at line 76 of file map_state.cpp.

◆ get_border_index()

int32_t map::get_border_index ( uint16_t  map_province_id1,
uint16_t  map_province_id2,
parsers::scenario_building_context context 
)

Definition at line 106 of file map_borders.cpp.

Here is the call graph for this function:

◆ get_diffuse_layer()

emfx::xac_pp_actor_material_layer map::get_diffuse_layer ( emfx::xac_pp_actor_material const &  mat)

Definition at line 2121 of file map.cpp.

Here is the caller graph for this function:

◆ get_navy_location()

glm::vec2 map::get_navy_location ( sys::state state,
dcon::province_id  prov_id 
)

Definition at line 69 of file map_state.cpp.

Here is the call graph for this function:

◆ get_port_location()

glm::vec2 map::get_port_location ( sys::state state,
dcon::province_id  p 
)

Definition at line 49 of file map_state.cpp.

Here is the caller graph for this function:

◆ get_provinces_part_of_rr_path()

bool map::get_provinces_part_of_rr_path ( sys::state state,
std::vector< bool > &  visited_adj,
std::vector< bool > &  visited_prov,
std::vector< dcon::province_id > &  provinces,
dcon::province_id  p 
)

Definition at line 1671 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_top_overlord()

dcon::nation_id map::get_top_overlord ( sys::state state,
dcon::nation_id  n 
)

Definition at line 216 of file map_state.cpp.

Here is the caller graph for this function:

◆ internal_make_index_map()

ankerl::unordered_dense::map< uint32_t, uint8_t > map::internal_make_index_map ( )

Definition at line 286 of file map_data_loading.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_inside_bbox()

bool map::is_inside_bbox ( std::array< glm::vec2, 5 > &  bbox,
glm::vec2  p 
)

Definition at line 191 of file map_state.cpp.

Here is the caller graph for this function:

◆ is_river()

bool map::is_river ( uint8_t  river_data)

Definition at line 238 of file map_borders.cpp.

Here is the caller graph for this function:

◆ is_river_merge()

bool map::is_river_merge ( uint8_t  river_data)

Definition at line 249 of file map_borders.cpp.

Here is the caller graph for this function:

◆ is_river_source()

bool map::is_river_source ( uint8_t  river_data)

Definition at line 246 of file map_borders.cpp.

Here is the caller graph for this function:

◆ is_sea_province()

bool map::is_sea_province ( sys::state state,
dcon::province_id  prov_id 
)

Definition at line 65 of file map_state.cpp.

Here is the caller graph for this function:

◆ load_bmp()

std::vector< uint8_t > map::load_bmp ( parsers::scenario_building_context context,
native_string_view  name,
glm::ivec2  map_size,
uint8_t  fill,
std::vector< bmp_pixel_data > *  color_table 
)

Definition at line 30 of file map_data_loading.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_dds_texture()

GLuint map::load_dds_texture ( simple_fs::directory const &  dir,
native_string_view  file_name,
int  soil_flags = ogl::SOIL_FLAG_TEXTURE_REPEATS 
)

Definition at line 2104 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_province_map()

GLuint map::load_province_map ( std::vector< uint16_t > &  province_index,
uint32_t  size_x,
uint32_t  size_y 
)

Definition at line 1201 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_river_crossings()

void map::load_river_crossings ( parsers::scenario_building_context context,
std::vector< uint8_t > const &  river_data,
glm::ivec2  map_size 
)

Definition at line 762 of file map_borders.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load_static_meshes()

void map::load_static_meshes ( sys::state state)

Definition at line 2137 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_army_path()

void map::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 at line 1616 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_border_section()

std::vector< glm::vec2 > map::make_border_section ( display_data dat,
sys::state state,
std::vector< bool > &  visited,
uint16_t  prov_prim,
uint16_t  prov_sec,
int32_t  start_x,
int32_t  start_y 
)

Definition at line 279 of file map_borders.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_coastal_loop()

std::vector< glm::vec2 > map::make_coastal_loop ( display_data dat,
sys::state state,
std::vector< bool > &  visited,
int32_t  start_x,
int32_t  start_y 
)

Definition at line 552 of file map_borders.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ make_navy_path()

void map::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 at line 1572 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ order_indifferent_compare()

bool map::order_indifferent_compare ( uint16_t  a,
uint16_t  b,
uint16_t  c,
uint16_t  d 
)

Definition at line 275 of file map_borders.cpp.

Here is the caller graph for this function:

◆ put_in_local()

glm::vec2 map::put_in_local ( glm::vec2  new_point,
glm::vec2  base_point,
float  size_x 
)

Definition at line 1561 of file map.cpp.

Here is the caller graph for this function:

◆ river_width()

int32_t map::river_width ( uint8_t  river_data)

Definition at line 241 of file map_borders.cpp.

Here is the caller graph for this function:

◆ try_load_shader()

std::optional< simple_fs::file > map::try_load_shader ( simple_fs::directory root,
native_string_view  name 
)

Definition at line 360 of file map.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_bbox()

void map::update_bbox ( std::array< glm::vec2, 5 > &  bbox,
glm::vec2  p 
)

Definition at line 179 of file map_state.cpp.

Here is the caller graph for this function:

◆ update_bbox_negative()

void map::update_bbox_negative ( std::array< glm::vec2, 5 > &  bbox,
glm::vec2  p 
)

Definition at line 205 of file map_state.cpp.

Here is the call graph for this function:

◆ update_text_lines()

void map::update_text_lines ( sys::state state,
display_data map_data 
)

Definition at line 230 of file map_state.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_unit_arrows()

void map::update_unit_arrows ( sys::state state,
display_data map_data 
)

Definition at line 80 of file map_state.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ control_point_length_factor

constexpr float map::control_point_length_factor = 0.3f
inlineconstexpr

Definition at line 1357 of file map.cpp.

◆ default_num_b_segments

constexpr uint32_t map::default_num_b_segments = 16
inlineconstexpr

Definition at line 1356 of file map.cpp.

◆ max_zoom

constexpr float map::max_zoom = 75.0f
inlineconstexpr

Definition at line 604 of file constants.hpp.

◆ min_zoom

constexpr float map::min_zoom = 1.0f
inlineconstexpr

Definition at line 603 of file constants.hpp.

◆ zoom_close

constexpr float map::zoom_close = 5.f
inlineconstexpr

Definition at line 605 of file constants.hpp.

◆ zoom_very_close

constexpr float map::zoom_very_close = 8.f
inlineconstexpr

Definition at line 606 of file constants.hpp.