aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/dataloader
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/dataloader')
-rw-r--r--src/openvic-simulation/dataloader/Dataloader.cpp1
-rw-r--r--src/openvic-simulation/dataloader/NodeTools.hpp7
2 files changed, 8 insertions, 0 deletions
diff --git a/src/openvic-simulation/dataloader/Dataloader.cpp b/src/openvic-simulation/dataloader/Dataloader.cpp
index 2058ce5..77d0baa 100644
--- a/src/openvic-simulation/dataloader/Dataloader.cpp
+++ b/src/openvic-simulation/dataloader/Dataloader.cpp
@@ -1007,6 +1007,7 @@ bool Dataloader::load_defines(DefinitionManager& definition_manager) {
ret = false;
}
if (!definition_manager.get_history_manager().get_bookmark_manager().load_bookmark_file(
+ definition_manager.get_map_definition().get_height(),
parse_defines(lookup_file(bookmark_file)).get_file_node()
)) {
Logger::error("Failed to load bookmarks!");
diff --git a/src/openvic-simulation/dataloader/NodeTools.hpp b/src/openvic-simulation/dataloader/NodeTools.hpp
index 18faffb..7694e3b 100644
--- a/src/openvic-simulation/dataloader/NodeTools.hpp
+++ b/src/openvic-simulation/dataloader/NodeTools.hpp
@@ -590,6 +590,13 @@ namespace OpenVic {
return callback(val);
};
}
+
+ template<typename T>
+ constexpr Callback<T> auto flip_height_callback(Callback<T> auto&& callback, T height) {
+ return [callback, height](T val) -> bool {
+ return callback(height - val);
+ };
+ }
}
}