aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/GameSingleton.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'extension/src/openvic-extension/GameSingleton.hpp')
-rw-r--r--extension/src/openvic-extension/GameSingleton.hpp25
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();