diff options
author | Hop311 <Hop3114@gmail.com> | 2023-04-29 00:48:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-29 00:48:13 +0200 |
commit | 5195a460330af234391dfdc892847d74d0d29393 (patch) | |
tree | 588f505bd94991b3a6c7a95b18b02e712df36cc7 /extension/src/openvic2/map/Map.hpp | |
parent | 1b35c3a4434873b98f8e3aa7770f0edd37ec053c (diff) | |
parent | 05937359e8c53ee76dc3ce537dd70083a016f766 (diff) |
Merge branch 'main' into goods
Diffstat (limited to 'extension/src/openvic2/map/Map.hpp')
-rw-r--r-- | extension/src/openvic2/map/Map.hpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/extension/src/openvic2/map/Map.hpp b/extension/src/openvic2/map/Map.hpp index 9150772..a664d96 100644 --- a/extension/src/openvic2/map/Map.hpp +++ b/extension/src/openvic2/map/Map.hpp @@ -26,6 +26,12 @@ namespace OpenVic2 { * MAP-4 */ struct Map { + #pragma pack(push, 1) + struct shape_pixel_t { + Province::index_t index; + uint8_t terrain; + }; + #pragma pack(pop) private: IdentifierRegistry<Province> provinces; IdentifierRegistry<Region> regions; @@ -34,7 +40,7 @@ namespace OpenVic2 { size_t water_province_count = 0; size_t width = 0, height = 0; - std::vector<index_t> province_index_image; + std::vector<shape_pixel_t> province_shape_image; public: Map(); @@ -57,16 +63,17 @@ namespace OpenVic2 { Region* get_region_by_identifier(std::string const& identifier); Region const* get_region_by_identifier(std::string const& identifier) const; - return_t generate_province_index_image(size_t new_width, size_t new_height, uint8_t const* colour_data); + return_t generate_province_shape_image(size_t new_width, size_t new_height, uint8_t const* colour_data); size_t get_width() const; size_t get_height() const; - std::vector<index_t> const& get_province_index_image() const; + std::vector<shape_pixel_t> const& get_province_shape_image() const; return_t add_mapmode(std::string const& identifier, Mapmode::colour_func_t colour_func); void lock_mapmodes(); size_t get_mapmode_count() const; Mapmode const* get_mapmode_by_index(Mapmode::index_t index) const; Mapmode const* get_mapmode_by_identifier(std::string const& identifier) const; + static constexpr size_t MAPMODE_COLOUR_SIZE = 3; return_t generate_mapmode_colours(Mapmode::index_t index, uint8_t* target) const; return_t generate_province_buildings(BuildingManager const& manager); |