diff options
Diffstat (limited to 'src/openvic-simulation/map')
-rw-r--r-- | src/openvic-simulation/map/Map.cpp | 8 | ||||
-rw-r--r-- | src/openvic-simulation/map/Province.cpp | 4 | ||||
-rw-r--r-- | src/openvic-simulation/map/Province.hpp | 3 | ||||
-rw-r--r-- | src/openvic-simulation/map/TerrainType.cpp | 7 |
4 files changed, 12 insertions, 10 deletions
diff --git a/src/openvic-simulation/map/Map.cpp b/src/openvic-simulation/map/Map.cpp index acd882e..777579e 100644 --- a/src/openvic-simulation/map/Map.cpp +++ b/src/openvic-simulation/map/Map.cpp @@ -525,16 +525,16 @@ bool Map::load_map_images(fs::path const& province_path, fs::path const& terrain for (size_t idx = 0; idx < province_checklist.size(); ++idx) { Province* province = provinces.get_item_by_index(idx); province->_set_terrain_type(reinterpret_cast<TerrainType const*>(get_largest_item(terrain_type_pixels_list[idx]).first)); - if (!province_checklist[idx]) { + province->on_map = province_checklist[idx]; + if (!province->on_map) { if (detailed_errors) { - Logger::error("Province missing from shape image: ", province->to_string()); + Logger::warning("Province missing from shape image: ", province->to_string()); } missing++; } } if (missing > 0) { - Logger::error("Province image is missing ", missing, " province colours"); - ret = false; + Logger::warning("Province image is missing ", missing, " province colours"); } return ret; diff --git a/src/openvic-simulation/map/Province.cpp b/src/openvic-simulation/map/Province.cpp index 5b1a130..45b3987 100644 --- a/src/openvic-simulation/map/Province.cpp +++ b/src/openvic-simulation/map/Province.cpp @@ -17,6 +17,10 @@ Region* Province::get_region() const { return region; } +bool Province::get_on_map() const { + return on_map; +} + bool Province::get_has_region() const { return has_region; } diff --git a/src/openvic-simulation/map/Province.hpp b/src/openvic-simulation/map/Province.hpp index d925898..2704354 100644 --- a/src/openvic-simulation/map/Province.hpp +++ b/src/openvic-simulation/map/Province.hpp @@ -61,7 +61,7 @@ namespace OpenVic { private: const index_t index; Region* region = nullptr; - bool has_region = false, water = false; + bool on_map = false, has_region = false, water = false; life_rating_t life_rating = 0; IdentifierRegistry<BuildingInstance> buildings; // TODO - change this into a factory-like structure @@ -85,6 +85,7 @@ namespace OpenVic { index_t get_index() const; Region* get_region() const; + bool get_on_map() const; bool get_has_region() const; bool get_water() const; TerrainType const* get_terrain_type() const; diff --git a/src/openvic-simulation/map/TerrainType.cpp b/src/openvic-simulation/map/TerrainType.cpp index ce0b7e7..017b220 100644 --- a/src/openvic-simulation/map/TerrainType.cpp +++ b/src/openvic-simulation/map/TerrainType.cpp @@ -125,11 +125,8 @@ bool TerrainTypeManager::_load_terrain_type_mapping(std::string_view mapping_key "priority", ZERO_OR_ONE, expect_uint(assign_variable_callback(priority)), "has_texture", ZERO_OR_ONE, expect_bool(assign_variable_callback(has_texture)) )(mapping_value); - if (has_texture) { - if (++terrain_texture_count == terrain_texture_limit + 1) { - Logger::error("More terrain textures than limit!"); - ret = false; - } + if (has_texture && ++terrain_texture_count == terrain_texture_limit + 1) { + Logger::warning("More terrain textures than limit!"); } ret &= add_terrain_type_mapping(mapping_key, type, std::move(terrain_indicies), priority, has_texture); return true; |