Add data writing for IPaks

This commit is contained in:
Jan
2023-10-15 17:54:10 +02:00
parent 2d0ef40335
commit abbb697d7c
5 changed files with 157 additions and 18 deletions

View File

@ -3,10 +3,18 @@
namespace utils
{
template <typename T>
constexpr T Align(T value, T toNext)
constexpr T Align(const T value, const T toNext)
{
if (toNext > 0)
return (value + toNext - 1) / toNext * toNext;
return value;
}
template <typename T>
constexpr T AlignToPrevious(const T value, const T toPrevious)
{
if (toPrevious > 0)
return value / toPrevious * toPrevious;
return value;
}
}