aboutsummaryrefslogtreecommitdiff
path: root/extension/src/LoadGameOpenVic.cpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-08-12 18:56:14 +0200
committer Hop311 <hop3114@gmail.com>2023-08-12 18:56:14 +0200
commitfe74604d96d1d28b811ebe45d1d06356cf79bc6f (patch)
treef57c608c657681666c29e28bf1283833767cb7ea /extension/src/LoadGameOpenVic.cpp
parent4c43951e70aaa2e7265d3b3f3c4964c048b9328d (diff)
string_view changes + general cleanup
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) {