10 uint32_t province_size = state.world.province_size();
11 uint32_t texture_size = province_size + 256 - province_size % 256;
13 std::vector<uint32_t> prov_color(texture_size * 2);
15 auto num_nations = state.world.nation_size();
16 auto unciv_rank = num_nations;
17 for(
uint32_t i = 0; i < num_nations; ++i) {
18 if(!state.world.nation_get_is_civilized(state.nations_by_rank[i])) {
24 state.world.for_each_province([&](dcon::province_id prov_id) {
27 auto nation_id = fat_id.get_nation_from_province_ownership();
30 float darkness = 0.0f;
32 darkness = 1.0f - 0.7f * (state.world.nation_get_rank(nation_id)) / state.defines.great_nations_count;
34 darkness = 1.0f - 0.7f * (state.world.nation_get_rank(nation_id) - state.defines.great_nations_count) /
35 (state.defines.colonial_rank - state.defines.great_nations_count);
37 darkness = 1.0f - 0.7f * (state.world.nation_get_rank(nation_id) - state.defines.colonial_rank) /
38 std::max(1.0f, (
float(unciv_rank) - state.defines.colonial_rank));
40 darkness = 1.0f - 0.7f * (state.world.nation_get_rank(nation_id) - unciv_rank) /
41 std::max(1.0f, (
float(num_nations) - float(unciv_rank)));
47 color =
sys::pack_color(int32_t(48 * darkness), int32_t(242 * darkness), int32_t(51 * darkness));
51 color =
sys::pack_color(int32_t(36 * darkness), int32_t(47 * darkness), int32_t(255 * darkness));
55 color =
sys::pack_color(int32_t(238 * darkness), int32_t(252 * darkness), int32_t(38 * darkness));
60 color =
sys::pack_color(int32_t(250 * darkness), int32_t(5 * darkness), int32_t(5 * darkness));
64 color = 255 << 16 | 255 << 8 | 255;
69 prov_color[i] = color;
70 prov_color[i + texture_size] = color;
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
status get_status(sys::state &state, dcon::nation_id n)
constexpr uint16_t to_map_id(dcon::province_id id)
uint32_t pack_color(float r, float g, float b)
std::vector< uint32_t > rank_map_from(sys::state &state)