Project Alice
Loading...
Searching...
No Matches
map_modes.cpp
Go to the documentation of this file.
1#include "map_modes.hpp"
2
3#include "color.hpp"
4#include "demographics.hpp"
5#include "system_state.hpp"
6#include "dcon_generated.hpp"
7#include "province.hpp"
8#include "nations.hpp"
9#include <unordered_map>
10
11#include "modes/political.hpp"
12#include "modes/supply.hpp"
13#include "modes/region.hpp"
14#include "modes/nationality.hpp"
15#include "modes/population.hpp"
16#include "modes/sphere.hpp"
17#include "modes/diplomatic.hpp"
18#include "modes/rank.hpp"
19#include "modes/relation.hpp"
20#include "modes/recruitment.hpp"
22#include "modes/migration.hpp"
24#include "modes/revolt.hpp"
26#include "modes/admin.hpp"
27#include "modes/naval.hpp"
29#include "modes/crisis.hpp"
30#include "modes/colonial.hpp"
31#include "modes/rgo_output.hpp"
32#include "modes/religion.hpp"
33
34//
35// EXTRA MAP MODES
36//
37std::vector<uint32_t> ideology_map_from(sys::state& state) {
38 uint32_t province_size = state.world.province_size() + 1;
39 uint32_t texture_size = province_size + 256 - province_size % 256;
40 std::vector<uint32_t> prov_color(texture_size * 2);
41 if(state.map_state.get_selected_province()) {
42 auto fat_id = state.world.province_get_dominant_ideology(state.map_state.get_selected_province());
43 if(bool(fat_id)) {
44 uint32_t full_color = fat_id.get_color();
45 uint32_t empty_color = 0xDDDDDD;
46 // Make the other end of the gradient dark if the color is bright and vice versa.
47 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
48 empty_color = 0x222222;
49 }
50 auto const pkey = pop_demographics::to_key(state, fat_id.id);
51 state.world.for_each_province([&](dcon::province_id prov_id) {
52 auto i = province::to_map_id(prov_id);
53 float total = 0.f;
54 float value = 0.f;
55 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
56 value += pop_demographics::get_demo(state, pl.get_pop(), pkey) * pl.get_pop().get_size();
57 total += pl.get_pop().get_size();
58 }
59 auto ratio = value / total;
60 auto color = ogl::color_gradient(ratio, full_color, empty_color);
61 prov_color[i] = color;
62 prov_color[i + texture_size] = color;
63 });
64 }
65 } else {
66 state.world.for_each_province([&](dcon::province_id prov_id) {
67 auto id = province::to_map_id(prov_id);
68 float total_pops = state.world.province_get_demographics(prov_id, demographics::total);
69 dcon::ideology_id primary_id;
70 dcon::ideology_id secondary_id;
71 float primary_percent = 0.f;
72 float secondary_percent = 0.f;
73 state.world.for_each_ideology([&](dcon::ideology_id id) {
74 auto demo_key = demographics::to_key(state, id);
75 auto volume = state.world.province_get_demographics(prov_id, demo_key);
76 float percent = volume / total_pops;
77 if(percent > primary_percent) {
78 secondary_id = primary_id;
79 secondary_percent = primary_percent;
80 primary_id = id;
81 primary_percent = percent;
82 } else if(percent > secondary_percent) {
83 secondary_id = id;
84 secondary_percent = percent;
85 }
86 });
87 uint32_t primary_color = dcon::fatten(state.world, primary_id).get_color();
88 uint32_t secondary_color = 0xFFAAAAAA; // This color won't be reached
89 if(bool(secondary_id)) {
90 secondary_color = dcon::fatten(state.world, secondary_id).get_color();
91 }
92 if(secondary_percent >= primary_percent * 0.75f) {
93 prov_color[id] = primary_color;
94 prov_color[id + texture_size] = secondary_color;
95 } else {
96 prov_color[id] = primary_color;
97 prov_color[id + texture_size] = primary_color;
98 }
99 });
100 }
101 return prov_color;
102}
103
104std::vector<uint32_t> issue_map_from(sys::state& state) {
105 uint32_t province_size = state.world.province_size() + 1;
106 uint32_t texture_size = province_size + 256 - province_size % 256;
107 std::vector<uint32_t> prov_color(texture_size * 2);
108 if(state.map_state.get_selected_province()) {
109 auto fat_id = state.world.province_get_dominant_issue_option(state.map_state.get_selected_province());
110 if(bool(fat_id)) {
111 uint32_t full_color = ogl::get_ui_color(state, fat_id.id);
112 uint32_t empty_color = 0xDDDDDD;
113 // Make the other end of the gradient dark if the color is bright and vice versa.
114 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
115 empty_color = 0x222222;
116 }
117 auto const pkey = pop_demographics::to_key(state, fat_id.id);
118 state.world.for_each_province([&](dcon::province_id prov_id) {
119 auto i = province::to_map_id(prov_id);
120 float total = 0.f;
121 float value = 0.f;
122 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
123 value += pop_demographics::get_demo(state, pl.get_pop(), pkey) * pl.get_pop().get_size();
124 total += pl.get_pop().get_size();
125 }
126 auto ratio = value / total;
127 auto color = ogl::color_gradient(ratio, full_color, empty_color);
128 prov_color[i] = color;
129 prov_color[i + texture_size] = color;
130 });
131 }
132 } else {
133 state.world.for_each_province([&](dcon::province_id prov_id) {
134 auto id = province::to_map_id(prov_id);
135 float total_pops = state.world.province_get_demographics(prov_id, demographics::total);
136 dcon::issue_option_id primary_id;
137 dcon::issue_option_id secondary_id;
138 float primary_percent = 0.f;
139 float secondary_percent = 0.f;
140 state.world.for_each_issue_option([&](dcon::issue_option_id id) {
141 auto demo_key = demographics::to_key(state, id);
142 auto volume = state.world.province_get_demographics(prov_id, demo_key);
143 float percent = volume / total_pops;
144 if(percent > primary_percent) {
145 secondary_id = primary_id;
146 secondary_percent = primary_percent;
147 primary_id = id;
148 primary_percent = percent;
149 } else if(percent > secondary_percent) {
150 secondary_id = id;
151 secondary_percent = percent;
152 }
153 });
154 uint32_t primary_color = ogl::get_ui_color(state, primary_id);
155 uint32_t secondary_color = 0xFFAAAAAA; // This color won't be reached
156 if(bool(secondary_id)) {
157 secondary_color = ogl::get_ui_color(state, secondary_id);
158 }
159 if(secondary_percent >= primary_percent * 0.75f) {
160 prov_color[id] = primary_color;
161 prov_color[id + texture_size] = secondary_color;
162 } else {
163 prov_color[id] = primary_color;
164 prov_color[id + texture_size] = primary_color;
165 }
166 });
167 }
168 return prov_color;
169}
170
171std::vector<uint32_t> fort_map_from(sys::state& state) {
172 uint32_t province_size = state.world.province_size();
173 uint32_t texture_size = province_size + 256 - province_size % 256;
174 std::vector<uint32_t> prov_color(texture_size * 2);
175 int32_t max_lvl = state.economy_definitions.building_definitions[int32_t(economy::province_building_type::fort)].max_level;
176 state.world.for_each_province([&](dcon::province_id prov_id) {
177 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
178 int32_t current_lvl = state.world.province_get_building_level(prov_id, uint8_t(economy::province_building_type::fort));
179 int32_t max_local_lvl = state.world.nation_get_max_building_level(state.local_player_nation, uint8_t(economy::province_building_type::fort));
180 uint32_t color = 0x222222;
181 uint32_t stripe_color = 0x222222;
182
183 if(current_lvl > 0) {
184 color = ogl::color_gradient(
185 float(current_lvl) / float(max_lvl),
186 sys::pack_color(14, 240, 44), // green
187 sys::pack_color(41, 5, 245) // blue
188 );
189 }
190 if(province::can_build_fort(state, prov_id, state.local_player_nation)) {
191 stripe_color = sys::pack_color(232, 228, 111); // yellow
192 } else if(nation == state.local_player_nation && province::has_fort_being_built(state, prov_id)) {
193 stripe_color = sys::pack_color(247, 15, 15); // yellow
194 } else {
195 stripe_color = color;
196 }
197 auto i = province::to_map_id(prov_id);
198 prov_color[i] = color;
199 prov_color[i + texture_size] = stripe_color;
200 });
201 return prov_color;
202}
203
204std::vector<uint32_t> factory_map_from(sys::state& state) {
205 uint32_t province_size = state.world.province_size();
206 uint32_t texture_size = province_size + 256 - province_size % 256;
207 std::vector<uint32_t> prov_color(texture_size * 2);
208
209 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
210 // get state with most factories
211 int32_t max_total = 0;
212 state.world.for_each_state_instance([&](dcon::state_instance_id sid) {
213 auto sdef = state.world.state_instance_get_definition(sid);
214 int32_t total = 0;
215 if(sel_nation) {
216 total = economy::state_factory_count(state, sid, sel_nation);
217 } else {
218 for(const auto abm : state.world.state_definition_get_abstract_state_membership(sdef)) {
219 total = std::max(total, economy::state_factory_count(state, sid, abm.get_province().get_nation_from_province_ownership()));
220 }
221 }
222 if(total > max_total)
223 max_total = total;
224 if(max_total == 0)
225 max_total = 1;
226 });
227 state.world.for_each_state_instance([&](dcon::state_instance_id sid) {
228 int32_t total = 0;
229 auto sdef = state.world.state_instance_get_definition(sid);
230
231 for(const auto abm : state.world.state_definition_get_abstract_state_membership(sdef)) {
232 if((sel_nation && abm.get_province().get_province_ownership().get_nation() != sel_nation)
233 || !(abm.get_province().get_nation_from_province_ownership()))
234 continue;
235 total = economy::state_factory_count(state, sid, abm.get_province().get_nation_from_province_ownership());
236 float value = float(total) / float(max_total);
237 uint32_t color = ogl::color_gradient(value,
238 sys::pack_color(46, 247, 15), // green
239 sys::pack_color(247, 15, 15) // red
240 );
241 auto i = province::to_map_id(abm.get_province());
242 prov_color[i] = color;
243 prov_color[i + texture_size] = color;
244 }
245 });
246 return prov_color;
247}
248
249std::vector<uint32_t> con_map_from(sys::state& state) {
250 uint32_t province_size = state.world.province_size();
251 uint32_t texture_size = province_size + 256 - province_size % 256;
252 std::vector<uint32_t> prov_color(texture_size * 2);
253 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
254 state.world.for_each_province([&](dcon::province_id prov_id) {
255 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
256 if((sel_nation && nation == sel_nation) || !sel_nation) {
257 auto scale = 1.f / 10.f;
258 auto value = scale * (state.world.province_get_demographics(prov_id, demographics::consciousness) / state.world.province_get_demographics(prov_id, demographics::total));
259 uint32_t color = ogl::color_gradient(1.f - value,
260 sys::pack_color(46, 247, 15), // green
261 sys::pack_color(247, 15, 15) // red
262 );
263 auto i = province::to_map_id(prov_id);
264 prov_color[i] = color;
265 prov_color[i + texture_size] = color;
266 }
267 });
268 return prov_color;
269}
270
271std::vector<uint32_t> literacy_map_from(sys::state& state) {
272 uint32_t province_size = state.world.province_size();
273 uint32_t texture_size = province_size + 256 - province_size % 256;
274 std::vector<uint32_t> prov_color(texture_size * 2);
275 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
276 state.world.for_each_province([&](dcon::province_id prov_id) {
277 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
278 if((sel_nation && nation == sel_nation) || !sel_nation) {
279 auto value = (state.world.province_get_demographics(prov_id, demographics::literacy) / state.world.province_get_demographics(prov_id, demographics::total));
280 uint32_t color = ogl::color_gradient(value,
281 sys::pack_color(46, 247, 15), // green
282 sys::pack_color(247, 15, 15) // red
283 );
284 auto i = province::to_map_id(prov_id);
285 prov_color[i] = color;
286 prov_color[i + texture_size] = color;
287 }
288 });
289 return prov_color;
290}
291std::vector<uint32_t> growth_map_from(sys::state& state) {
292 std::vector<float> prov_population_change(state.world.province_size() + 1);
293 std::unordered_map<int32_t, float> continent_max_growth = {};
294 std::unordered_map<int32_t, float> continent_min_growth = {};
295 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
296 state.world.for_each_province([&](dcon::province_id prov_id) {
297 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
298 if((sel_nation && nation == sel_nation) || !sel_nation) {
299 auto fat_id = dcon::fatten(state.world, prov_id);
300 float population_change = float(demographics::get_monthly_pop_increase(state, prov_id));
301 auto cid = fat_id.get_continent().id.index();
302 continent_max_growth[cid] = std::max(continent_max_growth[cid], population_change);
303 continent_min_growth[cid] = std::min(continent_min_growth[cid], population_change);
304 auto i = province::to_map_id(prov_id);
305 prov_population_change[i] = population_change;
306 }
307 });
308 uint32_t province_size = state.world.province_size() + 1;
309 uint32_t texture_size = province_size + 256 - province_size % 256;
310 std::vector<uint32_t> prov_color(texture_size * 2);
311 state.world.for_each_province([&](dcon::province_id prov_id) {
312 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
313 if((sel_nation && nation == sel_nation) || !sel_nation) {
314 auto fat_id = dcon::fatten(state.world, prov_id);
315 auto cid = fat_id.get_continent().id.index();
316 auto i = province::to_map_id(prov_id);
317 auto color = sys::pack_color(232, 228, 111); // yellow
318 if(prov_population_change[i] > 0.f) {
319 float gradient_index = (continent_max_growth[cid] == 0.f ? 0.f : (prov_population_change[i] / continent_max_growth[cid]));
320 color = ogl::color_gradient(gradient_index,
321 sys::pack_color(46, 247, 15), // green
322 sys::pack_color(232, 228, 111) // yellow
323 );
324 } else if(prov_population_change[i] < 0.f) {
325 float gradient_index = (continent_min_growth[cid] == 0.f ? 0.f : (prov_population_change[i] / continent_min_growth[cid]));
326 color = ogl::color_gradient(gradient_index,
327 sys::pack_color(247, 15, 15), // red
328 sys::pack_color(232, 228, 111) // yellow
329 );
330 }
331 prov_color[i] = color;
332 prov_color[i + texture_size] = color;
333 }
334 });
335 return prov_color;
336}
337std::vector<uint32_t> income_map_from(sys::state& state) {
338 std::vector<float> prov_population(state.world.province_size() + 1);
339 std::unordered_map<int32_t, float> continent_max_pop = {};
340 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
341 state.world.for_each_province([&](dcon::province_id prov_id) {
342 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
343 if((sel_nation && nation == sel_nation) || !sel_nation) {
344 auto fat_id = dcon::fatten(state.world, prov_id);
345 float population = 0.f;
346 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id))
347 population += pl.get_pop().get_savings();
348 auto cid = fat_id.get_continent().id.index();
349 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
350 auto i = province::to_map_id(prov_id);
351 prov_population[i] = population;
352 }
353 });
354 uint32_t province_size = state.world.province_size() + 1;
355 uint32_t texture_size = province_size + 256 - province_size % 256;
356 std::vector<uint32_t> prov_color(texture_size * 2);
357 state.world.for_each_province([&](dcon::province_id prov_id) {
358 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
359 if((sel_nation && nation == sel_nation) || !sel_nation) {
360 auto fat_id = dcon::fatten(state.world, prov_id);
361 auto cid = fat_id.get_continent().id.index();
362 auto i = province::to_map_id(prov_id);
363 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
364 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
365 prov_color[i] = color;
366 prov_color[i + texture_size] = color;
367 }
368 });
369 return prov_color;
370}
371std::vector<uint32_t> employment_map_from(sys::state& state) {
372 uint32_t province_size = state.world.province_size();
373 uint32_t texture_size = province_size + 256 - province_size % 256;
374 std::vector<uint32_t> prov_color(texture_size * 2);
375 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
376 state.world.for_each_province([&](dcon::province_id prov_id) {
377 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
378 if((sel_nation && nation == sel_nation) || !sel_nation) {
379 auto value = state.world.province_get_demographics(prov_id, demographics::employed) / state.world.province_get_demographics(prov_id, demographics::employable);
380 uint32_t color = ogl::color_gradient(value,
381 sys::pack_color(46, 247, 15), // green
382 sys::pack_color(247, 15, 15) // red
383 );
384 auto i = province::to_map_id(prov_id);
385 prov_color[i] = color;
386 prov_color[i + texture_size] = color;
387 }
388 });
389 return prov_color;
390}
391
392std::vector<uint32_t> militancy_map_from(sys::state& state) {
393 uint32_t province_size = state.world.province_size();
394 uint32_t texture_size = province_size + 256 - province_size % 256;
395
396 std::vector<uint32_t> prov_color(texture_size * 2);
397 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
398 state.world.for_each_province([&](dcon::province_id prov_id) {
399 auto fat_id = dcon::fatten(state.world, prov_id);
400 auto nation = fat_id.get_nation_from_province_ownership();
401 if((sel_nation && nation == sel_nation) || !sel_nation) {
402 float revolt_risk = province::revolt_risk(state, prov_id) / 10;
403 uint32_t color = ogl::color_gradient(revolt_risk,
404 sys::pack_color(247, 15, 15), // green
405 sys::pack_color(46, 247, 15) // red
406 );
407 auto i = province::to_map_id(prov_id);
408 prov_color[i] = color;
409 prov_color[i + texture_size] = color;
410 }
411 });
412 return prov_color;
413}
414
415//
416// Even newer mapmodes!
417//
418std::vector<uint32_t> life_needs_map_from(sys::state& state) {
419 std::vector<float> prov_population(state.world.province_size() + 1);
420 std::unordered_map<int32_t, float> continent_max_pop = {};
421 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
422 state.world.for_each_province([&](dcon::province_id prov_id) {
423 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
424 if((sel_nation && nation == sel_nation) || !sel_nation) {
425 auto fat_id = dcon::fatten(state.world, prov_id);
426 float population = 0.f;
427 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id))
428 population += pop_demographics::get_life_needs(state, pl.get_pop()) * pl.get_pop().get_size();
429 auto cid = fat_id.get_continent().id.index();
430 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
431 auto i = province::to_map_id(prov_id);
432 prov_population[i] = population;
433 }
434 });
435 uint32_t province_size = state.world.province_size() + 1;
436 uint32_t texture_size = province_size + 256 - province_size % 256;
437 std::vector<uint32_t> prov_color(texture_size * 2);
438 state.world.for_each_province([&](dcon::province_id prov_id) {
439 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
440 if((sel_nation && nation == sel_nation) || !sel_nation) {
441 auto fat_id = dcon::fatten(state.world, prov_id);
442 auto cid = fat_id.get_continent().id.index();
443 auto i = province::to_map_id(prov_id);
444 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
445 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
446 prov_color[i] = color;
447 prov_color[i + texture_size] = color;
448 }
449 });
450 return prov_color;
451}
452std::vector<uint32_t> everyday_needs_map_from(sys::state& state) {
453 std::vector<float> prov_population(state.world.province_size() + 1);
454 std::unordered_map<int32_t, float> continent_max_pop = {};
455 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
456 state.world.for_each_province([&](dcon::province_id prov_id) {
457 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
458 if((sel_nation && nation == sel_nation) || !sel_nation) {
459 auto fat_id = dcon::fatten(state.world, prov_id);
460 float population = 0.f;
461 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id))
462 population += pop_demographics::get_everyday_needs(state, pl.get_pop()) * pl.get_pop().get_size();
463 auto cid = fat_id.get_continent().id.index();
464 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
465 auto i = province::to_map_id(prov_id);
466 prov_population[i] = population;
467 }
468 });
469 uint32_t province_size = state.world.province_size() + 1;
470 uint32_t texture_size = province_size + 256 - province_size % 256;
471 std::vector<uint32_t> prov_color(texture_size * 2);
472 state.world.for_each_province([&](dcon::province_id prov_id) {
473 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
474 if((sel_nation && nation == sel_nation) || !sel_nation) {
475 auto fat_id = dcon::fatten(state.world, prov_id);
476 auto cid = fat_id.get_continent().id.index();
477 auto i = province::to_map_id(prov_id);
478 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
479 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
480 prov_color[i] = color;
481 prov_color[i + texture_size] = color;
482 }
483 });
484 return prov_color;
485}
486std::vector<uint32_t> luxury_needs_map_from(sys::state& state) {
487 std::vector<float> prov_population(state.world.province_size() + 1);
488 std::unordered_map<int32_t, float> continent_max_pop = {};
489 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
490 state.world.for_each_province([&](dcon::province_id prov_id) {
491 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
492 if((sel_nation && nation == sel_nation) || !sel_nation) {
493 auto fat_id = dcon::fatten(state.world, prov_id);
494 float population = 0.f;
495 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id))
496 population += pop_demographics::get_luxury_needs(state, pl.get_pop()) * pl.get_pop().get_size();
497 auto cid = fat_id.get_continent().id.index();
498 continent_max_pop[cid] = std::max(continent_max_pop[cid], population);
499 auto i = province::to_map_id(prov_id);
500 prov_population[i] = population;
501 }
502 });
503 uint32_t province_size = state.world.province_size() + 1;
504 uint32_t texture_size = province_size + 256 - province_size % 256;
505 std::vector<uint32_t> prov_color(texture_size * 2);
506 state.world.for_each_province([&](dcon::province_id prov_id) {
507 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
508 if((sel_nation && nation == sel_nation) || !sel_nation) {
509 auto fat_id = dcon::fatten(state.world, prov_id);
510 auto cid = fat_id.get_continent().id.index();
511 auto i = province::to_map_id(prov_id);
512 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
513 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
514 prov_color[i] = color;
515 prov_color[i + texture_size] = color;
516 }
517 });
518 return prov_color;
519}
520std::vector<uint32_t> life_rating_map_from(sys::state& state) {
521 std::vector<float> prov_population(state.world.province_size() + 1);
522 std::unordered_map<int32_t, float> continent_max_pop = {};
523 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
524 state.world.for_each_province([&](dcon::province_id prov_id) {
525 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
526 if((sel_nation && nation == sel_nation) || !sel_nation) {
527 auto fat_id = dcon::fatten(state.world, prov_id);
528 auto cid = fat_id.get_continent().id.index();
529 continent_max_pop[cid] = std::max(continent_max_pop[cid], float(fat_id.get_life_rating()));
530 auto i = province::to_map_id(prov_id);
531 prov_population[i] = float(fat_id.get_life_rating());
532 }
533 });
534 uint32_t province_size = state.world.province_size() + 1;
535 uint32_t texture_size = province_size + 256 - province_size % 256;
536 std::vector<uint32_t> prov_color(texture_size * 2);
537 state.world.for_each_province([&](dcon::province_id prov_id) {
538 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
539 if((sel_nation && nation == sel_nation) || !sel_nation) {
540 auto fat_id = dcon::fatten(state.world, prov_id);
541 auto cid = fat_id.get_continent().id.index();
542 auto i = province::to_map_id(prov_id);
543 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
544 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
545 prov_color[i] = color;
546 prov_color[i + texture_size] = color;
547 }
548 });
549 return prov_color;
550}
551std::vector<uint32_t> officers_map_from(sys::state& state) {
552 std::vector<float> prov_population(state.world.province_size() + 1);
553 std::unordered_map<int32_t, float> continent_max_pop = {};
554 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
555 state.world.for_each_province([&](dcon::province_id prov_id) {
556 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
557 if((sel_nation && nation == sel_nation) || !sel_nation) {
558 auto fat_id = dcon::fatten(state.world, prov_id);
559 auto cid = fat_id.get_continent().id.index();
560 float total_officers = fat_id.get_demographics(demographics::to_key(state, state.culture_definitions.officers));
561 continent_max_pop[cid] = std::max(continent_max_pop[cid], total_officers);
562 auto i = province::to_map_id(prov_id);
563 prov_population[i] = total_officers;
564 }
565 });
566 uint32_t province_size = state.world.province_size() + 1;
567 uint32_t texture_size = province_size + 256 - province_size % 256;
568 std::vector<uint32_t> prov_color(texture_size * 2);
569 state.world.for_each_province([&](dcon::province_id prov_id) {
570 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
571 if((sel_nation && nation == sel_nation) || !sel_nation) {
572 auto fat_id = dcon::fatten(state.world, prov_id);
573 auto cid = fat_id.get_continent().id.index();
574 auto i = province::to_map_id(prov_id);
575 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
576 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
577 prov_color[i] = color;
578 prov_color[i + texture_size] = color;
579 }
580 });
581 return prov_color;
582}
583std::vector<uint32_t> ctc_map_from(sys::state& state) {
584 uint32_t province_size = state.world.province_size();
585 uint32_t texture_size = province_size + 256 - province_size % 256;
586 std::vector<uint32_t> prov_color(texture_size * 2);
587 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
588 state.world.for_each_province([&](dcon::province_id prov_id) {
589 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
590 if((sel_nation && nation == sel_nation) || !sel_nation) {
591 auto total_pw = state.world.province_get_demographics(prov_id, demographics::to_key(state, state.culture_definitions.primary_factory_worker));
592 auto total_sw = state.world.province_get_demographics(prov_id, demographics::to_key(state, state.culture_definitions.secondary_factory_worker));
593 auto total = total_pw + total_sw;
594 auto value = (total_pw == 0.f || total_sw == 0.f) ? 0.f : total_pw / (total_pw + total_sw);
595 value = 1.f - (state.economy_definitions.craftsmen_fraction - value);
596 uint32_t color = ogl::color_gradient(value,
597 sys::pack_color(46, 247, 15), // green
598 sys::pack_color(247, 15, 15) // red
599 );
600 auto i = province::to_map_id(prov_id);
601 prov_color[i] = color;
602 prov_color[i + texture_size] = color;
603 }
604 });
605 return prov_color;
606}
607std::vector<uint32_t> crime_map_from(sys::state& state) {
608 uint32_t province_size = state.world.province_size();
609 uint32_t texture_size = province_size + 256 - province_size % 256;
610 std::vector<uint32_t> prov_color(texture_size * 2);
611 state.world.for_each_province([&](dcon::province_id prov_id) {
612 dcon::crime_id cmp_crime;
613 if(state.map_state.get_selected_province()) {
614 cmp_crime = state.world.province_get_crime(state.map_state.get_selected_province());
615 }
616 auto i = province::to_map_id(prov_id);
617 if(auto crime = state.world.province_get_crime(prov_id); crime && (!cmp_crime || crime == cmp_crime)) {
618 prov_color[i] = ogl::get_ui_color(state, crime);
619 prov_color[i + texture_size] = ogl::get_ui_color(state, crime);
620 } else {
621 prov_color[i] = 0;
622 prov_color[i + texture_size] = 0;
623 }
624 });
625 return prov_color;
626}
627std::vector<uint32_t> rally_map_from(sys::state& state) {
628 uint32_t province_size = state.world.province_size();
629 uint32_t texture_size = province_size + 256 - province_size % 256;
630 std::vector<uint32_t> prov_color(texture_size * 2);
631 state.world.for_each_province([&](dcon::province_id prov_id) {
632 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
633 auto i = province::to_map_id(prov_id);
634 prov_color[i] = state.world.province_get_land_rally_point(prov_id) ? sys::pack_color(46, 247, 15) : 0;
635 prov_color[i + texture_size] = state.world.province_get_naval_rally_point(prov_id) ? sys::pack_color(46, 15, 247) : 0;
636 });
637 return prov_color;
638}
639std::vector<uint32_t> mobilization_map_from(sys::state& state) {
640 std::vector<float> prov_population(state.world.province_size() + 1);
641 std::unordered_map<int32_t, float> continent_max_pop = {};
642 auto sel_nation = state.world.province_get_nation_from_province_ownership(state.map_state.get_selected_province());
643 state.world.for_each_province([&](dcon::province_id prov_id) {
644 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
645 if((sel_nation && nation == sel_nation) || !sel_nation) {
646 auto fat_id = dcon::fatten(state.world, prov_id);
647 auto cid = fat_id.get_continent().id.index();
648 float total_regs = float(military::regiments_max_possible_from_province(state, prov_id));
649 continent_max_pop[cid] = std::max(continent_max_pop[cid], total_regs);
650 auto i = province::to_map_id(prov_id);
651 prov_population[i] = total_regs;
652 }
653 });
654 uint32_t province_size = state.world.province_size() + 1;
655 uint32_t texture_size = province_size + 256 - province_size % 256;
656 std::vector<uint32_t> prov_color(texture_size * 2);
657 state.world.for_each_province([&](dcon::province_id prov_id) {
658 auto nation = state.world.province_get_nation_from_province_ownership(prov_id);
659 if((sel_nation && nation == sel_nation) || !sel_nation) {
660 auto fat_id = dcon::fatten(state.world, prov_id);
661 auto cid = fat_id.get_continent().id.index();
662 auto i = province::to_map_id(prov_id);
663 if(prov_population[i] == 0.f) {
664 auto color = sys::pack_color(0, 0, 0);
665 prov_color[i] = color;
666 prov_color[i + texture_size] = color;
667 } else {
668 float gradient_index = 1.f - (prov_population[i] / continent_max_pop[cid]);
669 auto color = ogl::color_gradient(gradient_index, 210, 100 << 8);
670 prov_color[i] = color;
671 prov_color[i + texture_size] = color;
672 }
673 }
674 });
675 return prov_color;
676}
677std::vector<uint32_t> workforce_map_from(sys::state& state) {
678 uint32_t province_size = state.world.province_size() + 1;
679 uint32_t texture_size = province_size + 256 - province_size % 256;
680 std::vector<uint32_t> prov_color(texture_size * 2);
681 if(state.map_state.get_selected_province()) {
682 dcon::pop_type_fat_id fat_id = dcon::fatten(state.world, dcon::pop_type_id{});
683 float pt_max = 0.f;
684 for(const auto pt : state.world.in_pop_type) {
685 auto total = state.world.province_get_demographics(state.map_state.get_selected_province(), demographics::to_key(state, pt));
686 if(total > pt_max) {
687 fat_id = pt;
688 total = pt_max;
689 }
690 }
691 if(bool(fat_id)) {
692 uint32_t full_color = fat_id.get_color();
693 uint32_t empty_color = 0xDDDDDD;
694 // Make the other end of the gradient dark if the color is bright and vice versa.
695 if((full_color & 0xFF) + (full_color >> 8 & 0xFF) + (full_color >> 16 & 0xFF) > 140 * 3) {
696 empty_color = 0x222222;
697 }
698 state.world.for_each_province([&](dcon::province_id prov_id) {
699 auto i = province::to_map_id(prov_id);
700 float total = state.world.province_get_demographics(state.map_state.get_selected_province(), demographics::total);
701 float value = state.world.province_get_demographics(state.map_state.get_selected_province(), demographics::to_key(state, fat_id));
702 auto ratio = value / total;
703 auto color = ogl::color_gradient(ratio, full_color, empty_color);
704 prov_color[i] = color;
705 prov_color[i + texture_size] = color;
706 });
707 }
708 } else {
709 state.world.for_each_province([&](dcon::province_id prov_id) {
710 auto id = province::to_map_id(prov_id);
711 float total_pops = state.world.province_get_demographics(prov_id, demographics::total);
712 dcon::pop_type_id primary_id;
713 dcon::pop_type_id secondary_id;
714 float primary_percent = 0.f;
715 float secondary_percent = 0.f;
716 state.world.for_each_pop_type([&](dcon::pop_type_id id) {
717 float volume = 0.f;
718 for(const auto pl : state.world.province_get_pop_location_as_province(prov_id)) {
719 if(pl.get_pop().get_poptype() == id) {
720 volume += pl.get_pop().get_size();
721 }
722 }
723 float percent = volume / total_pops;
724 if(percent > primary_percent) {
725 secondary_id = primary_id;
726 secondary_percent = primary_percent;
727 primary_id = id;
728 primary_percent = percent;
729 } else if(percent > secondary_percent) {
730 secondary_id = id;
731 secondary_percent = percent;
732 }
733 });
734 uint32_t primary_color = dcon::fatten(state.world, primary_id).get_color();
735 uint32_t secondary_color = 0xFFAAAAAA; // This color won't be reached
736 if(bool(secondary_id)) {
737 secondary_color = dcon::fatten(state.world, secondary_id).get_color();
738 }
739 if(secondary_percent >= primary_percent * 0.75f) {
740 prov_color[id] = primary_color;
741 prov_color[id + texture_size] = secondary_color;
742 } else {
743 prov_color[id] = primary_color;
744 prov_color[id + texture_size] = primary_color;
745 }
746 });
747 }
748 return prov_color;
749}
750std::vector<uint32_t> players_map_from(sys::state& state) {
751 uint32_t province_size = state.world.province_size() + 1;
752 uint32_t texture_size = province_size + 256 - province_size % 256;
753 std::vector<uint32_t> prov_color(texture_size * 2);
754 for(const auto n : state.world.in_nation) {
755 if(n.get_is_player_controlled()) {
756 for(const auto po : state.world.nation_get_province_ownership_as_nation(n)) {
757 auto id = province::to_map_id(po.get_province());
758 prov_color[id] = n.get_color();
759 }
760 for(const auto po : state.world.nation_get_province_control_as_nation(n)) {
761 auto id = province::to_map_id(po.get_province());
762 prov_color[id + texture_size] = n.get_color();
763 }
764 }
765 }
766 return prov_color;
767}
768
769#include "gui_element_types.hpp"
770
771std::vector<uint32_t> select_states_map_from(sys::state& state) {
772 uint32_t province_size = state.world.province_size();
773 uint32_t texture_size = province_size + 256 - province_size % 256;
774 std::vector<uint32_t> prov_color(texture_size * 2, 0);
775
776 assert(state.state_selection.has_value());
777 if(state.state_selection) {
778 for(const auto s : state.state_selection->selectable_states) {
779 uint32_t color = ogl::color_from_hash(s.index());
780
781 for(const auto m : state.world.state_definition_get_abstract_state_membership_as_state(s)) {
782 auto p = m.get_province();
783
784 auto i = province::to_map_id(p.id);
785
786 prov_color[i] = color;
787 prov_color[i + texture_size] = ~color;
788 }
789 }
790 }
791 return prov_color;
792}
793
794namespace map_mode {
795
797 std::vector<uint32_t> prov_color;
798 switch(mode) {
806 //New mapmodes
820 if(state.ui_state.map_gradient_legend)
821 state.ui_state.map_gradient_legend->set_visible(state, true);
822 break;
823 default:
824 if(state.ui_state.map_gradient_legend)
825 state.ui_state.map_gradient_legend->set_visible(state, false);
826 break;
827 }
829 if(state.ui_state.map_civ_level_legend)
830 state.ui_state.map_civ_level_legend->set_visible(state, true);
831 } else {
832 if(state.ui_state.map_civ_level_legend)
833 state.ui_state.map_civ_level_legend->set_visible(state, false);
834 }
835 if(mode == mode::colonial) {
836 if(state.ui_state.map_col_legend)
837 state.ui_state.map_col_legend->set_visible(state, true);
838 } else {
839 if(state.ui_state.map_col_legend)
840 state.ui_state.map_col_legend->set_visible(state, false);
841 }
842 if(mode == mode::diplomatic) {
843 if(state.ui_state.map_dip_legend)
844 state.ui_state.map_dip_legend->set_visible(state, true);
845 } else {
846 if(state.ui_state.map_dip_legend)
847 state.ui_state.map_dip_legend->set_visible(state, false);
848 }
850 if(state.ui_state.map_rr_legend)
851 state.ui_state.map_rr_legend->set_visible(state, true);
852 } else {
853 if(state.ui_state.map_rr_legend)
854 state.ui_state.map_rr_legend->set_visible(state, false);
855 }
856 if(mode == mode::naval) {
857 if(state.ui_state.map_nav_legend)
858 state.ui_state.map_nav_legend->set_visible(state, true);
859 } else {
860 if(state.ui_state.map_nav_legend)
861 state.ui_state.map_nav_legend->set_visible(state, false);
862 }
863 if(mode == mode::rank) {
864 if(state.ui_state.map_rank_legend)
865 state.ui_state.map_rank_legend->set_visible(state, true);
866 } else {
867 if(state.ui_state.map_rank_legend)
868 state.ui_state.map_rank_legend->set_visible(state, false);
869 }
870 if(mode == mode::recruitment) {
871 if(state.ui_state.map_rec_legend)
872 state.ui_state.map_rec_legend->set_visible(state, true);
873 } else {
874 if(state.ui_state.map_rec_legend)
875 state.ui_state.map_rec_legend->set_visible(state, false);
876 }
877
878 switch(mode) {
880 prov_color = select_states_map_from(state);
881 break;
882 case mode::terrain:
883 state.map_state.set_terrain_map_mode();
884 return;
885 case mode::political:
886 prov_color = political_map_from(state);
887 break;
888 case mode::region:
889 prov_color = region_map_from(state);
890 break;
891 case mode::population:
892 prov_color = population_map_from(state);
893 break;
895 prov_color = nationality_map_from(state);
896 break;
897 case mode::sphere:
898 prov_color = sphere_map_from(state);
899 break;
900 case mode::diplomatic:
901 prov_color = diplomatic_map_from(state);
902 break;
903 case mode::rank:
904 prov_color = rank_map_from(state);
905 break;
907 prov_color = recruitment_map_from(state);
908 break;
909 case mode::supply:
910 prov_color = supply_map_from(state);
911 break;
912 case mode::relation:
913 prov_color = relation_map_from(state);
914 break;
916 prov_color = civilization_level_map_from(state);
917 break;
918 case mode::migration:
919 prov_color = migration_map_from(state);
920 break;
922 prov_color = infrastructure_map_from(state);
923 break;
924 case mode::revolt:
925 prov_color = revolt_map_from(state);
926 break;
928 prov_color = party_loyalty_map_from(state);
929 break;
930 case mode::admin:
931 prov_color = admin_map_from(state);
932 break;
933 case mode::naval:
934 prov_color = naval_map_from(state);
935 break;
937 prov_color = national_focus_map_from(state);
938 break;
939 case mode::crisis:
940 prov_color = crisis_map_from(state);
941 break;
942 case mode::colonial:
943 prov_color = colonial_map_from(state);
944 break;
945 case mode::rgo_output:
946 prov_color = rgo_output_map_from(state);
947 break;
948 case mode::religion:
949 prov_color = religion_map_from(state);
950 break;
951 case mode::issues:
952 prov_color = issue_map_from(state);
953 break;
954 case mode::ideology:
955 prov_color = ideology_map_from(state);
956 break;
957 case mode::fort:
958 prov_color = fort_map_from(state);
959 break;
960 case mode::income:
961 prov_color = income_map_from(state);
962 break;
964 prov_color = con_map_from(state);
965 break;
966 case mode::militancy:
967 prov_color = militancy_map_from(state);
968 break;
969 case mode::literacy:
970 prov_color = literacy_map_from(state);
971 break;
972 case mode::employment:
973 prov_color = employment_map_from(state);
974 break;
975 case mode::factories:
976 prov_color = factory_map_from(state);
977 break;
978 case mode::growth:
979 prov_color = growth_map_from(state);
980 break;
981 //even newer mapmodes
982 case mode::players:
983 prov_color = players_map_from(state);
984 break;
985 case mode::life_needs:
986 prov_color = life_needs_map_from(state);
987 break;
989 prov_color = everyday_needs_map_from(state);
990 break;
992 prov_color = luxury_needs_map_from(state);
993 break;
995 prov_color = life_rating_map_from(state);
996 break;
998 prov_color = ctc_map_from(state);
999 break;
1000 case mode::crime:
1001 prov_color = crime_map_from(state);
1002 break;
1003 case mode::rally:
1004 prov_color = rally_map_from(state);
1005 break;
1006 case mode::officers:
1007 prov_color = officers_map_from(state);
1008 break;
1009 case mode::mobilization:
1010 prov_color = mobilization_map_from(state);
1011 break;
1012 case mode::workforce:
1013 prov_color = workforce_map_from(state);
1014 break;
1015 default:
1016 return;
1017 }
1018 state.map_state.set_province_color(prov_color, mode);
1019}
1020
1022 if(state.map_state.active_map_mode == mode::terrain || state.map_state.active_map_mode == mode::region) {
1023 return;
1024 }
1025 set_map_mode(state, state.map_state.active_map_mode);
1026}
1027} // namespace map_mode
std::vector< uint32_t > admin_map_from(sys::state &state)
Definition: admin.hpp:3
std::vector< uint32_t > civilization_level_map_from(sys::state &state)
std::vector< uint32_t > colonial_map_from(sys::state &state)
Definition: colonial.hpp:2
std::vector< uint32_t > crisis_map_from(sys::state &state)
Definition: crisis.hpp:2
#define assert(condition)
Definition: debug.h:74
std::vector< uint32_t > diplomatic_map_from(sys::state &state)
Definition: diplomatic.hpp:131
std::vector< uint32_t > infrastructure_map_from(sys::state &state)
std::vector< uint32_t > growth_map_from(sys::state &state)
Definition: map_modes.cpp:291
std::vector< uint32_t > issue_map_from(sys::state &state)
Definition: map_modes.cpp:104
std::vector< uint32_t > con_map_from(sys::state &state)
Definition: map_modes.cpp:249
std::vector< uint32_t > ctc_map_from(sys::state &state)
Definition: map_modes.cpp:583
std::vector< uint32_t > rally_map_from(sys::state &state)
Definition: map_modes.cpp:627
std::vector< uint32_t > ideology_map_from(sys::state &state)
Definition: map_modes.cpp:37
std::vector< uint32_t > life_needs_map_from(sys::state &state)
Definition: map_modes.cpp:418
std::vector< uint32_t > factory_map_from(sys::state &state)
Definition: map_modes.cpp:204
std::vector< uint32_t > crime_map_from(sys::state &state)
Definition: map_modes.cpp:607
std::vector< uint32_t > income_map_from(sys::state &state)
Definition: map_modes.cpp:337
std::vector< uint32_t > luxury_needs_map_from(sys::state &state)
Definition: map_modes.cpp:486
std::vector< uint32_t > select_states_map_from(sys::state &state)
Definition: map_modes.cpp:771
std::vector< uint32_t > life_rating_map_from(sys::state &state)
Definition: map_modes.cpp:520
std::vector< uint32_t > everyday_needs_map_from(sys::state &state)
Definition: map_modes.cpp:452
std::vector< uint32_t > employment_map_from(sys::state &state)
Definition: map_modes.cpp:371
std::vector< uint32_t > mobilization_map_from(sys::state &state)
Definition: map_modes.cpp:639
std::vector< uint32_t > fort_map_from(sys::state &state)
Definition: map_modes.cpp:171
std::vector< uint32_t > players_map_from(sys::state &state)
Definition: map_modes.cpp:750
std::vector< uint32_t > workforce_map_from(sys::state &state)
Definition: map_modes.cpp:677
std::vector< uint32_t > militancy_map_from(sys::state &state)
Definition: map_modes.cpp:392
std::vector< uint32_t > literacy_map_from(sys::state &state)
Definition: map_modes.cpp:271
std::vector< uint32_t > officers_map_from(sys::state &state)
Definition: map_modes.cpp:551
std::vector< uint32_t > migration_map_from(sys::state &state)
Definition: migration.hpp:3
pop_satisfaction_wrapper_fat fatten(data_container const &c, pop_satisfaction_wrapper_id id) noexcept
constexpr dcon::demographics_key total(0)
dcon::demographics_key to_key(sys::state const &state, dcon::pop_type_id v)
constexpr dcon::demographics_key employable(1)
constexpr dcon::demographics_key consciousness(3)
constexpr dcon::demographics_key employed(2)
float get_monthly_pop_increase(sys::state &state, dcon::pop_id ids)
constexpr dcon::demographics_key literacy(5)
int32_t state_factory_count(sys::state &state, dcon::state_instance_id sid, dcon::nation_id n)
Definition: economy.cpp:4911
void update_map_mode(sys::state &state)
Definition: map_modes.cpp:1021
void set_map_mode(sys::state &state, mode mode)
Definition: map_modes.cpp:796
int32_t regiments_max_possible_from_province(sys::state &state, dcon::province_id p)
Definition: military.cpp:709
uint32_t get_ui_color(sys::state &state, T id)
Definition: color.hpp:52
constexpr uint32_t color_from_hash(uint32_t color)
Definition: color.hpp:9
uint32_t color_gradient(float percent, uint32_t top_color, uint32_t bot_color)
Definition: color.hpp:42
float get_luxury_needs(sys::state const &state, dcon::pop_id p)
dcon::pop_demographics_key to_key(sys::state const &state, dcon::ideology_id v)
float get_life_needs(sys::state const &state, dcon::pop_id p)
float get_everyday_needs(sys::state const &state, dcon::pop_id p)
float get_demo(sys::state const &state, dcon::pop_id p, dcon::pop_demographics_key k)
bool can_build_fort(sys::state &state, dcon::province_id id, dcon::nation_id n)
Definition: province.cpp:370
bool has_fort_being_built(sys::state &state, dcon::province_id id)
Definition: province.cpp:363
float revolt_risk(sys::state &state, dcon::province_id id)
Definition: province.cpp:561
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)
std::vector< uint32_t > nationality_map_from(sys::state &state)
Definition: nationality.hpp:88
std::vector< uint32_t > naval_map_from(sys::state &state)
Definition: naval.hpp:5
uint uint32_t
uchar uint8_t
std::vector< uint32_t > party_loyalty_map_from(sys::state &state)
std::vector< uint32_t > political_map_from(sys::state &state)
Definition: political.hpp:13
std::vector< uint32_t > population_map_from(sys::state &state)
Definition: population.hpp:74
std::vector< uint32_t > rank_map_from(sys::state &state)
Definition: rank.hpp:3
std::vector< uint32_t > recruitment_map_from(sys::state &state)
Definition: recruitment.hpp:3
std::vector< uint32_t > region_map_from(sys::state &state)
Definition: region.hpp:3
std::vector< uint32_t > relation_map_from(sys::state &state)
Definition: relation.hpp:3
std::vector< uint32_t > religion_map_from(sys::state &state)
Definition: religion.hpp:84
std::vector< uint32_t > revolt_map_from(sys::state &state)
Definition: revolt.hpp:4
std::vector< uint32_t > rgo_output_map_from(sys::state &state)
Definition: rgo_output.hpp:2
std::vector< uint32_t > sphere_map_from(sys::state &state)
Definition: sphere.hpp:166
std::vector< uint32_t > supply_map_from(sys::state &state)
Definition: supply.hpp:3