diff options
author | Hop311 <Hop3114@gmail.com> | 2023-09-29 01:19:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-29 01:19:49 +0200 |
commit | 57822949341b86649614b343afa2c740efe00ac2 (patch) | |
tree | 462d3f1dc55840790940a186390a93f9882750b4 /extension/src/openvic-extension/GameSingleton.hpp | |
parent | fadabd3e19605a7f30ee7e3dd1453f21384dd662 (diff) | |
parent | 86dd609511b643a6556c42622ec891c092366c66 (diff) |
Merge pull request #160 from OpenVicProject/terrain-types
Terrain types
Diffstat (limited to 'extension/src/openvic-extension/GameSingleton.hpp')
-rw-r--r-- | extension/src/openvic-extension/GameSingleton.hpp | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/extension/src/openvic-extension/GameSingleton.hpp b/extension/src/openvic-extension/GameSingleton.hpp index 4d9e912..56c9e88 100644 --- a/extension/src/openvic-extension/GameSingleton.hpp +++ b/extension/src/openvic-extension/GameSingleton.hpp @@ -8,23 +8,6 @@ namespace OpenVic { - struct TerrainVariant : HasIdentifierAndColour { - friend class GameSingleton; - - private: - const godot::Ref<godot::Image> image; - - TerrainVariant(const std::string_view new_identfier, colour_t new_colour, - godot::Ref<godot::Image> const& new_image); - - public: - static constexpr size_t MAX_TERRIN_VARIANT_COUNT = 1 << (8 * sizeof(Map::terrain_t)); - - TerrainVariant(TerrainVariant&&) = default; - - godot::Ref<godot::Image> get_image() const; - }; - class GameSingleton : public godot::Object { GDCLASS(GameSingleton, godot::Object) @@ -38,14 +21,12 @@ namespace OpenVic { godot::Ref<godot::Image> province_colour_image; godot::Ref<godot::ImageTexture> province_colour_texture; Mapmode::index_t mapmode_index = 0; - IdentifierRegistry<TerrainVariant> terrain_variants; - Map::terrain_variant_map_t terrain_variant_map; godot::Ref<godot::Texture2DArray> terrain_texture; 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_map_images(bool flip_vertical = false); - godot::Error _load_terrain_variants_compatibility_mode(godot::String const& terrain_image_path, godot::String const& terrain_texturesheet_path); + godot::Error _load_terrain_variants_compatibility_mode(godot::String const& terrain_texturesheet_path); /* Generate the province_colour_texture from the current mapmode. */ @@ -63,6 +44,7 @@ namespace OpenVic { godot::Vector2 shadow_displacement, float shadow_tightness, float shadow_radius, float shadow_thickness, godot::Color trim_colour, float trim_size, float gradient_falloff, float gradient_base, bool donut, bool donut_inner_trim, float donut_inner_radius); + static godot::Ref<godot::Image> load_image(godot::String const& path); static GameSingleton* get_singleton(); @@ -88,6 +70,7 @@ namespace OpenVic { static godot::StringName const& get_province_info_province_key(); static godot::StringName const& get_province_info_region_key(); static godot::StringName const& get_province_info_life_rating_key(); + static godot::StringName const& get_province_info_terrain_type_key(); static godot::StringName const& get_province_info_total_population_key(); static godot::StringName const& get_province_info_pop_types_key(); static godot::StringName const& get_province_info_pop_ideologies_key(); |