Project Alice
Loading...
Searching...
No Matches
region.hpp
Go to the documentation of this file.
1#pragma once
2
3std::vector<uint32_t> region_map_from(sys::state& state) {
4 uint32_t province_size = state.world.province_size() + 1;
5 uint32_t texture_size = province_size + 256 - province_size % 256;
6
7 std::vector<uint32_t> prov_color(texture_size * 2);
8
9 state.world.for_each_province([&](dcon::province_id prov_id) {
10 auto fat_id = dcon::fatten(state.world, prov_id);
11 auto id = fat_id.get_abstract_state_membership();
12 uint32_t color = ogl::color_from_hash(id.get_state().id.index());
13 auto i = province::to_map_id(prov_id);
14 prov_color[i] = color;
15 prov_color[i + texture_size] = color;
16 });
17
18 return prov_color;
19}
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
constexpr uint32_t color_from_hash(uint32_t color)
Definition: color.hpp:9
constexpr uint16_t to_map_id(dcon::province_id id)
Definition: province.hpp:10
uint uint32_t
std::vector< uint32_t > region_map_from(sys::state &state)
Definition: region.hpp:3