aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic2/map/Map.hpp
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-04-29 21:00:44 +0200
committer Hop311 <hop3114@gmail.com>2023-04-29 21:00:44 +0200
commit7e2700514652212e50a006ad525e7c7ca8e7840c (patch)
tree681431640bca4f25f5e383cc7960e5ff228b47cc /extension/src/openvic2/map/Map.hpp
parent1f8545facd248bbf4ea0cd551fea5f7d9b0efdce (diff)
Terrain textures + province colour alpha channel
Diffstat (limited to 'extension/src/openvic2/map/Map.hpp')
-rw-r--r--extension/src/openvic2/map/Map.hpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/extension/src/openvic2/map/Map.hpp b/extension/src/openvic2/map/Map.hpp
index e5be9c7..a075505 100644
--- a/extension/src/openvic2/map/Map.hpp
+++ b/extension/src/openvic2/map/Map.hpp
@@ -1,9 +1,9 @@
#pragma once
#include <functional>
+#include <unordered_map>
-#include "openvic2/map/Region.hpp"
-#include "openvic2/Types.hpp"
+#include "Region.hpp"
namespace OpenVic2 {
@@ -26,10 +26,12 @@ namespace OpenVic2 {
* MAP-4
*/
struct Map {
+ using terrain_t = uint8_t;
+ using terrain_variant_map_t = std::unordered_map<colour_t, terrain_t>;
#pragma pack(push, 1)
struct shape_pixel_t {
index_t index;
- uint8_t terrain;
+ terrain_t terrain;
};
#pragma pack(pop)
private:
@@ -63,7 +65,8 @@ 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_shape_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,
+ uint8_t const* terrain_data, terrain_variant_map_t const& terrain_variant_map);
size_t get_width() const;
size_t get_height() const;
std::vector<shape_pixel_t> const& get_province_shape_image() const;
@@ -73,7 +76,7 @@ namespace OpenVic2 {
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;
+ static constexpr size_t MAPMODE_COLOUR_SIZE = 4;
return_t generate_mapmode_colours(Mapmode::index_t index, uint8_t* target) const;
return_t generate_province_buildings(BuildingManager const& manager);