aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/map/Map.hpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-04-29 00:40:18 +0200
committer GitHub <noreply@github.com>2023-04-29 00:40:18 +0200
commit05937359e8c53ee76dc3ce537dd70083a016f766 (patch)
tree899b97479f6a1aabbfe352747bea162ce5720193 /extension/src/openvic2/map/Map.hpp
parent10053cf259c55ee45803268a844edf1011d8a16b (diff)
parent5022ec800b096e9a85d6ef07ca4b652abb8625ee (diff)
Merge pull request #101 from OpenVic2Project/more-image-processing
Dynamic minimap + vertical map subdivision
Diffstat (limited to 'extension/src/openvic2/map/Map.hpp')
-rw-r--r--extension/src/openvic2/map/Map.hpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/extension/src/openvic2/map/Map.hpp b/extension/src/openvic2/map/Map.hpp
index ebc23be..dea9b29 100644
--- a/extension/src/openvic2/map/Map.hpp
+++ b/extension/src/openvic2/map/Map.hpp
@@ -25,6 +25,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;
@@ -33,7 +39,7 @@ namespace OpenVic2 {
size_t water_province_count = 0;
size_t width = 0, height = 0;
- std::vector<Province::index_t> province_index_image;
+ std::vector<shape_pixel_t> province_shape_image;
public:
Map();
@@ -56,16 +62,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<Province::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);