37 panic(
"invalid LayerMode integer: " + std::to_string(s));
67 panic(
"unhandled LayerMode value");
96 return "Normal - Middle/Top";
98 return "Covered - Bottom/Middle";
100 return "Split - Bottom/Top";
102 panic(
"to_string(LayerType) unknown LayerType");
138 panic(
"layer_type_csv_token unknown LayerType");
153 lower.reserve(token.size());
154 for (
const unsigned char c : token) {
155 lower.push_back(
static_cast<char>(std::tolower(c)));
158 if (lower ==
"normal") {
161 if (lower ==
"covered") {
164 if (lower ==
"split") {
168 "invalid layer_type token '{}': must be 'normal', 'covered', or 'split'",
FormatParam{token,
Style::bold}};
175 constexpr auto parse(std::format_parse_context &ctx)
188 constexpr auto parse(std::format_parse_context &ctx)
A result type that maintains a chainable sequence of errors for debugging and error reporting.
static const Style bold
Bold text formatting.
std::optional< LayerMode > layer_mode_from_str(const std::string &s)
Converts a string to LayerMode.
LayerMode
Specifies whether a metatile uses dual-layer or triple-layer mode.
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
std::string layer_type_csv_token(LayerType layer_type)
Converts a LayerType to its lowercase CSV token.
LayerMode layer_mode_from_val(std::size_t s)
Converts a numeric value to LayerMode.
ChainableResult< LayerType > layer_type_from_int(unsigned int i)
Converts an integer to LayerType.
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
ChainableResult< LayerType > layer_type_from_csv_token(const std::string &token)
Parses a CSV layer_type token into a LayerType.
LayerType
Specifies which layers of a metatile are used for rendering.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.
@ split
Split the animation into separate animations for each palette variant (not yet implemented).