4 uint32_t province_size = state.world.province_size();
5 uint32_t texture_size = province_size + 256 - province_size % 256;
7 std::vector<uint32_t> prov_color(texture_size * 2);
9 auto selected_province = state.map_state.get_selected_province();
10 auto fat_id =
dcon::fatten(state.world, selected_province);
11 auto selected_nation = fat_id.get_nation_from_province_ownership();
13 if(!selected_nation) {
14 selected_nation = state.local_player_nation;
17 auto relations = selected_nation.get_diplomatic_relation_as_related_nations();
19 state.world.for_each_province([&](dcon::province_id prov_id) {
20 auto other_nation = state.world.province_get_nation_from_province_ownership(prov_id);
29 if(other_nation == selected_nation.id) {
31 color = sys::pack_color(66, 106, 227);
33 auto diplo_relation = state.world.get_diplomatic_relation_by_diplomatic_pair(other_nation, selected_nation);
34 auto relation_value = state.world.diplomatic_relation_get_value(diplo_relation);
36 float interpolation = (200 + relation_value) / 400.f;
38 color = ogl::color_gradient(interpolation, sys::pack_color(46, 247, 15),
39 sys::pack_color(247, 15, 15)
45 prov_color[i] = color;
46 prov_color[i + texture_size] = color;
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
constexpr uint16_t to_map_id(dcon::province_id id)
std::vector< uint32_t > relation_map_from(sys::state &state)