Project Alice
|
#include <map_state.hpp>
Public Member Functions | |
map_state () | |
void | load_map_data (parsers::scenario_building_context &context) |
void | load_map (sys::state &state) |
map_view | current_view (sys::state &state) |
void | render (sys::state &state, uint32_t screen_x, uint32_t screen_y) |
void | set_province_color (std::vector< uint32_t > const &prov_color, map_mode::mode map_mode) |
void | set_terrain_map_mode () |
void | update_borders (sys::state &state) |
glm::vec2 | normalize_map_coord (glm::vec2 pos) |
bool | map_to_screen (sys::state &state, glm::vec2 map_pos, glm::vec2 screen_size, glm::vec2 &screen_pos) |
void | set_pos (glm::vec2 pos) |
void | center_map_on_province (sys::state &state, dcon::province_id) |
void | on_key_down (sys::virtual_key keycode, sys::key_modifiers mod) |
void | on_key_up (sys::virtual_key keycode, sys::key_modifiers mod) |
void | on_mouse_wheel (int32_t x, int32_t y, int32_t screen_size_x, int32_t screen_size_y, sys::key_modifiers mod, float amount) |
void | on_mouse_move (int32_t x, int32_t y, int32_t screen_size_x, int32_t screen_size_y, sys::key_modifiers mod) |
void | on_mbuttom_down (int32_t x, int32_t y, int32_t screen_size_x, int32_t screen_size_y, sys::key_modifiers mod) |
void | on_mbuttom_up (int32_t x, int32_t y, sys::key_modifiers mod) |
void | on_lbutton_down (sys::state &state, int32_t x, int32_t y, int32_t screen_size_x, int32_t screen_size_y, sys::key_modifiers mod) |
void | on_lbutton_up (sys::state &state, int32_t x, int32_t y, int32_t screen_size_x, int32_t screen_size_y, sys::key_modifiers mod) |
void | on_rbutton_down (sys::state &state, int32_t x, int32_t y, int32_t screen_size_x, int32_t screen_size_y, sys::key_modifiers mod) |
dcon::province_id | get_province_under_mouse (sys::state &state, int32_t x, int32_t y, int32_t screen_size_x, int32_t screen_size_y) |
dcon::province_id | get_selected_province () |
void | set_selected_province (dcon::province_id prov_id) |
void | update (sys::state &state) |
bool | screen_to_map (glm::vec2 screen_pos, glm::vec2 screen_size, map_view view_mode, glm::vec2 &map_pos) |
float | get_zoom () |
Public Attributes | |
map_mode::mode | active_map_mode = map_mode::mode::terrain |
dcon::province_id | selected_province = dcon::province_id{} |
display_data | map_data |
bool | is_dragging = false |
std::chrono::time_point< std::chrono::steady_clock > | last_update_time {} |
float | time_counter = 0 |
bool | unhandled_province_selection = false |
glm::vec2 | pos = glm::vec2(0.5f, 0.5f) |
glm::vec2 | pos_velocity = glm::vec2(0.f) |
glm::vec2 | last_camera_drag_pos = glm::vec2(0.5f, 0.5f) |
glm::mat4 | globe_rotation = glm::mat4(1.0f) |
glm::vec2 | last_unit_box_drag_pos = glm::vec2(0, 0) |
float | zoom = 1.f |
float | zoom_change = 1.f |
bool | has_zoom_changed = false |
bool | pgup_key_down = false |
bool | pgdn_key_down = false |
bool | left_arrow_key_down = false |
bool | right_arrow_key_down = false |
bool | up_arrow_key_down = false |
bool | down_arrow_key_down = false |
bool | shift_key_down = false |
bool | left_mouse_down = false |
glm::vec2 | scroll_pos_velocity = glm::vec2(0.f) |
std::vector< bool > | visible_provinces |
Definition at line 18 of file map_state.hpp.
|
inline |
Definition at line 20 of file map_state.hpp.
void map::map_state::center_map_on_province | ( | sys::state & | state, |
dcon::province_id | p | ||
) |
map_view map::map_state::current_view | ( | sys::state & | state | ) |
Definition at line 27 of file map_state.cpp.
dcon::province_id map::map_state::get_province_under_mouse | ( | sys::state & | state, |
int32_t | x, | ||
int32_t | y, | ||
int32_t | screen_size_x, | ||
int32_t | screen_size_y | ||
) |
Definition at line 1385 of file map_state.cpp.
dcon::province_id map::map_state::get_selected_province | ( | ) |
Definition at line 18 of file map_state.cpp.
|
inline |
void map::map_state::load_map | ( | sys::state & | state | ) |
void map::map_state::load_map_data | ( | parsers::scenario_building_context & | context | ) |
Definition at line 670 of file map_data_loading.cpp.
bool map::map_state::map_to_screen | ( | sys::state & | state, |
glm::vec2 | map_pos, | ||
glm::vec2 | screen_size, | ||
glm::vec2 & | screen_pos | ||
) |
glm::vec2 map::map_state::normalize_map_coord | ( | glm::vec2 | pos | ) |
void map::map_state::on_key_down | ( | sys::virtual_key | keycode, |
sys::key_modifiers | mod | ||
) |
Definition at line 1132 of file map_state.cpp.
void map::map_state::on_key_up | ( | sys::virtual_key | keycode, |
sys::key_modifiers | mod | ||
) |
void map::map_state::on_lbutton_down | ( | sys::state & | state, |
int32_t | x, | ||
int32_t | y, | ||
int32_t | screen_size_x, | ||
int32_t | screen_size_y, | ||
sys::key_modifiers | mod | ||
) |
void map::map_state::on_lbutton_up | ( | sys::state & | state, |
int32_t | x, | ||
int32_t | y, | ||
int32_t | screen_size_x, | ||
int32_t | screen_size_y, | ||
sys::key_modifiers | mod | ||
) |
void map::map_state::on_mbuttom_down | ( | int32_t | x, |
int32_t | y, | ||
int32_t | screen_size_x, | ||
int32_t | screen_size_y, | ||
sys::key_modifiers | mod | ||
) |
Definition at line 1314 of file map_state.cpp.
void map::map_state::on_mbuttom_up | ( | int32_t | x, |
int32_t | y, | ||
sys::key_modifiers | mod | ||
) |
void map::map_state::on_mouse_move | ( | int32_t | x, |
int32_t | y, | ||
int32_t | screen_size_x, | ||
int32_t | screen_size_y, | ||
sys::key_modifiers | mod | ||
) |
Definition at line 1211 of file map_state.cpp.
void map::map_state::on_mouse_wheel | ( | int32_t | x, |
int32_t | y, | ||
int32_t | screen_size_x, | ||
int32_t | screen_size_y, | ||
sys::key_modifiers | mod, | ||
float | amount | ||
) |
void map::map_state::on_rbutton_down | ( | sys::state & | state, |
int32_t | x, | ||
int32_t | y, | ||
int32_t | screen_size_x, | ||
int32_t | screen_size_y, | ||
sys::key_modifiers | mod | ||
) |
void map::map_state::render | ( | sys::state & | state, |
uint32_t | screen_x, | ||
uint32_t | screen_y | ||
) |
bool map::map_state::screen_to_map | ( | glm::vec2 | screen_pos, |
glm::vec2 | screen_size, | ||
map_view | view_mode, | ||
glm::vec2 & | map_pos | ||
) |
void map::map_state::set_pos | ( | glm::vec2 | pos | ) |
void map::map_state::set_province_color | ( | std::vector< uint32_t > const & | prov_color, |
map_mode::mode | map_mode | ||
) |
void map::map_state::set_selected_province | ( | dcon::province_id | prov_id | ) |
void map::map_state::set_terrain_map_mode | ( | ) |
Definition at line 1128 of file map_state.cpp.
void map::map_state::update | ( | sys::state & | state | ) |
Definition at line 967 of file map_state.cpp.
void map::map_state::update_borders | ( | sys::state & | state | ) |
map_mode::mode map::map_state::active_map_mode = map_mode::mode::terrain |
Definition at line 57 of file map_state.hpp.
bool map::map_state::down_arrow_key_down = false |
Definition at line 87 of file map_state.hpp.
glm::mat4 map::map_state::globe_rotation = glm::mat4(1.0f) |
Definition at line 76 of file map_state.hpp.
bool map::map_state::has_zoom_changed = false |
Definition at line 81 of file map_state.hpp.
bool map::map_state::is_dragging = false |
Definition at line 61 of file map_state.hpp.
glm::vec2 map::map_state::last_camera_drag_pos = glm::vec2(0.5f, 0.5f) |
Definition at line 75 of file map_state.hpp.
glm::vec2 map::map_state::last_unit_box_drag_pos = glm::vec2(0, 0) |
Definition at line 77 of file map_state.hpp.
std::chrono::time_point<std::chrono::steady_clock> map::map_state::last_update_time {} |
Definition at line 64 of file map_state.hpp.
bool map::map_state::left_arrow_key_down = false |
Definition at line 84 of file map_state.hpp.
bool map::map_state::left_mouse_down = false |
Definition at line 89 of file map_state.hpp.
display_data map::map_state::map_data |
Definition at line 60 of file map_state.hpp.
bool map::map_state::pgdn_key_down = false |
Definition at line 83 of file map_state.hpp.
bool map::map_state::pgup_key_down = false |
Definition at line 82 of file map_state.hpp.
glm::vec2 map::map_state::pos = glm::vec2(0.5f, 0.5f) |
Definition at line 73 of file map_state.hpp.
glm::vec2 map::map_state::pos_velocity = glm::vec2(0.f) |
Definition at line 74 of file map_state.hpp.
bool map::map_state::right_arrow_key_down = false |
Definition at line 85 of file map_state.hpp.
glm::vec2 map::map_state::scroll_pos_velocity = glm::vec2(0.f) |
Definition at line 90 of file map_state.hpp.
dcon::province_id map::map_state::selected_province = dcon::province_id{} |
Definition at line 58 of file map_state.hpp.
bool map::map_state::shift_key_down = false |
Definition at line 88 of file map_state.hpp.
float map::map_state::time_counter = 0 |
Definition at line 67 of file map_state.hpp.
bool map::map_state::unhandled_province_selection = false |
Definition at line 70 of file map_state.hpp.
bool map::map_state::up_arrow_key_down = false |
Definition at line 86 of file map_state.hpp.
std::vector<bool> map::map_state::visible_provinces |
Definition at line 91 of file map_state.hpp.
float map::map_state::zoom = 1.f |
Definition at line 79 of file map_state.hpp.
float map::map_state::zoom_change = 1.f |
Definition at line 80 of file map_state.hpp.