66 if (str ==
"warning") {
69 if (str ==
"mangle") {
74 std::string lower_str = str;
75 std::ranges::transform(
76 lower_str, lower_str.begin(), [](
unsigned char c) { return static_cast<char>(std::tolower(c)); });
79 if (lower_str ==
"error") {
82 if (lower_str ==
"err") {
86 if (lower_str ==
"warning") {
89 if (lower_str ==
"warn") {
93 if (lower_str ==
"mangle") {
120 panic(
"unhandled AnimKeyFrameResolutionStrategy value");
138struct std::formatter<
porytiles::AnimKeyFrameResolutionStrategy> {
139 constexpr auto parse(std::format_parse_context &ctx)
void panic(const StringViewSourceLoc &s)
Unconditionally terminates the program with a panic message.
std::ostream & operator<<(std::ostream &os, const PrimaryPairingMode m)
Stream insertion operator for PrimaryPairingMode.
AnimKeyFrameResolutionStrategy
Strategy for handling duplicate key frame tiles in animation decompilation.
@ warning
Emit a warning and continue decompilation.
@ mangle
Mangle duplicate tiles to make them unique, then backport changes to tiles.png.
@ error
Emit a formatted error and fail decompilation.
std::string to_string(const PrimaryPairingMode m)
Converts a PrimaryPairingMode to its canonical string representation.
std::optional< AnimKeyFrameResolutionStrategy > anim_key_frame_resolution_strategy_from_str(const std::string &str)
Parses a string into a AnimKeyFrameResolutionStrategy with fuzzy matching.