Project Alice
Loading...
Searching...
No Matches
national_focus.hpp
Go to the documentation of this file.
1#pragma once
2
3std::vector<uint32_t> national_focus_map_from(sys::state& state) {
4 uint32_t province_size = state.world.province_size();
5 uint32_t texture_size = province_size + 256 - province_size % 256;
6
7 std::vector<uint32_t> prov_color(texture_size * 2);
8 state.world.for_each_province([&](dcon::province_id prov_id) {
9 auto fat_id = dcon::fatten(state.world, prov_id);
10 auto nation = fat_id.get_nation_from_province_ownership();
11 auto i = province::to_map_id(prov_id);
12
13 if(nation == state.local_player_nation && fat_id.get_state_membership().get_owner_focus()) {
14 prov_color[i] = sys::pack_color(46, 247, 15);
15 prov_color[i + texture_size] = sys::pack_color(46, 247, 15);
16 }
17 });
18 return prov_color;
19}
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)
Definition: province.hpp:10
uint32_t pack_color(float r, float g, float b)
std::vector< uint32_t > national_focus_map_from(sys::state &state)
uint uint32_t