Use an iterator template for enum sequence loops (#1228)

This commit is contained in:
Rangi
2023-11-12 03:19:19 -05:00
committed by GitHub
parent d390db5c57
commit e824e34526
9 changed files with 60 additions and 17 deletions

View File

@@ -110,7 +110,8 @@ static constexpr auto flipTable(std::integer_sequence<T, i...>) {
return byte;
}(i)...};
}
}
} // namespace detail
// Flipping tends to happen fairly often, so take a bite out of dcache to speed it up
static constexpr auto flipTable = detail::flipTable(std::make_integer_sequence<uint16_t, 256>());

View File

@@ -21,6 +21,6 @@ namespace packing {
std::tuple<DefaultInitVec<size_t>, size_t>
overloadAndRemove(std::vector<ProtoPalette> const &protoPalettes);
}
} // namespace packing
#endif // RGBDS_GFX_PAL_PACKING_HPP

View File

@@ -21,6 +21,6 @@ void grayscale(std::vector<Palette> &palettes,
std::array<std::optional<Rgba>, 0x8001> const &colors);
void rgb(std::vector<Palette> &palettes);
}
} // namespace sorting
#endif // RGBDS_GFX_PAL_SORTING_HPP