17 layer_mode, component.
detect_layer_mode(),
"layer mode detection failed", std::vector<TilemapEntry>);
28 std::vector<TilemapEntry> result;
34 for (std::size_t i = 0; i < num_metatiles; ++i) {
36 constexpr std::size_t transparent_entries = 4;
37 const auto &attribute = metatile_attributes[i];
40 switch (attribute.layer_type()) {
43 for (std::size_t j = 0; j < transparent_entries; ++j) {
44 result.push_back(transparent);
48 result.push_back(metatiles_bin[input_offset + j]);
55 result.push_back(metatiles_bin[input_offset + j]);
58 for (std::size_t j = 0; j < transparent_entries; ++j) {
59 result.push_back(transparent);
65 for (std::size_t j = 0; j < transparent_entries; ++j) {
66 result.push_back(metatiles_bin[input_offset + j]);
69 for (std::size_t j = 0; j < transparent_entries; ++j) {
70 result.push_back(transparent);
74 result.push_back(metatiles_bin[input_offset + j]);
86 layer_mode, component.
detect_layer_mode(),
"layer mode detection failed", std::vector<TilemapEntry>);
92 panic(
"TODO: implement");
#define PT_TRY_ASSIGN_CHAIN_ERR(var, expr, msg, return_type)
Unwraps a ChainableResult, chaining a new error message on failure.
A result type that maintains a chainable sequence of errors for debugging and error reporting.
ChainableResult< std::vector< TilemapEntry > > triple_layerize(const PorymapTilesetComponent &component)
Converts a tileset component to triple-layer format.
ChainableResult< std::vector< TilemapEntry > > dual_layerize(const PorymapTilesetComponent &component)
TODO.
const std::vector< TilemapEntry > & metatiles_bin() const
ChainableResult< tileset::LayerMode > detect_layer_mode() const
const std::vector< MetatileAttribute > & metatile_attributes_bin() const
Represents a tilemap entry referencing a tile with palette and flip attributes.
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.