aboutsummaryrefslogtreecommitdiff
path: root/extension/src/GameSingleton.hpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-05-22 19:06:25 +0200
committer Hop311 <hop3114@gmail.com>2023-05-22 19:06:25 +0200
commit42b4b45d7d1216770077e0676cd66750cae26932 (patch)
tree04c25f263a2364eab5bc3647b9e1a4ccc9fc3bf2 /extension/src/GameSingleton.hpp
parentbd9b0206bcfc8848c865055a933d1e207521ac8e (diff)
Map compatibility mode
Diffstat (limited to 'extension/src/GameSingleton.hpp')
-rw-r--r--extension/src/GameSingleton.hpp23
1 files changed, 17 insertions, 6 deletions
diff --git a/extension/src/GameSingleton.hpp b/extension/src/GameSingleton.hpp
index 4c809af..6bfb741 100644
--- a/extension/src/GameSingleton.hpp
+++ b/extension/src/GameSingleton.hpp
@@ -11,6 +11,8 @@ namespace OpenVic {
const godot::Ref<godot::Image> image;
public:
+ static constexpr size_t MAX_INDEX = 1 << (8 * sizeof(Map::terrain_t));
+
TerrainVariant(std::string const& new_identfier, colour_t new_colour,
godot::Ref<godot::Image> const& new_image)
: HasIdentifier { new_identfier },
@@ -42,12 +44,16 @@ namespace OpenVic {
godot::Error _parse_terrain_entry(godot::String const& identifier, godot::Variant const& entry, godot::String const& terrain_texture_dir_path);
godot::Error _parse_good_entry(godot::String const& identifier, godot::Variant const& entry);
- godot::Error load_province_identifier_file(godot::String const& file_path);
- godot::Error load_water_province_file(godot::String const& file_path);
- godot::Error load_region_file(godot::String const& file_path);
- godot::Error load_terrain_variants(godot::String const& terrain_identifiers_path, godot::String const& terrain_texture_dir_path);
- godot::Error load_map_images(godot::String const& province_image_path, godot::String const& terrain_image_path);
- godot::Error load_goods(godot::String const& defines_path, godot::String const& icons_dir_path);
+ godot::Error _load_province_identifier_file(godot::String const& file_path);
+ godot::Error _load_water_province_file(godot::String const& file_path);
+ godot::Error _load_region_file(godot::String const& file_path);
+ godot::Error _load_terrain_variants(godot::String const& terrain_identifiers_path, godot::String const& terrain_texture_dir_path);
+ godot::Error _generate_terrain_texture_array();
+ godot::Error _load_map_images(godot::String const& province_image_path, godot::String const& terrain_image_path, bool flip_vertical = false);
+ godot::Error _load_goods(godot::String const& defines_path, godot::String const& icons_dir_path);
+
+ godot::Error _load_province_identifier_file_compatibility_mode(godot::String const& file_path);
+ godot::Error _load_terrain_variants_compatibility_mode(godot::String const& terrain_image_path, godot::String const& terrain_texturesheet_path);
/* Hardcoded data for defining things for which parsing from files has
* not been implemented, currently mapmodes and building types.
@@ -83,6 +89,11 @@ namespace OpenVic {
*/
godot::Error load_defines(godot::Dictionary const& file_dict);
+ /* Load the game's defines in compatiblity mode from the filepath
+ * pointing to the defines folder.
+ */
+ godot::Error load_defines_compatibility_mode(godot::String const& file_path);
+
/* Post-load/restart game setup - reset the game to post-load state
* and (re)generate starting data, e.g. buildings.
*/