aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader/Dataloader.cpp
diff options
context:
space:
mode:
author zaaarf <80046572+zaaarf@users.noreply.github.com>2023-12-27 23:59:44 +0100
committer GitHub <noreply@github.com>2023-12-27 23:59:44 +0100
commitc994cf687ee90879275f917248c0c7c2b25275e2 (patch)
tree69ac3c177a57f6091bb07e0d774151a5677dd1cb /src/openvic-simulation/dataloader/Dataloader.cpp
parent0d9343e62575b5b7968beea2d36f15541e2351e2 (diff)
parent3bf0ce9bfaad1e40ffeeed3d66ca2e628fea8e29 (diff)
Merge pull request #108 from OpenVicProject/dataloading-map-climate-continent
Dataloading climate and continents
Diffstat (limited to 'src/openvic-simulation/dataloader/Dataloader.cpp')
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp
index fc4e64c..cc09c1a 100644
--- a/src/openvic-simulation/dataloader/Dataloader.cpp
+++ b/src/openvic-simulation/dataloader/Dataloader.cpp
@@ -603,8 +603,7 @@ bool Dataloader::_load_map_dir(GameManager& game_manager) const {
static constexpr std::string_view default_region = "region.txt";
static constexpr std::string_view default_region_sea = "region_sea.txt"; // TODO
static constexpr std::string_view default_province_flag_sprite = "province_flag_sprites"; // TODO
-
- static constexpr std::string_view climate_filename = "climate.txt"; // TODO
+ static constexpr std::string_view climate_file = "climate.txt"; // TODO
/* Parser stored so the filename string_views persist until the end of this function. */
const v2script::Parser parser = parse_defines(lookup_file(append_string_views(map_directory, defaults_filename)));
@@ -702,6 +701,22 @@ bool Dataloader::_load_map_dir(GameManager& game_manager) const {
ret = false;
}
+ if (!map.load_climate_file(
+ game_manager.get_modifier_manager(),
+ parse_defines(lookup_file(append_string_views(map_directory, climate_file))).get_file_node()
+ )) {
+ Logger::error("Failed to load climates!");
+ ret = false;
+ }
+
+ if (!map.load_continent_file(
+ game_manager.get_modifier_manager(),
+ parse_defines(lookup_file(append_string_views(map_directory, continent))).get_file_node()
+ )) {
+ Logger::error("Failed to load continents!");
+ ret = false;
+ }
+
return ret;
}