aboutsummaryrefslogtreecommitdiff
path: root/extension/src/LoadGameOpenVic.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-08-17 20:25:25 +0200
committer GitHub <noreply@github.com>2023-08-17 20:25:25 +0200
commitaa9961b27a4859f088b037dd8037accb4e3119be (patch)
treee93af9cabfbefc6ea089a153399e04d74e4b605a /extension/src/LoadGameOpenVic.cpp
parentff0d38b5d53fa95609f2587a2be5205f0c0d3118 (diff)
parent9a086523513994b0183d5f7d479b2f82412177f6 (diff)
Merge pull request #146 from Nemrav/piechart2
Add Piecharts (gd 4.1)
Diffstat (limited to 'extension/src/LoadGameOpenVic.cpp')
-rw-r--r--extension/src/LoadGameOpenVic.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/extension/src/LoadGameOpenVic.cpp b/extension/src/LoadGameOpenVic.cpp
index 27fb265..627578f 100644
--- a/extension/src/LoadGameOpenVic.cpp
+++ b/extension/src/LoadGameOpenVic.cpp
@@ -157,7 +157,11 @@ Error GameSingleton::_parse_region_entry(String const& identifier, Variant const
UtilityFunctions::push_error("Invalid province list for region \"", identifier, "\": ", entry);
return FAILED;
}
- return ERR(game_manager.map.add_region(godot_to_std_string(identifier), province_identifiers));
+ std::vector<std::string_view> province_identifier_views;
+ for (std::string const& str : province_identifiers) {
+ province_identifier_views.push_back(str);
+ }
+ return ERR(game_manager.map.add_region(godot_to_std_string(identifier), province_identifier_views));
}
Error GameSingleton::_load_region_file(String const& file_path) {
@@ -271,7 +275,7 @@ Error GameSingleton::_load_map_images(String const& province_image_path, String
// Generate interleaved province and terrain ID image
if (game_manager.map.generate_province_shape_image(province_dims.x, province_dims.y, province_image->get_data().ptr(),
- terrain_image->get_data().ptr(), terrain_variant_map) != SUCCESS) err = FAILED;
+ terrain_image->get_data().ptr(), terrain_variant_map, true) != SUCCESS) err = FAILED;
static constexpr int32_t GPU_DIM_LIMIT = 0x3FFF;
// For each dimension of the image, this finds the small number of equal subdivisions required get the individual texture dims under GPU_DIM_LIMIT
@@ -364,8 +368,8 @@ Error GameSingleton::_parse_good_entry(String const& identifier, Variant const&
if (var_overseas_maintenance.get_type() == Variant::BOOL) overseas_maintenance = var_overseas_maintenance;
else UtilityFunctions::push_error("Invalid good overseas maintenance bool value for ", identifier, ": ", var_overseas_maintenance);
- return ERR(game_manager.good_manager.add_good(godot_to_std_string(identifier), godot_to_std_string(category),
- colour, base_price, default_available, tradeable, currency, overseas_maintenance));
+ return ERR(game_manager.good_manager.add_good(godot_to_std_string(identifier), colour, godot_to_std_string(category),
+ base_price, default_available, tradeable, currency, overseas_maintenance));
}
Error GameSingleton::_load_goods(String const& defines_path, String const& icons_dir_path) {