26 ||
layer == LAYER_SPECIAL3);
33 const QString &tag, extrastyle_id style)
38 if (style == ESTYLE_SINGLE1 &&
type() == LAYER_SPECIAL1) {
40 }
else if (style == ESTYLE_SINGLE2 &&
type() == LAYER_SPECIAL2) {
42 }
else if (style == ESTYLE_3LAYER) {
43 auto full_tag_name = QStringLiteral(
"%1_bg").arg(tag);
44 if (
type() == LAYER_SPECIAL2) {
45 full_tag_name = QStringLiteral(
"%1_mg").arg(tag);
46 }
else if (
type() == LAYER_SPECIAL3) {
47 full_tag_name = QStringLiteral(
"%1_fg").arg(tag);
61 std::make_unique<drawn_sprite>(
tileset(), sprite,
true, offset);
65 std::vector<drawn_sprite>
68 const unit *punit)
const
74 if (ptile ==
nullptr) {
78 auto sprites = std::vector<drawn_sprite>();
bool BV_ISSET(const BV &bv, int bit)
void initialize_extra(const extra_type *extra, const QString &tag, extrastyle_id style) override
Loads sprites for the extra if it has ESTYLE_SINGLE1/2 or ESTYLE_3LAYER.
void set_sprite(const extra_type *extra, const QString &tag, const QPoint &offset=QPoint())
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 reset_ruleset() override
Resets cached data that depends on the ruleset.
layer_special(struct tileset *ts, mapview_layer layer)
std::array< std::unique_ptr< drawn_sprite >, MAX_EXTRA_TYPES > m_sprites
A layer when drawing the map.
mapview_layer type() const
QPixmap * load_sprite(const QStringList &possible_names, bool required=false, bool verbose=true) const
Shortcut to load a sprite from the tileset.
struct tileset * tileset() const
#define fc_assert_ret(condition)
#define fc_assert(condition)
#define tile_has_extra(ptile, pextra)
QPoint tileset_full_tile_offset(const struct tileset *t)
Return the x and y offsets of full tiles in the tileset.
bool is_extra_drawing_enabled(const extra_type *pextra)
Should the given extra be drawn FIXME: Some extras can not be switched.