26 metatiles_bin_.push_back(std::move(entry));
31 metatile_attributes_.push_back(std::move(attribute));
37 panic(std::format(
"invalid pal index {}: out of range", pal_index));
39 pals_.at(pal_index) = std::move(pal);
45 panic(std::format(
"invalid pal index {}: out of range", pal_index));
47 return pals_.at(pal_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
ChainableResult< LayerMode > detect_layer_mode() const
const Palette< Rgba32, pal::max_size > & pal_at(std::size_t pal_index) const
void add_anim(Animation< IndexPixel > anim)
const std::vector< MetatileAttribute > & metatile_attributes_bin() const
void push_back_tilemap_entry(TilemapEntry entry)
Add a TilemapEntry to the end of the entry vector.
void set_pal(std::size_t pal_index, Palette< Rgba32, pal::max_size > pal)
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_pals
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.