26 metatiles_bin_.push_back(std::move(entry));
31 metatile_attributes_.push_back(std::move(attribute));
37 panic(std::format(
"invalid palette index {}: out of range", palette_index));
39 palettes_.at(palette_index) = std::move(palette);
45 panic(std::format(
"invalid palette index {}: out of range", palette_index));
47 return palettes_.at(palette_index);
52 return metatiles_bin_.empty();
59 const std::size_t metatile_count = attributes.size();
71 std::vector<std::string>{
72 "unexpected tilemap entry count in metatiles.bin",
73 "found {} tilemap entries for {} metatile attributes",
74 "for dual layer metatiles, expected {} entries ({} per metatile)",
75 "for triple layer metatiles, expected {} entries ({} per metatile)"},
76 std::vector<std::vector<FormatParam>>{
87 const std::string &
name = anim.
name();
88 if (anims_.contains(
name)) {
89 panic(
"animation '" +
name +
"' already exists in PorymapTilesetComponent");
91 anims_.insert({
name, std::move(anim)});
A complete tileset animation with name, configuration, and frame data.
const std::string & name() const
A result type that maintains a chainable sequence of errors for debugging and error reporting.
A generic palette container for colors that support transparency checking.
PorymapTilesetComponent()
const std::vector< TilemapEntry > & metatiles_bin() const
const Palette< Rgba32, palette::max_size > & palette_at(std::size_t palette_index) const
ChainableResult< LayerMode > detect_layer_mode() const
void add_anim(Animation< IndexPixel > anim)
const std::vector< MetatileAttribute > & metatile_attributes_bin() const
void set_palette(std::size_t palette_index, Palette< Rgba32, palette::max_size > palette)
void push_back_tilemap_entry(TilemapEntry entry)
Add a TilemapEntry to the end of the entry vector.
void push_back_attribute(MetatileAttribute attribute)
Add a MetatileAttribute to the end of the attribute vector.
Represents a 32-bit RGBA color.
static const Style bold
Bold text formatting.
Represents a tilemap entry referencing a tile with palette and flip attributes.
constexpr std::size_t num_palettes
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.