72 bool add_tag(
const QString &tag,
const QString &sprite_name);
81 std::vector<drawn_sprite>
84 const unit *punit)
const override;
108 terrain **tterrain_near)
const;
111 terrain **tterrain_near)
const;
Draws terrain sprites on the map.
bool add_tag(const QString &tag, const QString &sprite_name)
Makes a terrain tag available for use by this layer.
matching_group * group(const QString &name)
Retrieves the group structure of the provided name.
int terrain_group(const terrain *pterrain) const
Retrieves the group number for a given terrain.
void fill_blending_sprite_array(std::vector< drawn_sprite > &sprs, const tile *ptile, const terrain *pterrain, terrain **tterrain_near) const
Helper function for fill_sprite_array.
void initialize_cell_corner_match_none(const terrain *terrain, terrain_info &info)
Sets up terrain information for CELL_CORNER and MATCH_NONE.
void initialize_cell_corner_match_full(const terrain *terrain, terrain_info &info)
Sets up terrain information for CELL_CORNER and MATCH_FULL.
bool set_tag_matches_with(const QString &tag, const QString &group_name)
Sets the specified tag to be matched against a group.
std::map< int, terrain_info > m_terrain_info
Every terrain drawn in this layer appears here.
bool set_tag_offsets(const QString &tag, int offset_x, int offset_y)
Sets the offsets used to draw the specified tag.
layer_terrain(struct tileset *ts, int number)
sprite_type
Indicates how many sprites are used to draw a tile.
@ CELL_WHOLE
One sprite for the entire tile.
@ CELL_HEX_CORNER
One sprite for each hexagonal corner of the tile.
@ CELL_CORNER
One sprite for each corner of the tile.
bool set_tag_sprite_type(const QString &tag, sprite_type type)
Sets the type of sprite used to draw the specified tag.
void fill_terrain_sprite_array(std::vector< drawn_sprite > &sprs, const tile *ptile, const terrain *pterrain, terrain **tterrain_near) const
Helper function for fill_sprite_array.
void initialize_cell_whole_match_none(const terrain *terrain, terrain_info &info)
Sets up terrain information for CELL_WHOLE and MATCH_SAME.
void initialize_cell_corner_match_pair(const terrain *terrain, terrain_info &info)
Sets up terrain information for CELL_CORNER and MATCH_PAIR.
void enable_blending(const QString &tag)
Enable blending on this layer for the given terrain tag.
void initialize_cell_corner_match_same(const terrain *terrain, terrain_info &info)
Sets up terrain information for CELL_CORNER and MATCH_SAME.
std::map< QString, terrain_info > m_terrain_tag_info
Before terrains are loaded, this contains the list of available terrain tags.
virtual ~layer_terrain()=default
std::vector< drawn_sprite > fill_sprite_array(const tile *ptile, const tile_edge *pedge, const tile_corner *pcorner, const unit *punit) const override
Returns the list of sprites drawn by this layer somewhere on the map.
void initialize_terrain(const terrain *terrain) override
Sets up the structure to draw the specified terrain.
void initialize_cell_whole_match_same(const terrain *terrain, terrain_info &info)
Sets up terrain information for CELL_WHOLE and MATCH_SAME.
std::vector< std::unique_ptr< QPixmap > > m_allocated
List of those sprites in 'cells' that are allocated by some other means than load_sprite() and thus a...
void initialize_blending(const terrain *terrain, terrain_info &info)
Initializes blending sprites.
bool set_tag_matching_group(const QString &tag, const QString &group_name)
Sets the matching group for the specified tag.
std::map< QChar, matching_group > m_matching_groups
constexpr static auto MAX_NUM_MATCH_WITH
void initialize_cell_hex_corner(const terrain *terrain, terrain_info &info)
Sets up terrain information for CELL_HEX_CORNER.
bool create_matching_group(const QString &name)
Creates a matching group with the given name.
A layer when drawing the map.
mapview_layer type() const
std::vector< matching_group * > matches_with
std::array< QPixmap *, 4 > blend_sprites
std::vector< QPixmap * > sprites