aboutsummaryrefslogtreecommitdiff
path: root/extension/src
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src')
-rw-r--r--extension/src/openvic-extension/Checksum.hpp (renamed from extension/src/Checksum.hpp)0
-rw-r--r--extension/src/openvic-extension/GameSingleton.cpp (renamed from extension/src/GameSingleton.cpp)7
-rw-r--r--extension/src/openvic-extension/GameSingleton.hpp (renamed from extension/src/GameSingleton.hpp)4
-rw-r--r--extension/src/openvic-extension/LoadGameCompatibility.cpp (renamed from extension/src/LoadGameCompatibility.cpp)12
-rw-r--r--extension/src/openvic-extension/LoadGameOpenVic.cpp (renamed from extension/src/LoadGameOpenVic.cpp)8
-rw-r--r--extension/src/openvic-extension/LoadLocalisation.cpp (renamed from extension/src/LoadLocalisation.cpp)0
-rw-r--r--extension/src/openvic-extension/LoadLocalisation.hpp (renamed from extension/src/LoadLocalisation.hpp)0
-rw-r--r--extension/src/openvic-extension/MapMesh.cpp (renamed from extension/src/MapMesh.cpp)0
-rw-r--r--extension/src/openvic-extension/MapMesh.hpp (renamed from extension/src/MapMesh.hpp)0
-rw-r--r--extension/src/openvic-extension/Utilities.cpp (renamed from extension/src/Utilities.cpp)0
-rw-r--r--extension/src/openvic-extension/Utilities.hpp (renamed from extension/src/Utilities.hpp)2
-rw-r--r--extension/src/openvic-extension/register_types.cpp (renamed from extension/src/register_types.cpp)10
-rw-r--r--extension/src/openvic-extension/register_types.hpp (renamed from extension/src/register_types.h)0
13 files changed, 23 insertions, 20 deletions
diff --git a/extension/src/Checksum.hpp b/extension/src/openvic-extension/Checksum.hpp
index b12a9cd..b12a9cd 100644
--- a/extension/src/Checksum.hpp
+++ b/extension/src/openvic-extension/Checksum.hpp
diff --git a/extension/src/GameSingleton.cpp b/extension/src/openvic-extension/GameSingleton.cpp
index b435f05..a164b23 100644
--- a/extension/src/GameSingleton.cpp
+++ b/extension/src/openvic-extension/GameSingleton.cpp
@@ -2,9 +2,9 @@
#include <godot_cpp/variant/utility_functions.hpp>
-#include "openvic-simulation/utility/Logger.hpp"
+#include <openvic-simulation/utility/Logger.hpp>
-#include "Utilities.hpp"
+#include "openvic-extension/Utilities.hpp"
using namespace godot;
using namespace OpenVic;
@@ -105,7 +105,7 @@ void GameSingleton::_on_state_updated() {
}
/* REQUIREMENTS:
- * MAP-21, MAP-23, MAP-25, MAP-32, MAP-33
+ * MAP-21, MAP-23, MAP-25, MAP-32, MAP-33, MAP-34
*/
GameSingleton::GameSingleton() : game_manager { [this]() { _on_state_updated(); } },
terrain_variants { "terrain variants" } {
@@ -115,6 +115,7 @@ GameSingleton::GameSingleton() : game_manager { [this]() { _on_state_updated();
void GameSingleton::setup_logger() {
Logger::set_info_func([](std::string&& str) { UtilityFunctions::print(std_to_godot_string(str)); });
+ Logger::set_warning_func([](std::string&& str) { UtilityFunctions::push_warning(std_to_godot_string(str)); });
Logger::set_error_func([](std::string&& str) { UtilityFunctions::push_error(std_to_godot_string(str)); });
}
diff --git a/extension/src/GameSingleton.hpp b/extension/src/openvic-extension/GameSingleton.hpp
index ac9d160..bd6b73c 100644
--- a/extension/src/GameSingleton.hpp
+++ b/extension/src/openvic-extension/GameSingleton.hpp
@@ -3,8 +3,8 @@
#include <godot_cpp/classes/image_texture.hpp>
#include <godot_cpp/classes/texture2d_array.hpp>
-#include "openvic-simulation/GameManager.hpp"
-#include "openvic-simulation/dataloader/Dataloader.hpp"
+#include <openvic-simulation/GameManager.hpp>
+#include <openvic-simulation/dataloader/Dataloader.hpp>
namespace OpenVic {
diff --git a/extension/src/LoadGameCompatibility.cpp b/extension/src/openvic-extension/LoadGameCompatibility.cpp
index bed7442..e8e3314 100644
--- a/extension/src/LoadGameCompatibility.cpp
+++ b/extension/src/openvic-extension/LoadGameCompatibility.cpp
@@ -3,9 +3,9 @@
#include <godot_cpp/classes/file_access.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
-#include "openvic-simulation/utility/BMP.hpp"
+#include <openvic-simulation/utility/BMP.hpp>
-#include "Utilities.hpp"
+#include "openvic-extension/Utilities.hpp"
using namespace godot;
using namespace OpenVic;
@@ -62,11 +62,11 @@ Error GameSingleton::_load_terrain_variants_compatibility_mode(String const& ter
}
Error GameSingleton::load_defines_compatibility_mode(PackedStringArray const& file_paths) {
- static const std::filesystem::path province_image_file = "map/provinces.bmp";
- static const std::filesystem::path terrain_image_file = "map/terrain.bmp";
- static const std::filesystem::path terrain_texture_file = "map/terrain/texturesheet.tga";
+ static const fs::path province_image_file = "map/provinces.bmp";
+ static const fs::path terrain_image_file = "map/terrain.bmp";
+ static const fs::path terrain_texture_file = "map/terrain/texturesheet.tga";
- std::vector<std::filesystem::path> roots;
+ Dataloader::path_vector_t roots;
for (String const& path : file_paths) {
roots.push_back(godot_to_std_string(path));
}
diff --git a/extension/src/LoadGameOpenVic.cpp b/extension/src/openvic-extension/LoadGameOpenVic.cpp
index fafc864..87c66da 100644
--- a/extension/src/LoadGameOpenVic.cpp
+++ b/extension/src/openvic-extension/LoadGameOpenVic.cpp
@@ -4,7 +4,7 @@
#include <godot_cpp/classes/json.hpp>
#include <godot_cpp/variant/utility_functions.hpp>
-#include "Utilities.hpp"
+#include "openvic-extension/Utilities.hpp"
using namespace godot;
using namespace OpenVic;
@@ -86,8 +86,10 @@ Error GameSingleton::_load_map_images(String const& province_image_path, String
if (err != OK) return err;
// 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, false)) err = FAILED;
+ 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,
+ false /* <-- whether to print detailed map errors or not (specific missing/unrecognised colours) */
+ )) 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
diff --git a/extension/src/LoadLocalisation.cpp b/extension/src/openvic-extension/LoadLocalisation.cpp
index dc7702c..dc7702c 100644
--- a/extension/src/LoadLocalisation.cpp
+++ b/extension/src/openvic-extension/LoadLocalisation.cpp
diff --git a/extension/src/LoadLocalisation.hpp b/extension/src/openvic-extension/LoadLocalisation.hpp
index 04ec5c7..04ec5c7 100644
--- a/extension/src/LoadLocalisation.hpp
+++ b/extension/src/openvic-extension/LoadLocalisation.hpp
diff --git a/extension/src/MapMesh.cpp b/extension/src/openvic-extension/MapMesh.cpp
index 269360a..269360a 100644
--- a/extension/src/MapMesh.cpp
+++ b/extension/src/openvic-extension/MapMesh.cpp
diff --git a/extension/src/MapMesh.hpp b/extension/src/openvic-extension/MapMesh.hpp
index 38b208c..38b208c 100644
--- a/extension/src/MapMesh.hpp
+++ b/extension/src/openvic-extension/MapMesh.hpp
diff --git a/extension/src/Utilities.cpp b/extension/src/openvic-extension/Utilities.cpp
index 4ca6855..4ca6855 100644
--- a/extension/src/Utilities.cpp
+++ b/extension/src/openvic-extension/Utilities.cpp
diff --git a/extension/src/Utilities.hpp b/extension/src/openvic-extension/Utilities.hpp
index afd65c0..32e7cb5 100644
--- a/extension/src/Utilities.hpp
+++ b/extension/src/openvic-extension/Utilities.hpp
@@ -2,7 +2,7 @@
#include <godot_cpp/classes/image.hpp>
-#include "openvic-simulation/types/Colour.hpp"
+#include <openvic-simulation/types/Colour.hpp>
#define ERR(x) ((x) ? OK : FAILED)
diff --git a/extension/src/register_types.cpp b/extension/src/openvic-extension/register_types.cpp
index 92c25a4..273bb85 100644
--- a/extension/src/register_types.cpp
+++ b/extension/src/openvic-extension/register_types.cpp
@@ -1,11 +1,11 @@
-#include "register_types.h"
+#include "register_types.hpp"
#include <godot_cpp/classes/engine.hpp>
-#include "Checksum.hpp"
-#include "GameSingleton.hpp"
-#include "LoadLocalisation.hpp"
-#include "MapMesh.hpp"
+#include "openvic-extension/Checksum.hpp"
+#include "openvic-extension/GameSingleton.hpp"
+#include "openvic-extension/LoadLocalisation.hpp"
+#include "openvic-extension/MapMesh.hpp"
using namespace godot;
using namespace OpenVic;
diff --git a/extension/src/register_types.h b/extension/src/openvic-extension/register_types.hpp
index dd24689..dd24689 100644
--- a/extension/src/register_types.h
+++ b/extension/src/openvic-extension/register_types.hpp