aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader
diff options
context:
space:
mode:
author zaaarf <me@zaaarf.foo>2023-12-27 23:56:28 +0100
committer zaaarf <me@zaaarf.foo>2023-12-27 23:56:28 +0100
commit3bf0ce9bfaad1e40ffeeed3d66ca2e628fea8e29 (patch)
tree69ac3c177a57f6091bb07e0d774151a5677dd1cb /src/openvic-simulation/dataloader
parent0d9343e62575b5b7968beea2d36f15541e2351e2 (diff)
feat: loading climate.txt and continent.txt
Diffstat (limited to 'src/openvic-simulation/dataloader')
-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;
}