25 auto color =
load_sprite({
"colors.overlay_0"},
true);
26 auto unworked =
load_sprite({
"mask.unworked_tile"},
true);
29 auto mask = std::unique_ptr<QPixmap>(
31 auto selected = std::unique_ptr<QPixmap>(
32 crop_sprite(mask.get(), 0, 0, W, H, unworked, 0, 0));
39 std::vector<drawn_sprite>
42 const unit *punit)
const
48 std::vector<drawn_sprite> sprs;
QPixmap crop_sprite(const QPixmap *sprite)
Helper function to crop a sprite.
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.
layer_editor(struct tileset *ts)
void load_sprites() override
Loads all sprites that do not depend on the ruleset.
QPixmap * m_starting_position
A layer when drawing the map.
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
bool editor_tile_is_selected(const struct tile *ptile)
Returns TRUE if the given tile is selected.
bool editor_is_active()
Returns TRUE if the client is in edit mode.
struct startpos * map_startpos_get(const struct tile *ptile)
Returns the start position at the given tile, or nullptr if none exists there.
const QPixmap * get_mask_sprite(const struct tileset *t)
Return tile mask sprite.
int tileset_tile_height(const struct tileset *t)
Return the tile height of the current tileset.
int tileset_tile_width(const struct tileset *t)
Return the tile width of the current tileset.